From 7a551a14f596518617190b117bfdc8d74797e2d0 Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Mon, 27 Nov 2023 12:44:39 +0100 Subject: [PATCH 1/9] Fix python versions in deploy ci --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index f97dee7..c90f8ef 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -34,7 +34,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, macos-latest] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.9", "3.10", "3.11", "3.12"] include: # Using pythons inside a docker image to provide all the Linux # python-versions permutations. From 4d4e878a19dbc861e11a19a6929cddb77a3ed9a2 Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Mon, 27 Nov 2023 13:11:26 +0100 Subject: [PATCH 2/9] Harmonize version numbers --- .github/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index c90f8ef..95fc7e8 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -34,13 +34,13 @@ jobs: fail-fast: false matrix: os: [windows-latest, macos-latest] - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12"] include: # Using pythons inside a docker image to provide all the Linux # python-versions permutations. - name: manylinux 64-bit os: ubuntu-latest - python-version: 3.8 + python-version: 3.11 docker-image: manylinux2014_x86_64 steps: From 045fa675d4465be30a7dcae3300d1fbdd9f2b5bc Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Mon, 27 Nov 2023 13:15:44 +0100 Subject: [PATCH 3/9] Harmonize ci.yaml --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ad8e703..9621c96 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: os: ["windows-latest", "ubuntu-latest", "macos-latest"] - python-version: ["3.9", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12"] experimental: [false] include: - python-version: "3.12" @@ -96,4 +96,3 @@ jobs: uses: AndreMiras/coveralls-python-action@develop with: parallel-finished: true - From 990c22e07da55cadcec1fb6cb93316c63f3a88cb Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Mon, 27 Nov 2023 14:00:16 +0100 Subject: [PATCH 4/9] Update required python in 3.10 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f686720..a397172 100644 --- a/setup.py +++ b/setup.py @@ -105,7 +105,7 @@ "Topic :: Scientific/Engineering"], url="https://github.com/pytroll/python-geotiepoints", packages=find_packages(), - python_requires='>=3.9', + python_requires='>=3.10', cmdclass=cmdclass, install_requires=requirements, ext_modules=EXTENSIONS, From 95ec6eb8b98bf98b34b06aac003cbdc502cca5f6 Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Mon, 27 Nov 2023 14:18:57 +0100 Subject: [PATCH 5/9] Attempt at switching to CI buildwheels --- .github/workflows/deploy.yaml | 79 ++++++++++++++--------------------- 1 file changed, 32 insertions(+), 47 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 95fc7e8..3babfd9 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,9 +1,9 @@ name: Deploy sdist and wheels + on: push: - tags: - - v* + pull_request: release: types: - published @@ -18,7 +18,7 @@ jobs: - name: Create sdist shell: bash -l {0} run: | - pip install -q build + python -m pip install -q build python -m build -s - name: Upload sdist to build artifacts @@ -27,66 +27,44 @@ jobs: name: sdist path: dist/*.tar.gz - build_wheels: + name: "Build wheels on ${{ matrix.os }} ${{ matrix.cibw_archs }}" runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [windows-latest, macos-latest] - python-version: ["3.10", "3.11", "3.12"] include: - # Using pythons inside a docker image to provide all the Linux - # python-versions permutations. - - name: manylinux 64-bit - os: ubuntu-latest - python-version: 3.11 - docker-image: manylinux2014_x86_64 + - os: windows-2019 + cibw_archs: "AMD64 ARM64" + - os: macos-11 + cibw_archs: "x86_64 arm64" + - os: "ubuntu-20.04" + cibw_archs: "aarch64" + - os: "ubuntu-20.04" + cibw_archs: "x86_64" steps: - uses: actions/checkout@v4 - run: | git fetch --prune --unshallow - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 with: - python-version: "${{ matrix.python-version }}" - - - name: Install dependencies - run: | - python -m pip install -U -q pip Cython wheel setuptools twine numpy build + platforms: all - - name: Build and install macOS/Windows wheel - if: matrix.os != 'ubuntu-latest' - # see https://setuptools.readthedocs.io/en/latest/build_meta.html - run: | - python -m build - pip install --find-links=./dist/ python-geotiepoints - - - name: Build Linux wheels inside docker - if: matrix.os == 'ubuntu-latest' - run: | - docker run \ - -e PLAT=${{ matrix.docker-image }} \ - -e USE_OMP=1 \ - -v `pwd`:/io \ - quay.io/pypa/${{ matrix.docker-image }} \ - /io/continuous_integration/build-manylinux-wheels.sh + - name: Build wheels + uses: pypa/cibuildwheel@v2.16.2 + env: + CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *-manylinux_i686 *-musllinux_i686 *-musllinux_aarch64 *-win32" + CIBW_ARCHS: "${{ matrix.cibw_archs }}" + CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64" - - name: Check version number from inside wheel - if: matrix.docker-image != 'manylinux2014_i686' - run: | - mv geotiepoints unused_src_to_prevent_local_import - python -m pip install --find-links=./dist/ python-geotiepoints - python -c "import geotiepoints; print(geotiepoints.__file__, geotiepoints.__version__)" - python -c "import geotiepoints; assert 'unknown' not in geotiepoints.__version__, 'incorrect version found'" - - - name: Upload wheel(s) as build artifacts - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v3 with: name: wheels - path: dist/*.whl + path: ./wheelhouse/*.whl upload_test_pypi: needs: [build_sdist, build_wheels] @@ -110,7 +88,7 @@ jobs: password: ${{ secrets.test_pypi_password }} repository_url: https://test.pypi.org/legacy/ - upload_pypi: + upload_to_pypi: needs: [build_sdist, build_wheels] runs-on: ubuntu-latest steps: @@ -124,6 +102,13 @@ jobs: with: name: wheels path: dist + - name: Publish package to Test PyPI + if: github.event.action != 'published' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + uses: pypa/gh-action-pypi-publish@v1.8.10 + with: + user: __token__ + password: ${{ secrets.test_pypi_password }} + repository_url: https://test.pypi.org/legacy/ - name: Publish package to PyPI if: github.event.action == 'published' uses: pypa/gh-action-pypi-publish@v1.8.10 From 9053ea976e14fb0117f13fcd8fe32721efdf1fae Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Mon, 27 Nov 2023 14:55:23 +0100 Subject: [PATCH 6/9] Try fixing test pypi upload --- .github/workflows/deploy.yaml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 3babfd9..d322907 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -66,28 +66,6 @@ jobs: name: wheels path: ./wheelhouse/*.whl - upload_test_pypi: - needs: [build_sdist, build_wheels] - runs-on: ubuntu-latest - steps: - - name: Download sdist artifact - uses: actions/download-artifact@v3 - with: - name: sdist - path: dist - - name: Download wheels artifact - uses: actions/download-artifact@v3 - with: - name: wheels - path: dist - - name: Publish package to PyPI - if: github.event.action != 'published' - uses: pypa/gh-action-pypi-publish@v1.8.10 - with: - user: __token__ - password: ${{ secrets.test_pypi_password }} - repository_url: https://test.pypi.org/legacy/ - upload_to_pypi: needs: [build_sdist, build_wheels] runs-on: ubuntu-latest @@ -103,7 +81,7 @@ jobs: name: wheels path: dist - name: Publish package to Test PyPI - if: github.event.action != 'published' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + if: github.event.action != 'published' && github.event_name == 'push' uses: pypa/gh-action-pypi-publish@v1.8.10 with: user: __token__ From 90f6b7b29d9d1f3f3947eb9a0fdd4bdbc15949e3 Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Mon, 27 Nov 2023 15:24:40 +0100 Subject: [PATCH 7/9] Try publishing to test pypi --- .github/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d322907..8395a25 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -79,9 +79,9 @@ jobs: uses: actions/download-artifact@v3 with: name: wheels - path: dist + path: wheelhouse - name: Publish package to Test PyPI - if: github.event.action != 'published' && github.event_name == 'push' + if: github.event.action != 'published' uses: pypa/gh-action-pypi-publish@v1.8.10 with: user: __token__ From e3c50631b759bff200d8ca297b91c4d00db46420 Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Mon, 27 Nov 2023 15:25:36 +0100 Subject: [PATCH 8/9] Revert erraneous change --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 8395a25..a9f26f0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -79,7 +79,7 @@ jobs: uses: actions/download-artifact@v3 with: name: wheels - path: wheelhouse + path: dist - name: Publish package to Test PyPI if: github.event.action != 'published' uses: pypa/gh-action-pypi-publish@v1.8.10 From 87739e575f9ed1210e2fb7844d28db129bc41bbe Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Mon, 27 Nov 2023 16:56:08 +0100 Subject: [PATCH 9/9] Do not deploy to test pypi on pull requests --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index a9f26f0..d322907 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -81,7 +81,7 @@ jobs: name: wheels path: dist - name: Publish package to Test PyPI - if: github.event.action != 'published' + if: github.event.action != 'published' && github.event_name == 'push' uses: pypa/gh-action-pypi-publish@v1.8.10 with: user: __token__