From ddfcbcb5fbfc6abf5d37b385b773d8a6b67c578e Mon Sep 17 00:00:00 2001 From: mworion Date: Sun, 19 Nov 2023 09:18:05 +0100 Subject: [PATCH 01/10] add support python 3.12, update actions --- .../workflows/build-wheels-upload-pypi.yml | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-wheels-upload-pypi.yml b/.github/workflows/build-wheels-upload-pypi.yml index 7b9b0f7..6b0fbf6 100644 --- a/.github/workflows/build-wheels-upload-pypi.yml +++ b/.github/workflows/build-wheels-upload-pypi.yml @@ -27,18 +27,20 @@ jobs: steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: install_python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: 3.12 # For the build, sep needs numpy and cython and we add twine and wheel # for better testing and checking. + - name: Update PIP + run: python -m pip install pip --upgrade - name: Install dependencies - run: python -m pip install twine numpy wheel cython + run: python -m pip install setuptools twine numpy wheel cython - name: Build sdist run: python setup.py sdist @@ -51,7 +53,7 @@ jobs: run: twine check dist/* - name: Upload sdist - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: dist path: dist/*.tar.gz @@ -61,7 +63,7 @@ jobs: # Second the wheels are build for different OS and python versions. This is # done with the help of the `cibuildwheel` package. # - # The wheels are built for Windows, Linux and MacOS and the python versions + # The wheels are built for Windows, Linux and macOS and the python versions # 3.5 - 3.10. # # The three operating system could be done in parallel. @@ -73,16 +75,17 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.9] + python-version: [3.12] os: [windows-latest, macos-latest, ubuntu-latest] include: - - os: ubuntu-20.04 + - os: ubuntu-22.04 cibw_archs: "aarch64" - + python-version: 3.12 + steps: - name: setup QEMU if: matrix.cibw_archs == 'aarch64' - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 @@ -90,7 +93,7 @@ jobs: uses: actions/checkout@v3 - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -124,7 +127,7 @@ jobs: shell: bash - name: Upload wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: dist path: ./wheelhouse/*.whl @@ -144,15 +147,17 @@ jobs: if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') steps: - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 + with: + python-version: 3.12 - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: dist path: dist - name: upload_to_pypi - uses: pypa/gh-action-pypi-publish@v1.4.1 + uses: pypa/gh-action-pypi-publish@v1.8.10 with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} From cf1820504c87b7fb4ba1487f220118612e859773 Mon Sep 17 00:00:00 2001 From: mworion Date: Sun, 19 Nov 2023 09:39:36 +0100 Subject: [PATCH 02/10] limit 32 support to max python 3.12 and split the wheel generation --- .../workflows/build-wheels-upload-pypi.yml | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-wheels-upload-pypi.yml b/.github/workflows/build-wheels-upload-pypi.yml index 6b0fbf6..e373f77 100644 --- a/.github/workflows/build-wheels-upload-pypi.yml +++ b/.github/workflows/build-wheels-upload-pypi.yml @@ -73,7 +73,7 @@ jobs: CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" strategy: - max-parallel: 4 + max-parallel: 8 matrix: python-version: [3.12] os: [windows-latest, macos-latest, ubuntu-latest] @@ -100,28 +100,50 @@ jobs: - name: Install cibuildwheel run: python -m pip install cibuildwheel - - name: Build wheels + - name: Build wheels until 3.11 if: matrix.cibw_archs == 'aarch64' run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_BUILD: "cp3*" + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-*" CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_MANYLINUX_I686_IMAGE: manylinux2014 CIBW_BUILD_VERBOSITY: 1 CIBW_SKIP: '*-musllinux_*' CIBW_ARCHS_LINUX: "aarch64" - - name: Build wheels + - name: Build wheels until 3.11 if: matrix.cibw_archs != 'aarch64' run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_BUILD: "cp3*" + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-*" CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_MANYLINUX_I686_IMAGE: manylinux2014 CIBW_BUILD_VERBOSITY: 1 CIBW_SKIP: '*-musllinux_*' CIBW_ARCHS_LINUX: "auto" + - name: Build wheels from 3.12 + if: matrix.cibw_archs == 'aarch64' + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: "cp312-*" + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_MANYLINUX_I686_IMAGE: manylinux2014 + CIBW_BUILD_VERBOSITY: 1 + CIBW_SKIP: '*-musllinux_*' + CIBW_ARCHS_LINUX: "aarch64" + + - name: Build wheels from 3.12 + if: matrix.cibw_archs != 'aarch64' + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: "cp312-*" + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_MANYLINUX_I686_IMAGE: manylinux2014 + CIBW_BUILD_VERBOSITY: 1 + CIBW_SKIP: '*-musllinux_*' + CIBW_ARCHS_LINUX: "x86_64" + - name: Show files run: ls -lh wheelhouse shell: bash From 36cc7ed8f4a4e477cd92449fec22bdb6b43f24b4 Mon Sep 17 00:00:00 2001 From: mworion Date: Thu, 4 Jan 2024 16:11:16 +0100 Subject: [PATCH 03/10] define fork --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 2a61ebd..a154a05 100755 --- a/setup.py +++ b/setup.py @@ -50,15 +50,15 @@ "Topic :: Scientific/Engineering :: Astronomy", "Intended Audience :: Science/Research"] -setup(name="sep", +setup(name="sep_mw4", version=version, description=description, long_description=long_description, license="LGPLv3+", classifiers=classifiers, url="https://github.com/kbarbary/sep", - author="Kyle Barbary", - author_email="kylebarbary@gmail.com", + author="Michael Wuertenberger", + author_email="michael@wuertenberger.org", python_requires='>=3.5', install_requires=['numpy'], ext_modules=extensions) From c51e6f0c7b43762a3a4d18d5a2ab3188102a9dd9 Mon Sep 17 00:00:00 2001 From: mworion Date: Thu, 4 Jan 2024 16:12:25 +0100 Subject: [PATCH 04/10] define fork --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a154a05..7381a71 100755 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ long_description=long_description, license="LGPLv3+", classifiers=classifiers, - url="https://github.com/kbarbary/sep", + url="https://github.com/mworion/sep_mw4", author="Michael Wuertenberger", author_email="michael@wuertenberger.org", python_requires='>=3.5', From f122b2b811de8d6edcea4ee0ea521f3fb4c2b470 Mon Sep 17 00:00:00 2001 From: mworion Date: Thu, 4 Jan 2024 16:19:57 +0100 Subject: [PATCH 05/10] go for trusted publish --- .github/workflows/build-wheels-upload-pypi.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-wheels-upload-pypi.yml b/.github/workflows/build-wheels-upload-pypi.yml index e373f77..330aaea 100644 --- a/.github/workflows/build-wheels-upload-pypi.yml +++ b/.github/workflows/build-wheels-upload-pypi.yml @@ -181,6 +181,4 @@ jobs: - name: upload_to_pypi uses: pypa/gh-action-pypi-publish@v1.8.10 with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} skip_existing: true From f8a30a0bc0b6470cbe567e480d76c03467683388 Mon Sep 17 00:00:00 2001 From: mworion Date: Thu, 4 Jan 2024 16:59:06 +0100 Subject: [PATCH 06/10] go for trusted publish --- .github/workflows/build-wheels-upload-pypi.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels-upload-pypi.yml b/.github/workflows/build-wheels-upload-pypi.yml index 330aaea..84bbcd6 100644 --- a/.github/workflows/build-wheels-upload-pypi.yml +++ b/.github/workflows/build-wheels-upload-pypi.yml @@ -164,7 +164,10 @@ jobs: runs-on: [ubuntu-latest] needs: [build_wheels, build_sdist] - + environment: release + permissions: + id-token: write + # upload to PyPI on every tag starting with 'v' if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') @@ -181,4 +184,4 @@ jobs: - name: upload_to_pypi uses: pypa/gh-action-pypi-publish@v1.8.10 with: - skip_existing: true + skip-existing: true From 86dab11a7c4e19c119e0a5dbe9115c99b53c61fb Mon Sep 17 00:00:00 2001 From: mworion Date: Fri, 5 Jan 2024 13:43:34 +0100 Subject: [PATCH 07/10] try to correct import --- sep.pyx => sep_mw4.pyx | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename sep.pyx => sep_mw4.pyx (99%) diff --git a/sep.pyx b/sep_mw4.pyx similarity index 99% rename from sep.pyx rename to sep_mw4.pyx index ca1795b..d49743a 100644 --- a/sep.pyx +++ b/sep_mw4.pyx @@ -15,7 +15,7 @@ from cpython.version cimport PY_MAJOR_VERSION np.import_array() # To access the numpy C-API. -__version__ = "1.2.1" +__version__ = "1.2.1.1" # ----------------------------------------------------------------------------- # Definitions from the SEP C library diff --git a/setup.py b/setup.py index 7381a71..c0c4032 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools.extension import Extension # Synchronize version from code. -fname = "sep.pyx" +fname = "sep_mw4.pyx" version = re.findall(r"__version__ = \"(.*?)\"", open(fname).read())[0] # Detect if setup.py is being run with an argument that doesn't require From a5e4e22bfbb0735626290a9e7c15ddb1307b148d Mon Sep 17 00:00:00 2001 From: mworion Date: Fri, 5 Jan 2024 14:54:41 +0100 Subject: [PATCH 08/10] try to correct import --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c0c4032..31067a2 100755 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ description = "Astronomical source extraction and photometry library" -long_description = "http://sep.readthedocs.org" +long_description = "http://sep_mw4.readthedocs.org" classifiers = [ "Development Status :: 5 - Production/Stable", From 242f38d3efa8bc2fbeb0b8c2ae9f881a2c458544 Mon Sep 17 00:00:00 2001 From: mworion Date: Sun, 7 Jan 2024 19:40:03 +0100 Subject: [PATCH 09/10] rename to sep_mw4 --- sep_mw4.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sep_mw4.pyx b/sep_mw4.pyx index d49743a..71c3721 100644 --- a/sep_mw4.pyx +++ b/sep_mw4.pyx @@ -15,7 +15,7 @@ from cpython.version cimport PY_MAJOR_VERSION np.import_array() # To access the numpy C-API. -__version__ = "1.2.1.1" +__version__ = "1.2.1.2" # ----------------------------------------------------------------------------- # Definitions from the SEP C library From 6cf4541f260d5240aa4249bcf9a4b549679f65c2 Mon Sep 17 00:00:00 2001 From: mworion Date: Sun, 7 Jan 2024 20:16:52 +0100 Subject: [PATCH 10/10] update version --- sep_mw4.pyx | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sep_mw4.pyx b/sep_mw4.pyx index 71c3721..a9f2867 100644 --- a/sep_mw4.pyx +++ b/sep_mw4.pyx @@ -15,7 +15,7 @@ from cpython.version cimport PY_MAJOR_VERSION np.import_array() # To access the numpy C-API. -__version__ = "1.2.1.2" +__version__ = "1.2.2" # ----------------------------------------------------------------------------- # Definitions from the SEP C library diff --git a/setup.py b/setup.py index 31067a2..f640d70 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ sourcefiles = [fname] + glob(os.path.join("src", "*.c")) headerfiles = glob(os.path.join("src", "*.h")) include_dirs = [numpy.get_include(), "src"] - extensions = [Extension("sep", sourcefiles, include_dirs=include_dirs, + extensions = [Extension("sep_mw4", sourcefiles, include_dirs=include_dirs, depends=headerfiles, define_macros=[("_USE_MATH_DEFINES", "1")])] extensions = cythonize(extensions)