From ac2417f93f33a91acd038a81166a2b35b2a3075a Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Wed, 21 Feb 2024 14:32:08 +0000 Subject: [PATCH 01/16] Issue #12 try py312 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d46c85e..98fe539 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - python-ver: [3.7, 3.8, 3.9, '3.10', '3.11'] + python-ver: ['3.12'] os: [ubuntu-latest, windows-latest, macos-latest] experimental: [false] From 7159d28b8069c0885a8d46576d9f5e03a6c81d79 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Wed, 21 Feb 2024 15:18:56 +0000 Subject: [PATCH 02/16] Issue #12 try with build and no uploads --- .github/workflows/ci.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98fe539..7a5a882 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install wheel twine auditwheel + pip install wheel twine auditwheel build - name: Add msbuild to PATH if: matrix.os == 'windows-latest' @@ -37,8 +37,7 @@ jobs: cmake -G "Visual Studio 17 2022" -A x64 -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF -DCMAKE_INSTALL_PREFIX=../install .. cmake --build . cd ../ - python.exe setup.py sdist bdist_wheel --plat-name win_amd64 - python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/* --skip-existing + python.exe -m build --plat-name win_amd64 rm -r build rm -r install @@ -51,8 +50,7 @@ jobs: cmake -G "Visual Studio 17" -A Win32 -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF -DCMAKE_INSTALL_PREFIX=../install .. cmake --build . cd ../ - python.exe setup.py sdist bdist_wheel --plat-name win32 - python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/* --skip-existing + python.exe -m build --plat-name win32 rm -r build rm -r install @@ -64,6 +62,7 @@ jobs: cmake -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF .. make cd .. + python -m build - name: build ubuntu manylinux if: matrix.os == 'ubuntu-latest' @@ -71,11 +70,6 @@ jobs: with: python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' - - name: upload manylinux - if: matrix.os == 'ubuntu-latest' - run: | - python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/*-manylinux*.whl --skip-existing - - name: build macos if: matrix.os == 'macos-latest' run: | @@ -84,6 +78,5 @@ jobs: cmake -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF .. make cd .. - python setup.py sdist bdist_wheel - python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/* --skip-existing + python -m build From 223df4f57b122aaa2f1881b1add0fa542c659dd0 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Wed, 21 Feb 2024 15:20:33 +0000 Subject: [PATCH 03/16] Issue #12 fix tabs --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a5a882..64c8f96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: cmake -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF .. make cd .. - python -m build + python -m build - name: build ubuntu manylinux if: matrix.os == 'ubuntu-latest' From fe80ad9ca67c8f39f6233772c8924d3b2e13303b Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Wed, 21 Feb 2024 15:43:59 +0000 Subject: [PATCH 04/16] Issue #12 try pylong internals --- ndicapimodule.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/ndicapimodule.cxx b/ndicapimodule.cxx index ecabbd6..9b455b9 100644 --- a/ndicapimodule.cxx +++ b/ndicapimodule.cxx @@ -26,6 +26,7 @@ #define PyString_AsString PyUnicode_AsUTF8 #define PyIntObject PyLongObject //#define PY_INT_OBJECT_OB_IVAL(ob) PyLong_AsLong((PyObject*)(ob)) + #define CYTHON_USE_PYLONG_INTERNALS 0 #define PY_INT_OBJECT_OB_IVAL(ob) ob->ob_digit[0] #define cmpfunc PyAsyncMethods* #else From ebe42bc3c30d6fb6b73e476879e9998038ded0ab Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Wed, 21 Feb 2024 15:45:53 +0000 Subject: [PATCH 05/16] Issue #12 try pylong internals 1 --- ndicapimodule.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndicapimodule.cxx b/ndicapimodule.cxx index 9b455b9..6d4c78f 100644 --- a/ndicapimodule.cxx +++ b/ndicapimodule.cxx @@ -26,7 +26,7 @@ #define PyString_AsString PyUnicode_AsUTF8 #define PyIntObject PyLongObject //#define PY_INT_OBJECT_OB_IVAL(ob) PyLong_AsLong((PyObject*)(ob)) - #define CYTHON_USE_PYLONG_INTERNALS 0 + #define CYTHON_USE_PYLONG_INTERNALS 1 #define PY_INT_OBJECT_OB_IVAL(ob) ob->ob_digit[0] #define cmpfunc PyAsyncMethods* #else From 19e04b3fce70f1b2a3128e3b22e36f74efde0bbb Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 08:49:32 +0000 Subject: [PATCH 06/16] Issue #12 try hack from https://github.com/cython/cython/issues/5238 --- ndicapimodule.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndicapimodule.cxx b/ndicapimodule.cxx index 6d4c78f..27d9c88 100644 --- a/ndicapimodule.cxx +++ b/ndicapimodule.cxx @@ -27,7 +27,7 @@ #define PyIntObject PyLongObject //#define PY_INT_OBJECT_OB_IVAL(ob) PyLong_AsLong((PyObject*)(ob)) #define CYTHON_USE_PYLONG_INTERNALS 1 - #define PY_INT_OBJECT_OB_IVAL(ob) ob->ob_digit[0] + #define PY_INT_OBJECT_OB_IVAL(ob) ob->long_value->ob_digit[0] #define cmpfunc PyAsyncMethods* #else #define MOD_ERROR_VAL From 1f02f75bc9ca9100c7c63f7668e4c6bf264c1429 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 08:53:52 +0000 Subject: [PATCH 07/16] Issue #12 try hack from https://github.com/cython/cython/issues/5238 further down --- ndicapimodule.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndicapimodule.cxx b/ndicapimodule.cxx index 27d9c88..4981571 100644 --- a/ndicapimodule.cxx +++ b/ndicapimodule.cxx @@ -27,7 +27,7 @@ #define PyIntObject PyLongObject //#define PY_INT_OBJECT_OB_IVAL(ob) PyLong_AsLong((PyObject*)(ob)) #define CYTHON_USE_PYLONG_INTERNALS 1 - #define PY_INT_OBJECT_OB_IVAL(ob) ob->long_value->ob_digit[0] + #define PY_INT_OBJECT_OB_IVAL(ob) ob->long_value.ob_digit[0] #define cmpfunc PyAsyncMethods* #else #define MOD_ERROR_VAL From 86ae885a1b0221a76685991ce3e0c6c0577dec37 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 09:07:21 +0000 Subject: [PATCH 08/16] Issue #12 wrapped define in check python version --- ndicapimodule.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ndicapimodule.cxx b/ndicapimodule.cxx index 4981571..a50af87 100644 --- a/ndicapimodule.cxx +++ b/ndicapimodule.cxx @@ -27,7 +27,11 @@ #define PyIntObject PyLongObject //#define PY_INT_OBJECT_OB_IVAL(ob) PyLong_AsLong((PyObject*)(ob)) #define CYTHON_USE_PYLONG_INTERNALS 1 - #define PY_INT_OBJECT_OB_IVAL(ob) ob->long_value.ob_digit[0] + #if PY_MINOR_VERSION < 12 + #define PY_INT_OBJECT_OB_IVAL(ob) ob->long_value.ob_digit[0] + #else + #define PY_INT_OBJECT_OB_IVAL(ob) ob->ob_digit[0] + #endif #define cmpfunc PyAsyncMethods* #else #define MOD_ERROR_VAL From dc98248dc43b5b25ac499c1a305b82f4c967d418 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 09:08:38 +0000 Subject: [PATCH 09/16] Issue #12 remove unsupported flag from build command --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64c8f96..0cc5bca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: cmake -G "Visual Studio 17 2022" -A x64 -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF -DCMAKE_INSTALL_PREFIX=../install .. cmake --build . cd ../ - python.exe -m build --plat-name win_amd64 + python.exe -m build rm -r build rm -r install From eb7e749990b66441a039307871786d7ec8cddacd Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 09:25:47 +0000 Subject: [PATCH 10/16] Issue #12 swap defines around --- ndicapimodule.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndicapimodule.cxx b/ndicapimodule.cxx index a50af87..c5edc42 100644 --- a/ndicapimodule.cxx +++ b/ndicapimodule.cxx @@ -28,9 +28,9 @@ //#define PY_INT_OBJECT_OB_IVAL(ob) PyLong_AsLong((PyObject*)(ob)) #define CYTHON_USE_PYLONG_INTERNALS 1 #if PY_MINOR_VERSION < 12 - #define PY_INT_OBJECT_OB_IVAL(ob) ob->long_value.ob_digit[0] - #else #define PY_INT_OBJECT_OB_IVAL(ob) ob->ob_digit[0] + #else + #define PY_INT_OBJECT_OB_IVAL(ob) ob->long_value.ob_digit[0] #endif #define cmpfunc PyAsyncMethods* #else From b7d26a2e72be772cd1f97664e5f5b349358ba5a3 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 09:33:14 +0000 Subject: [PATCH 11/16] Issue #12 remove plat-name flag and many linux --- .github/workflows/ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0cc5bca..8bc6806 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: cmake -G "Visual Studio 17" -A Win32 -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF -DCMAKE_INSTALL_PREFIX=../install .. cmake --build . cd ../ - python.exe -m build --plat-name win32 + python.exe -m build rm -r build rm -r install @@ -64,12 +64,6 @@ jobs: cd .. python -m build - - name: build ubuntu manylinux - if: matrix.os == 'ubuntu-latest' - uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2010_x86_64 - with: - python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' - - name: build macos if: matrix.os == 'macos-latest' run: | From 12ef8f96cd0ff16c0b79e1e9388e4de686a26a30 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 10:03:28 +0000 Subject: [PATCH 12/16] Issue #12 restored full build matrix --- .github/workflows/ci.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bc6806..fb826b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - python-ver: ['3.12'] + python-ver: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12'] os: [ubuntu-latest, windows-latest, macos-latest] experimental: [false] @@ -38,6 +38,7 @@ jobs: cmake --build . cd ../ python.exe -m build + python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/* --skip-existing rm -r build rm -r install @@ -51,6 +52,7 @@ jobs: cmake --build . cd ../ python.exe -m build + python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/* --skip-existing rm -r build rm -r install @@ -64,6 +66,17 @@ jobs: cd .. python -m build + - name: build ubuntu manylinux + if: matrix.os == 'ubuntu-latest' + uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2010_x86_64 + with: + python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' + + - name: upload manylinux + if: matrix.os == 'ubuntu-latest' + run: | + python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/*-manylinux*.whl --skip-existing + - name: build macos if: matrix.os == 'macos-latest' run: | @@ -73,4 +86,5 @@ jobs: make cd .. python -m build + python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/* --skip-existing From f07c212462f799c97f4e5c81b3475576c30783e4 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 10:19:02 +0000 Subject: [PATCH 13/16] Issue #12 only do manylinux on py310 --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb826b9..4381627 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,12 +68,14 @@ jobs: - name: build ubuntu manylinux if: matrix.os == 'ubuntu-latest' + if: python-ver == '3.10' uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2010_x86_64 with: python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' - name: upload manylinux if: matrix.os == 'ubuntu-latest' + if: python-ver == '3.10' run: | python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/*-manylinux*.whl --skip-existing From 09ce27c067641cbc1e0057c81751c5d54512fe5c Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 10:22:12 +0000 Subject: [PATCH 14/16] Issue #12 try again if and statement --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4381627..811a386 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,14 +67,13 @@ jobs: python -m build - name: build ubuntu manylinux - if: matrix.os == 'ubuntu-latest' - if: python-ver == '3.10' + if: matrix.os == 'ubuntu-latest' && python-ver == '3.10' uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2010_x86_64 with: python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' - name: upload manylinux - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-latest' && python-ver == '3.10' if: python-ver == '3.10' run: | python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/*-manylinux*.whl --skip-existing From 515821feaf5c7395e507fe876d9bb88fbb3bed83 Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 10:23:05 +0000 Subject: [PATCH 15/16] Issue #12 try again if and statement --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 811a386..36b72c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,6 @@ jobs: - name: upload manylinux if: matrix.os == 'ubuntu-latest' && python-ver == '3.10' - if: python-ver == '3.10' run: | python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/*-manylinux*.whl --skip-existing From 79dde330aef01a96ef309d28896095a65814160a Mon Sep 17 00:00:00 2001 From: Stephen Thompson Date: Thu, 22 Feb 2024 10:24:07 +0000 Subject: [PATCH 16/16] Issue #12 try again if and statement --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36b72c6..43385f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,13 +67,13 @@ jobs: python -m build - name: build ubuntu manylinux - if: matrix.os == 'ubuntu-latest' && python-ver == '3.10' + if: matrix.os == 'ubuntu-latest' && matrix.python-ver == '3.10' uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2010_x86_64 with: python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' - name: upload manylinux - if: matrix.os == 'ubuntu-latest' && python-ver == '3.10' + if: matrix.os == 'ubuntu-latest' && matrix.python-ver == '3.10' run: | python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/*-manylinux*.whl --skip-existing