diff --git a/.github/workflows/build-wheels-upload-pypi.yml b/.github/workflows/build-wheels-upload-pypi.yml index 7b9b0f7..84bbcd6 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. @@ -71,18 +73,19 @@ jobs: CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" strategy: - max-parallel: 4 + max-parallel: 8 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,41 +93,63 @@ 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 }} - 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 - name: Upload wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: dist path: ./wheelhouse/*.whl @@ -139,21 +164,24 @@ 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') 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 }} - skip_existing: true + skip-existing: true diff --git a/sep.pyx b/sep_mw4.pyx similarity index 99% rename from sep.pyx rename to sep_mw4.pyx index ca1795b..a9f2867 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.2" # ----------------------------------------------------------------------------- # Definitions from the SEP C library diff --git a/setup.py b/setup.py index 2a61ebd..f640d70 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 @@ -33,14 +33,14 @@ 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) 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", @@ -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", + url="https://github.com/mworion/sep_mw4", + author="Michael Wuertenberger", + author_email="michael@wuertenberger.org", python_requires='>=3.5', install_requires=['numpy'], ext_modules=extensions)