Repository: eigency-org/eigency (language: python)

Issue:
GCC-specific cpp syntax in test code
https://github.com/wouterboomsma/eigency/blob/8aca3557ea926e547e18a6bb20a44046f6dd2a98/tests/eigency_tests/eigency_tests_cpp.cpp#L29

The 'j' literal suffix is GCC-specific syntax for complex numbers:
https://gcc.gnu.org/onlinedocs/gcc/Complex.html

This syntax should be swapped for a standard compliant syntax so we can build on Windows and MacOS.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 108e264..14b814a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -20,8 +20,8 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os: [ ubuntu-18.04, ubuntu-20.04 ]
-        python: [ "2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10" ]
+        os: [ ubuntu-18.04, ubuntu-20.04, windows-latest, macos-latest ]
+        python: [ "3.5", "3.6", "3.7", "3.8", "3.9", "3.10" ]
     runs-on: ${{ matrix.os }}
     steps:
       - uses: actions/checkout@v2
diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml
index a4c1d98..57e0acd 100644
--- a/.github/workflows/setup.yml
+++ b/.github/workflows/setup.yml
@@ -19,10 +19,15 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os: [ ubuntu-18.04, ubuntu-20.04 ]
-        python: [ "2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10" ]
+        os: [ ubuntu-18.04, ubuntu-20.04, windows-latest, macos-latest ]
+        python: [ "3.5", "3.6", "3.7", "3.8", "3.9", "3.10" ]
     runs-on: ${{ matrix.os }}
     steps:
+      - name: Install MSBuild
+        if: runner.os == 'Windows'
+        uses: microsoft/setup-msbuild@v1.1
+        with:
+          msbuild-architecture: x64
       - uses: actions/checkout@v2
       - name: Setup Python ${{ matrix.python }}
         uses: actions/setup-python@v2
@@ -30,7 +35,7 @@ jobs:
           python-version: ${{ matrix.python }}
       - name: Install build dependencies
         run: |
-          python -m pip install setuptools>=42 setuptools_scm numpy Cython
+          python -m pip install --upgrade setuptools>=42 setuptools_scm numpy Cython
       - name: Build and install eigency
         run: |
           python setup.py build
diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml
index 80d1d76..0ce3809 100644
--- a/.github/workflows/wheel.yml
+++ b/.github/workflows/wheel.yml
@@ -20,8 +20,8 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os: [ ubuntu-18.04, ubuntu-20.04 ]
-        python: [ "2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10" ]
+        os: [ ubuntu-18.04, ubuntu-20.04, windows-latest, macos-latest ]
+        python: [ "3.5", "3.6", "3.7", "3.8", "3.9", "3.10" ]
     runs-on: ${{ matrix.os }}
     steps:
       - uses: actions/checkout@v2
diff --git a/setup.py b/setup.py
index cbc3d7d..e605909 100644
--- a/setup.py
+++ b/setup.py
@@ -69,7 +69,6 @@
         "License :: OSI Approved :: MIT License",
         "Programming Language :: C++",
         "Programming Language :: Cython",
-        "Programming Language :: Python :: 2.7",
         "Programming Language :: Python :: 3.5",
         "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
@@ -87,6 +86,6 @@
     include_package_data=True,
     package_data={__package_name__: ["*.h", "*.pxd", "*.pyx", join(__eigen_lib_dir__, "*")] + eigen_data_files},
     exclude_package_data={__package_name__: [join(__eigen_lib_dir__, "CMakeLists.txt")]},
-    python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
+    python_requires=">=3.5",
     install_requires=["numpy"],
 )


Test patch:
diff --git a/tests/eigency_tests/eigency_tests.pyx b/tests/eigency_tests/eigency_tests.pyx
index d3d6922..22b32a1 100644
--- a/tests/eigency_tests/eigency_tests.pyx
+++ b/tests/eigency_tests/eigency_tests.pyx
@@ -143,11 +143,11 @@ def function_type_float32(np.ndarray[np.float32_t, ndim=2] array):
     return ndarray(_function_type_float(Map[ArrayXXf](array)))
 
 # Functions with different matrix types: long
-def function_type_long(np.ndarray[np.long_t, ndim=2] array):
+def function_type_long(np.ndarray[long, ndim=2] array):
     return ndarray(_function_type_long(FlattenedMap[Array, long, Dynamic, Dynamic](array)))
 
 # Functions with different matrix types: ulong
-def function_type_ulong(np.ndarray[np.ulong_t, ndim=2] array):
+def function_type_ulong(np.ndarray[unsigned long, ndim=2] array):
     return ndarray(_function_type_ulong(FlattenedMap[Array, ulong, Dynamic, Dynamic](array)))
 
 # Functions with different matrix types: int
diff --git a/tests/run_tests.py b/tests/run_tests.py
index e7e294f..2e3a0d6 100644
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -160,19 +160,19 @@ def test_function_type_int(self):
         mat_in = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], order="F")
         # # equivalent to:
         # mat_in = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], order='F', dtype=np.int_)
-        # # equivalent to:
-        # mat_in = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], order='F', dtype=np.long)
         mat_out = eigency_tests.function_type_long(mat_in)
         assert_array_equal(mat_in, mat_out)
 
     def test_function_type_long(self):
-        # C++ ulong - Note that this is the standard Python unsigned integer
-        mat_in = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], order="F", dtype=np.int)
+        # C++ long - Note that this is the standard Python integer
+        mat_in = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], order="F", dtype=int)
+        # # equivalent to:
+        # mat_in = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], order='F', dtype=np.int_)
         mat_out = eigency_tests.function_type_long(mat_in)
         assert_array_equal(mat_in, mat_out)
 
     def test_function_type_ulong(self):
-        # C++ long
+        # C++ ulong
         mat_in = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], order="F", dtype=np.uint)
         mat_out = eigency_tests.function_type_ulong(mat_in)
         assert_array_equal(mat_in, mat_out)