Repository: wannesm/dtaidistance (language: python)

Issue:
Install fails
Pip install does not work without --no-build-isolation

Failing Command: pip install dtaidistance==2.3.2

Working Command: pip install dtaidistance==2.3.2 --no-build-isolation --no-deps


Discussion / hints:
Facing a similar issue when trying to install dtaidistance==2.3.11 from Github at `git+https://github.com/wannesm/dtaidistance.git#egg=dtaidistance`. I believe this is due to incompatibilities introduced by the new [Cython version 3.0.0](https://pypi.org/project/Cython/#history) that was released earlier today. Installing cython==0.29.36 manually and then installing dtaidistance with the `--no-build-isolation` flag fixed things for me.
It is https://github.com/wannesm/dtaidistance/blob/0d1b41782aaabc4c05a1722dd8379f35939a6d55/pyproject.toml#L7 that has to be pinned for it to build without `--no-build-isolation`.

Fix patch:
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index a9e35043..afbec9c3 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -83,7 +83,7 @@ jobs:
       matrix:
         # os: [ubuntu-20.04,ubuntu-18.04]
         # python-version: ["3.8","3.9","3.10"]
-        os: [ubuntu-18.04]
+        os: [ubuntu-22.04]
         # cibuildwheel will automatically provide all Python versions
         python-version: ["3.9"]
     steps:
diff --git a/setup.py b/setup.py
index de52e266..a5458591 100755
--- a/setup.py
+++ b/setup.py
@@ -403,7 +403,7 @@ def check_openmp(cc_bin, noxpreprocessor, printfn=print):
     extensions.append(
         Extension(
             "dtaidistance.dtw_cc",
-            ["dtaidistance/dtw_cc.pyx", "dtaidistance/dtw_cc.pxd",
+            ["dtaidistance/dtw_cc.pyx",
              "dtaidistance/lib/DTAIDistanceC/DTAIDistanceC/dd_dtw.c",
              "dtaidistance/lib/DTAIDistanceC/DTAIDistanceC/dd_ed.c"
              ],
@@ -447,8 +447,8 @@ def check_openmp(cc_bin, noxpreprocessor, printfn=print):
     else:
         print("WARNING: Numpy was not found, preparing a version without Numpy support.")
 
-    ext_modules = cythonize(extensions)
-                            # compiler_directives={'language_level': "3"})
+    ext_modules = cythonize(extensions, language_level=2)
+
 else:
     print("WARNING: Cython was not found, preparing a pure Python version.")
     ext_modules = []


Test patch:
diff --git a/tests/test_bugsvis.py b/tests/test_bugsvis.py
index 09f08396..485106b0 100644
--- a/tests/test_bugsvis.py
+++ b/tests/test_bugsvis.py
@@ -73,7 +73,7 @@ def test_bug3():
             np.array([1., 2, 0, 0, 0, 0, 0, 1, 1, 3, 4, 5]),
             np.array([0., 0, 1, 2, 1, 0, 1]),
             np.array([0., 1, 2, 0, 0, 0, 0, 0]),
-            np.array([1., 2, 0, 0, 0, 0, 0, 1, 1])])
+            np.array([1., 2, 0, 0, 0, 0, 0, 1, 1])], dtype=object)
         ds = dtw.distance_matrix(series)
         print(ds)