From 8faf3d3f549022178f04b674a37586a2fd452544 Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Tue, 26 Nov 2024 12:25:55 +0100 Subject: [PATCH 01/10] Upgrade ci to 3.13 --- .github/workflows/ci.yaml | 4 ++-- pyproject.toml | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 33dad2e5..12edca29 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,10 +15,10 @@ jobs: fail-fast: true matrix: os: ["windows-latest", "ubuntu-latest", "macos-latest"] - python-version: ["3.9", "3.11", "3.12"] + python-version: ["3.11", "3.12", "3.13"] experimental: [false] include: - - python-version: "3.12" + - python-version: "3.13" os: "ubuntu-latest" experimental: true diff --git a/pyproject.toml b/pyproject.toml index 242b2a8b..f955160b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ convention = "google" max-complexity = 10 [tool.mypy] -python_version = "3.9" +python_version = "3.12" # See https://github.com/python/mypy/issues/12286 for automatic multi-platform support platform = "linux" # platform = win32 diff --git a/setup.py b/setup.py index 8c1d27a0..3d70e8d0 100644 --- a/setup.py +++ b/setup.py @@ -102,7 +102,7 @@ packages=find_packages(), package_data={'pyresample.test': ['test_files/*']}, include_package_data=True, - python_requires='>=3.9', + python_requires='>=3.10', setup_requires=['setuptools>=3.2'], install_requires=requirements, extras_require=extras_require, From ebe1882ca9a50204e3cb55e5567ee40a3a59e4b5 Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Tue, 21 Jan 2025 10:21:26 +0100 Subject: [PATCH 02/10] Fix min python version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3d70e8d0..5898a412 100644 --- a/setup.py +++ b/setup.py @@ -102,7 +102,7 @@ packages=find_packages(), package_data={'pyresample.test': ['test_files/*']}, include_package_data=True, - python_requires='>=3.10', + python_requires='>=3.11', setup_requires=['setuptools>=3.2'], install_requires=requirements, extras_require=extras_require, From 2640a8e70b67d5d18e9e3b055a34ae4a06f32884 Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Tue, 21 Jan 2025 10:36:33 +0100 Subject: [PATCH 03/10] Address mypy errors --- pyresample/_compat.py | 13 +------------ pyresample/utils/__init__.py | 6 +----- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/pyresample/_compat.py b/pyresample/_compat.py index 44daefc5..75616c43 100644 --- a/pyresample/_compat.py +++ b/pyresample/_compat.py @@ -17,15 +17,4 @@ # satpy. If not, see . """Backports and compatibility fixes for pyresample.""" -import sys - -if sys.version_info < (3, 10): - from importlib_metadata import entry_points # noqa -else: - from importlib.metadata import entry_points # noqa - -try: - from numpy.typing import ArrayLike # noqa -except ImportError: - # numpy <1.20 - from numpy import ndarray as ArrayLike # noqa +from importlib.metadata import entry_points # noqa diff --git a/pyresample/utils/__init__.py b/pyresample/utils/__init__.py index a06bb12c..45127284 100644 --- a/pyresample/utils/__init__.py +++ b/pyresample/utils/__init__.py @@ -16,12 +16,8 @@ # You should have received a copy of the GNU Lesser General Public License along # with this program. If not, see . """Miscellaneous utility functions for pyresample.""" -try: - from collections.abc import Mapping -except ImportError: - from collections import Mapping - import warnings +from collections.abc import Mapping import numpy as np From 6df6deb1108da8d4c360c8def59029ba10af0dbe Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Tue, 21 Jan 2025 11:28:29 +0100 Subject: [PATCH 04/10] Update rtd environment, os and mamba-forge versions --- .readthedocs.yml | 4 ++-- docs/environment.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index bf51795b..1377d73f 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,9 +1,9 @@ version: 2 build: - os: "ubuntu-20.04" + os: "ubuntu-lts-latest" tools: - python: "mambaforge-4.10" + python: "mambaforge-latest" # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/docs/environment.yml b/docs/environment.yml index ed5006df..9b9cc728 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -2,7 +2,7 @@ name: readthedocs channels: - conda-forge dependencies: - - python=3.10 + - python=3.12 - pip - xarray - zarr From 2e303de7cc3b0e5caf26ed3215fc2cddfe0ab737 Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Wed, 22 Jan 2025 10:45:36 +0100 Subject: [PATCH 05/10] Addressing reviewer comments --- continuous_integration/environment.yaml | 1 - pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index e1734d3b..0651c666 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -25,6 +25,5 @@ dependencies: - pytest - pytest-cov - pytest-lazy-fixtures - - importlib-metadata - sphinx-reredirects - odc-geo diff --git a/pyproject.toml b/pyproject.toml index f955160b..a158c33c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ convention = "google" max-complexity = 10 [tool.mypy] -python_version = "3.12" +python_version = "3.11" # See https://github.com/python/mypy/issues/12286 for automatic multi-platform support platform = "linux" # platform = win32 From edc97721b1789d74e8e50138f71d17e1481d58bf Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Fri, 24 Jan 2025 13:17:14 +0100 Subject: [PATCH 06/10] Ignore arg-type errors for hashing numpy arrays --- pyresample/geometry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyresample/geometry.py b/pyresample/geometry.py index 9e02ac77..0925c352 100644 --- a/pyresample/geometry.py +++ b/pyresample/geometry.py @@ -2126,8 +2126,8 @@ def update_hash(self, existing_hash: Optional[_Hash] = None) -> _Hash: if existing_hash is None: existing_hash = hashlib.sha1() # nosec: B324 existing_hash.update(self.crs_wkt.encode('utf-8')) - existing_hash.update(np.array(self.shape)) - existing_hash.update(np.array(self.area_extent)) + existing_hash.update(np.array(self.shape)) # type: ignore[arg-type] + existing_hash.update(np.array(self.area_extent)) # type: ignore[arg-type] return existing_hash @daskify_2in_2out From 54f872904e2f36f59f67c58a51b1d29475b2affe Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 24 Jan 2025 10:12:26 -0600 Subject: [PATCH 07/10] Overhaul wheel building Similar to https://github.com/storpipfugl/pykdtree/pull/136 --- .github/workflows/deploy.yaml | 71 ++++++++++------------------------- 1 file changed, 19 insertions(+), 52 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index c67e2007..a7811ce6 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -42,41 +42,36 @@ jobs: matrix: include: - os: windows-2019 - cibw_archs: "AMD64 ARM64" - artifact_name: "win" - - os: macos-12 - cibw_archs: "x86_64 arm64" - artifact_name: "mac" - - os: "ubuntu-20.04" + cibw_archs: "AMD64" + - os: windows-2019 + cibw_archs: "ARM64" + - os: macos-13 + cibw_archs: "x86_64" + - os: macos-14 + cibw_archs: "arm64" + - os: "ubuntu-24.04-arm" cibw_archs: "aarch64" - artifact_name: "ubuntu-aarch" - - os: "ubuntu-20.04" + - os: "ubuntu-22.04" cibw_archs: "x86_64" - artifact_name: "ubuntu-x86_64" steps: - uses: actions/checkout@v4 - run: | git fetch --prune --unshallow - - name: Set up QEMU - if: runner.os == 'Linux' - uses: docker/setup-qemu-action@v3 - with: - platforms: all - - name: Build wheels uses: pypa/cibuildwheel@v2.21.3 env: - CIBW_SKIP: "cp36-* cp37-* cp38-* cp313-* pp* *i686 *-musllinux*" + CIBW_SKIP: "cp36-* cp37-* cp38-* cp39-* cp310-* pp* *i686 *-musllinux*" CIBW_ARCHS: "${{ matrix.cibw_archs }}" CIBW_TEST_COMMAND: "python -c \"import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'\"" - CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64" + CIBW_TEST_SKIP: "*-win_arm64" + CIBW_BUILD_VERBOSITY: 1 - name: Upload wheel(s) as build artifacts uses: actions/upload-artifact@v4 with: - name: wheels-${{ matrix.artifact_name }} + name: "wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}" path: ./wheelhouse/*.whl upload_test_pypi: @@ -90,25 +85,11 @@ jobs: with: name: sdist path: dist - - name: Download wheels artifact - win - uses: actions/download-artifact@v4 - with: - name: wheels-win - path: dist - - name: Download wheels artifact - mac - uses: actions/download-artifact@v4 - with: - name: wheels-mac - path: dist - - name: Download wheels artifact - ubuntu aarch - uses: actions/download-artifact@v4 - with: - name: wheels-ubuntu-aarch - path: dist - - name: Download wheels artifact - ubuntu x86_64 + - name: Download wheels artifact uses: actions/download-artifact@v4 with: - name: wheels-ubuntu-x86_64 + name: wheels-* + merge-multiple: true path: dist - name: Publish package to PyPI if: github.event.action != 'published' @@ -127,25 +108,11 @@ jobs: with: name: sdist path: dist - - name: Download wheels artifact - win - uses: actions/download-artifact@v4 - with: - name: wheels-win - path: dist - - name: Download wheels artifact - mac - uses: actions/download-artifact@v4 - with: - name: wheels-mac - path: dist - - name: Download wheels artifact - ubuntu aarch - uses: actions/download-artifact@v4 - with: - name: wheels-ubuntu-aarch - path: dist - - name: Download wheels artifact - ubuntu x86_64 + - name: Download wheels artifact uses: actions/download-artifact@v4 with: - name: wheels-ubuntu-x86_64 + name: wheels-* + merge-multiple: true path: dist - name: Publish package to PyPI if: github.event.action == 'published' From 7ea9d3a196ae939a990a7d2cd736d2c795c41495 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 24 Jan 2025 13:05:00 -0600 Subject: [PATCH 08/10] Skip wheel tests on macos arm64 until pykdtree bundles libomp --- .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 2a8565b4..6aa2c517 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -65,7 +65,7 @@ jobs: CIBW_SKIP: "cp36-* cp37-* cp38-* cp39-* cp310-* pp* *i686 *-musllinux*" CIBW_ARCHS: "${{ matrix.cibw_archs }}" CIBW_TEST_COMMAND: "python -c \"import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'\"" - CIBW_TEST_SKIP: "*-win_arm64" + CIBW_TEST_SKIP: "*-win_arm64 *-macosx_arm64" CIBW_BUILD_VERBOSITY: 1 - name: Upload wheel(s) as build artifacts From 9570b6825bff7024eaaf61c0d997c709e8d3a570 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 24 Jan 2025 13:26:55 -0600 Subject: [PATCH 09/10] Fix artifact download multiple in wheel building --- .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 6aa2c517..43a1ed90 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -88,7 +88,7 @@ jobs: - name: Download wheels artifact uses: actions/download-artifact@v4 with: - name: wheels-* + pattern: wheels-* merge-multiple: true path: dist - name: Publish package to PyPI @@ -111,7 +111,7 @@ jobs: - name: Download wheels artifact uses: actions/download-artifact@v4 with: - name: wheels-* + pattern: wheels-* merge-multiple: true path: dist - name: Publish package to PyPI From eb37fa0ff3a0b0147d69089f63af6eae70586c8f Mon Sep 17 00:00:00 2001 From: David Hoese Date: Mon, 27 Jan 2025 10:29:49 -0600 Subject: [PATCH 10/10] Reenable wheel tests for mac arm --- .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 43a1ed90..4bc28a5f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -65,7 +65,7 @@ jobs: CIBW_SKIP: "cp36-* cp37-* cp38-* cp39-* cp310-* pp* *i686 *-musllinux*" CIBW_ARCHS: "${{ matrix.cibw_archs }}" CIBW_TEST_COMMAND: "python -c \"import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'\"" - CIBW_TEST_SKIP: "*-win_arm64 *-macosx_arm64" + CIBW_TEST_SKIP: "*-win_arm64" CIBW_BUILD_VERBOSITY: 1 - name: Upload wheel(s) as build artifacts