diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml deleted file mode 100644 index a33ddb149..000000000 --- a/.github/workflows/basemap-data-hires.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: basemap-data-hires - -env: - PKGDIR: "packages/basemap_data_hires" - PIP_DEFAULT_TIMEOUT: 10 - PIP_DISABLE_PIP_VERSION_CHECK: 1 - PIP_PREFER_BINARY: 1 - PIP_RETRIES: 0 - PYTHONUNBUFFERED: "1" - PYTHONWARNINGS: "ignore:DEPRECATION" - -on: - push: - paths: - - ".github/workflows/basemap-data-hires.yml" - - "packages/basemap_data_hires/**" - pull_request: - paths: - - ".github/workflows/basemap-data-hires.yml" - - "packages/basemap_data_hires/**" - workflow_dispatch: - -jobs: - - checkout: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Upload checkout - uses: actions/upload-artifact@v4 - with: - name: checkout - path: . - - build: - strategy: - matrix: - python-version: - ["2.7"] - max-parallel: 1 - needs: checkout - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Build sdist and wheel - run: | - cd ${{ env.PKGDIR }} - python setup.py sdist - pip wheel -w dist --no-deps dist/*.zip - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - test: - strategy: - matrix: - python-version: - ["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", - "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: build - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - - name: Install package - run: | - pip install ${{ env.PKGDIR }}/dist/*.whl - - - name: Test package - run: | - python -c "from mpl_toolkits import basemap_data; print(basemap_data)" - - upload: - strategy: - matrix: - python-version: - ["2.7"] - max-parallel: 1 - if: startsWith(github.event.ref, 'refs/tags/v') - needs: test - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - environment: PyPI - steps: - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - - name: Install upload requirements - run: | - pip install twine - - - name: Check distributables - run: | - python -m twine check \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*.whl - - - name: Upload distributables - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" - TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - run: | - python -m twine upload --skip-existing \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*.whl diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml deleted file mode 100644 index 629213f31..000000000 --- a/.github/workflows/basemap-data.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: basemap-data - -env: - PKGDIR: "packages/basemap_data" - PIP_DEFAULT_TIMEOUT: 10 - PIP_DISABLE_PIP_VERSION_CHECK: 1 - PIP_PREFER_BINARY: 1 - PIP_RETRIES: 0 - PYTHONUNBUFFERED: "1" - PYTHONWARNINGS: "ignore:DEPRECATION" - -on: - push: - paths: - - ".github/workflows/basemap-data.yml" - - "packages/basemap_data/**" - pull_request: - paths: - - ".github/workflows/basemap-data.yml" - - "packages/basemap_data/**" - workflow_dispatch: - -jobs: - - checkout: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Upload checkout - uses: actions/upload-artifact@v4 - with: - name: checkout - path: . - - build: - strategy: - matrix: - python-version: - ["2.7"] - max-parallel: 1 - needs: checkout - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Build sdist and wheel - run: | - cd ${{ env.PKGDIR }} - python setup.py sdist - pip wheel -w dist --no-deps dist/*.zip - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - test: - strategy: - matrix: - python-version: - ["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", - "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: build - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - - name: Install package - run: | - pip install ${{ env.PKGDIR }}/dist/*.whl - - - name: Test package - run: | - python -c "from mpl_toolkits import basemap_data; print(basemap_data)" - - upload: - strategy: - matrix: - python-version: - ["2.7"] - max-parallel: 1 - if: startsWith(github.event.ref, 'refs/tags/v') - needs: test - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - environment: PyPI - steps: - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - - name: Install upload requirements - run: | - pip install twine - - - name: Check distributables - run: | - python -m twine check \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*.whl - - - name: Upload distributables - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" - TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - run: | - python -m twine upload --skip-existing \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*.whl diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml deleted file mode 100644 index cdd577b17..000000000 --- a/.github/workflows/basemap-for-manylinux.yml +++ /dev/null @@ -1,449 +0,0 @@ -name: basemap-for-manylinux - -env: - PKGDIR: "packages/basemap" - PIP_DEFAULT_TIMEOUT: 10 - PIP_DISABLE_PIP_VERSION_CHECK: 1 - PIP_PREFER_BINARY: 1 - PIP_RETRIES: 0 - PYTHONUNBUFFERED: "1" - PYTHONWARNINGS: "ignore:DEPRECATION" - -on: - push: - paths: - - ".github/workflows/basemap-for-manylinux.yml" - - "packages/basemap/**" - pull_request: - paths: - - ".github/workflows/basemap-for-manylinux.yml" - - "packages/basemap/**" - workflow_dispatch: - -jobs: - - checkout: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v1 - - - name: Upload checkout - uses: actions/upload-artifact@v1 - with: - name: checkout - path: . - - lint: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: checkout - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v1 - with: - name: checkout - path: . - - - name: Install lint requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements-lint.txt - - - name: Install library requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements.txt - - - name: Run Flake8 - run: | - cd ${{ env.PKGDIR }} - if [ -x "$(command -v flake8)" ]; then - flake8 src/mpl_toolkits/basemap/cm.py src/mpl_toolkits/basemap/diagnostic.py src/mpl_toolkits/basemap/proj.py src/mpl_toolkits/basemap/solar.py test; - fi - - - name: Run PyLint - run: | - cd ${{ env.PKGDIR }} - if [ -x "$(command -v pylint)" ]; then - pylint src/mpl_toolkits/basemap/cm.py src/mpl_toolkits/basemap/diagnostic.py src/mpl_toolkits/basemap/proj.py src/mpl_toolkits/basemap/solar.py test; - fi - - build-geos: - strategy: - matrix: - arch: - ["x64", "x86"] - max-parallel: 2 - fail-fast: false - needs: lint - runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:3.8-debian-4" - steps: - - - name: Download checkout - uses: actions/download-artifact@v1 - with: - name: checkout - path: . - - - name: Install CMake 3.6.2 - run: | - apt-get update - apt-get install -y libidn11 - pkgvers=3.6.2 - pkgname=cmake - pkgcode=cmake-${pkgvers} - case "${{ matrix.arch }}" in - x86) pkgfile=${pkgcode}-Linux-i386.tar.gz;; - *) pkgfile=${pkgcode}-Linux-x86_64.tar.gz;; - esac - wget https://github.com/Kitware/CMake/releases/download/v${pkgvers}/${pkgfile} -P /tmp - tar -xf /tmp/${pkgfile} --strip-components=1 -C /usr - rm -rf /tmp/${pkgfile} - - - name: Install GCC toolchain - run: | - apt-get update - apt-get install -y gcc g++ make - - - name: Build GEOS from source - run: | - cd ${{ env.PKGDIR }} - python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', njobs=16)" - - - name: Upload GEOS artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-geos-${{ matrix.arch }} - path: ${{ env.PKGDIR }}/extern - - build: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: build-geos - runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-4" - steps: - - - name: Download checkout - uses: actions/download-artifact@v1 - with: - name: checkout - path: . - - - name: Download GEOS artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-geos-${{ matrix.arch }} - path: ${{ env.PKGDIR }}/extern - - - name: Install GCC toolchain - run: | - apt-get update - apt-get install -y gcc g++ make - - - name: Build old numpy from source - run: | - case "${{ matrix.arch }}" in - x64) arch="x86_64" ;; - x86) arch="i686" ;; - esac - case "${{ matrix.python-version }}" in - 2.6|3.[23]) pkgvers=1.11.3; tag=manylinux1 ;; - 2.7|3.[456789]) pkgvers=1.16.6; tag=manylinux1 ;; - 3.10) pkgvers=1.21.4; tag=manylinux1 ;; - 3.11) pkgvers=1.23.3; tag=manylinux_2_17 ;; - *) pkgvers=1.26.1; tag=manylinux_2_28 ;; - esac - case "${{ matrix.python-version }}" in - 3.11|3.12) - # Dirty solution to get NumPy headers for Python 3.11 and 3.12. - kwds="--plat=${tag}_${arch}" - pip download --no-deps ${kwds} "numpy==${pkgvers}" - oldpkgfile=$(ls *.whl | head -n1) - newpkgfile=$(echo "${oldpkgfile}" | sed "s/${tag}/linux/") - mv "${oldpkgfile}" "${newpkgfile}" - pip install "${newpkgfile}" - rm "${newpkgfile}" - ;; - *) - pip install "numpy == ${pkgvers}" - ;; - esac - - - name: Build wheel - run: | - sitepkgdir=$(pip show numpy 2>/dev/null | grep Location: | cut -d' ' -f2) - export GEOS_DIR="${GITHUB_WORKSPACE}/${{ env.PKGDIR }}/extern" - export NUMPY_INCLUDE_PATH=${sitepkgdir}/numpy/core/include - case "${{ matrix.python-version }}" in - 3.11|3.12) - kwds="--no-build-isolation" - pip install setuptools wheel "cython >= 0.29, < 3.1" - ;; - esac - cd ${{ env.PKGDIR }} - python setup.py sdist - pip wheel -w dist --no-deps ${kwds} dist/*.zip - - - name: Upload build artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - repair: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: build - runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:3.8-debian-10" - steps: - - - name: Download GEOS artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-geos-${{ matrix.arch }} - path: ${{ env.PKGDIR }}/extern - - - name: Download build artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - - name: Install auditwheel - run: | - apt-get update - apt-get install -y unzip - pip install patchelf - pip install "auditwheel < 4.0" - - - name: Repair wheel - run: | - cd ${{ env.PKGDIR }} - export LD_LIBRARY_PATH="$(readlink -f extern/lib)" - auditwheel repair -w dist dist/*.whl - - - name: Upload build artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - test: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - exclude: - # Missing precompiled binaries for `numpy`, `matplotlib`, - # `pyproj`, `pillow` and `lxml`. - - arch: "x86" - python-version: "3.12" - max-parallel: 3 - fail-fast: false - needs: repair - runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v1 - with: - name: checkout - path: . - - - name: Download build artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - - name: Install numpy from source - run: | - apt-get update - apt-get install -y gcc g++ make - pip install "numpy < 1.24" - if: matrix.arch == 'x86' && (matrix.python-version >= '3.8' || matrix.python-version >= '3.10') - - - name: Install test requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements-test.txt - - - name: Install package (full) - run: | - whlpath=$(ls ${{ env.PKGDIR }}/dist/*-manylinux1*.whl | head -n1) - pip install "${whlpath}[owslib,pillow]" - - - name: Test package - run: | - cd ${{ env.PKGDIR }} - export COVERAGE_FILE=.coverage.${{ matrix.python-version }} - python -m pytest \ - --cov="mpl_toolkits.basemap" --cov-report=term \ - --ignore=dist --ignore=build - - - name: Upload test artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-test - path: ${{ env.PKGDIR }}/.coverage.${{ matrix.python-version }} - - coverage: - needs: test - runs-on: ubuntu-latest - container: "pylegacy/python:3.8-debian-10" - steps: - - - name: Checkout - uses: actions/checkout@v1 - - - name: Download test artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-test - path: ${{ env.PKGDIR }} - - - name: Install test requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements-test.txt - - - name: Compute combined coverage - run: | - cd ${{ env.PKGDIR }} - coverage combine - coverage html - coverage report - - - name: Upload coverage artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-coverage - path: ${{ env.PKGDIR }}/htmlcov - - docs: - needs: test - runs-on: ubuntu-latest - container: "pylegacy/python:3.8-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v1 - with: - name: checkout - path: . - - - name: Install doc requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements-doc.txt - - - name: Download build artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-build-x64-3.8 - path: ${{ env.PKGDIR }}/dist - - - name: Install package - run: | - cd ${{ env.PKGDIR }} - pip install dist/*-manylinux1*.whl - - - name: Run sphinx - run: | - cd ${{ env.PKGDIR }} - python -m sphinx doc/source public - - - name: Upload docs artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-docs - path: ${{ env.PKGDIR }}/public - - - name: Upload github-pages artifact - uses: actions/upload-pages-artifact@v3 - with: - name: artifacts-github-pages - path: ${{ env.PKGDIR }}/public - - pages: - if: startsWith(github.event.ref, 'refs/tags/v') - needs: docs - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - permissions: - pages: write - id-token: write - steps: - - name: Deploy github-pages - uses: actions/deploy-pages@v3 - id: deployment - - upload: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 1 - if: startsWith(github.event.ref, 'refs/tags/v') - needs: test - runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-10" - environment: PyPI - steps: - - - name: Download build artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - - name: Install upload requirements - run: | - pip install twine - - - name: Check distributables - run: | - python -m twine check \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*-manylinux1*.whl - - - name: Upload distributables - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" - TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - run: | - python -m twine upload --skip-existing \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*-manylinux1*.whl diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml deleted file mode 100644 index 92eb337fc..000000000 --- a/.github/workflows/basemap-for-windows.yml +++ /dev/null @@ -1,326 +0,0 @@ -name: basemap-for-windows - -env: - PKGDIR: "packages/basemap" - PIP_DEFAULT_TIMEOUT: 10 - PIP_DISABLE_PIP_VERSION_CHECK: 1 - PIP_PREFER_BINARY: 1 - PIP_RETRIES: 0 - PYTHONUNBUFFERED: "1" - PYTHONWARNINGS: "ignore:DEPRECATION" - -on: - push: - paths: - - ".github/workflows/basemap-for-windows.yml" - - "!packages/basemap/doc/**" - - "packages/basemap/**" - pull_request: - paths: - - ".github/workflows/basemap-for-windows.yml" - - "!packages/basemap/doc/**" - - "packages/basemap/**" - workflow_dispatch: - -jobs: - - checkout: - runs-on: windows-2019 - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Upload checkout - uses: actions/upload-artifact@v4 - with: - name: checkout - path: . - - lint: - runs-on: windows-2019 - strategy: - matrix: - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: checkout - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Set Python - uses: pylegacy/actions/setup-pyenv-win@v2 - with: - architecture: ${{ matrix.arch }} - python-version: ${{ matrix.python-version }} - - - name: Set Python base packages - run: | - python -m pip install --upgrade pip setuptools wheel - - - name: Install lint requirements - run: | - cd ${{ env.PKGDIR }} - python -m pip install -r requirements-lint.txt - - - name: Install library requirements - run: | - cd ${{ env.PKGDIR }} - python -m pip install -r requirements.txt - - - name: Run Flake8 - run: | - cd ${{ env.PKGDIR }} - if (Get-Command flake8 -errorAction SilentlyContinue) - { - flake8 src/mpl_toolkits/basemap/cm.py src/mpl_toolkits/basemap/diagnostic.py src/mpl_toolkits/basemap/proj.py src/mpl_toolkits/basemap/solar.py test; - } - - - name: Run PyLint - run: | - cd ${{ env.PKGDIR }} - if (Get-Command pylint -errorAction SilentlyContinue) - { - pylint src/mpl_toolkits/basemap/cm.py src/mpl_toolkits/basemap/diagnostic.py src/mpl_toolkits/basemap/proj.py src/mpl_toolkits/basemap/solar.py test; - } - - build-geos: - strategy: - matrix: - arch: - ["x64", "x86"] - msvc-toolset: - ["9.0", "14.0"] - include: - - msvc-toolset: "9.0" - python-version: "2.7" - - msvc-toolset: "14.0" - python-version: "3.5" - max-parallel: 4 - fail-fast: false - needs: lint - runs-on: windows-2019 - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Set MSVC toolset - uses: pylegacy/actions/setup-msvc@v2 - with: - arch: ${{ matrix.arch }} - toolset: ${{ matrix.msvc-toolset }} - - - name: Set CMake - uses: jwlawson/actions-setup-cmake@v2.0 - with: - cmake-version: "3.24.2" - - - name: Set Python - uses: pylegacy/actions/setup-pyenv-win@v2 - with: - architecture: ${{ matrix.arch }} - python-version: ${{ matrix.python-version }} - - - name: Build GEOS from source - run: | - cd ${{ env.PKGDIR }} - python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', toolset='${{ matrix.msvc-toolset }}', njobs=16)" - - - name: Upload GEOS artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts-geos-${{ matrix.arch }}-msvc${{ matrix.msvc-toolset }} - path: ${{ env.PKGDIR }}/extern - - build: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: build-geos - runs-on: windows-2019 - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Set Python - uses: pylegacy/actions/setup-pyenv-win@v2 - with: - architecture: ${{ matrix.arch }} - python-version: ${{ matrix.python-version }} - - - name: Set Python base packages - run: | - python -m pip install --upgrade pip setuptools wheel - - - name: Build old numpy from source - run: | - Switch -regex ("${{ matrix.python-version }}") { - "^2\.6|3\.[123]$" { Set-Variable -Name "pkgvers" -Value "1.11.3" } - "^2\.7|3\.[456789]$" { Set-Variable -Name "pkgvers" -Value "1.16.6" } - "^3\.10$" { Set-Variable -Name "pkgvers" -Value "1.21.4" } - "^3\.11$" { Set-Variable -Name "pkgvers" -Value "1.23.3" } - default { Set-Variable -Name "pkgvers" -Value "1.26.1" } - } - $env:SETUPTOOLS_USE_DISTUTILS = "stdlib" - python -m pip install "numpy == ${pkgvers}" - - - name: Set MSVC toolset version - run: | - if ("${{ matrix.python-version }}" -eq "2.7") { - echo "msvc-toolset=9.0" >> $env:GITHUB_ENV - } else { - echo "msvc-toolset=14.0" >> $env:GITHUB_ENV - } - - - name: Set MSVC toolset - uses: pylegacy/actions/setup-msvc@v2 - with: - arch: ${{ matrix.arch }} - toolset: ${{ env.msvc-toolset }} - - - name: Download GEOS artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-geos-${{ matrix.arch }}-msvc${{ env.msvc-toolset }} - path: ${{ env.PKGDIR }}/extern - - - name: Build sdist and wheel - run: | - cd ${{ env.PKGDIR }} - $env:GEOS_DIR = "$env:GITHUB_WORKSPACE/${{ env.PKGDIR }}/extern" - python -m pip install -r requirements-setup.txt - python setup.py sdist - python -m pip wheel -w dist --no-deps (Get-Item dist/*.zip) - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - test: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - exclude: - # Missing precompiled binaries for `numpy` and `matplotlib`. - - arch: "x86" - python-version: "3.12" - max-parallel: 3 - fail-fast: false - needs: build - runs-on: windows-2019 - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - - name: Set Python - uses: pylegacy/actions/setup-pyenv-win@v2 - with: - architecture: ${{ matrix.arch }} - python-version: ${{ matrix.python-version }} - - - name: Set Python base packages - run: | - python -m pip install --upgrade pip setuptools wheel - - - name: Install test requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements-test.txt - - - name: Install package (full) - run: | - $whlpath = "$(Get-Item ${{ env.PKGDIR }}/dist/*-win*.whl)" - python -m pip install "${whlpath}[owslib,pillow]" - - - name: Test package - run: | - cd ${{ env.PKGDIR }} - $env:COVERAGE_FILE = ".coverage.${{ matrix.arch }}.${{ matrix.python-version }}" - python -m pytest ` - --cov="mpl_toolkits.basemap" --cov-report=term ` - --ignore=dist --ignore=build - - - name: Upload test artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts-test-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/.coverage.${{ matrix.arch }}.${{ matrix.python-version }} - - upload: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 1 - if: startsWith(github.event.ref, 'refs/tags/v') - needs: test - runs-on: windows-2019 - environment: PyPI - steps: - - - name: Set Python - uses: pylegacy/actions/setup-pyenv-win@v2 - with: - architecture: ${{ matrix.arch }} - python-version: ${{ matrix.python-version }} - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - - name: Install upload requirements - run: | - python -m pip install twine - - - name: Check distributables - run: | - python -m twine check ` - ${{ env.PKGDIR }}/dist/*.zip ` - ${{ env.PKGDIR }}/dist/*.whl - - - name: Upload distributables - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" - TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - run: | - python -m twine upload --skip-existing ` - ${{ env.PKGDIR }}/dist/*.whl diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..c2ca8e4bd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,138 @@ +name: Build + +on: + push: + paths: + - ".github/workflows/**" + - "packages/basemap/**" + - "packages/basemap_data/**" + - "packages/basemap_data_hires/**" + pull_request: + paths: + - ".github/workflows/**" + - "packages/basemap/**" + - "packages/basemap_data/**" + - "packages/basemap_data_hires/**" + workflow_dispatch: + +jobs: + build_data: + name: Build data packages + strategy: + matrix: + package: [basemap_data, basemap_data_hires] + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - name: Build sdist and wheels + run: | + cd packages/${{ matrix.package }} + python -m pip install build wheel + python -m build --sdist --wheel + + - uses: actions/upload-artifact@v4 + with: + path: | + packages/${{ matrix.package }}/dist/*.tar.gz + packages/${{ matrix.package }}/dist/*.whl + name: dist-${{ matrix.package }} + + build_basemap: + name: Build basemap package (${{ matrix.os }}) + needs: [build_data] + strategy: + matrix: + os: [ubuntu-22.04, windows-2019, macos-13, macos-14] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - name: Build sdist + if: matrix.os == 'ubuntu-22.04' + run: | + cd packages/basemap + python -m pip install build + python -m build --sdist + + - name: Build wheels + uses: pypa/cibuildwheel@v2.22.0 + env: + CIBW_ARCHS: "native" + CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*" + CIBW_BUILD_VERBOSITY: 1 + CIBW_SKIP: "*-musllinux_*" + CIBW_BEFORE_ALL: "python {project}/.github/workflows/run_before_all.py" + CIBW_TEST_EXTRAS: "test" + CIBW_TEST_COMMAND: "python -m pytest {project}/packages/basemap" + CIBW_ENVIRONMENT: >- + GEOS_VERSION="3.6.5" + GEOS_DIR="$(pwd)/extern" + GEOS_NJOBS=4 + PIP_PREFER_BINARY=1 + PYTHONUNBUFFERED=1 + LD_LIBRARY_PATH="${GEOS_DIR}/lib" + # LD_LIBRARY_PATH in environment is needed by + # auditwheel (Linux) and delocate (MacOS). + with: + package-dir: "packages/basemap" + output-dir: "packages/basemap/dist" + + - uses: actions/upload-artifact@v4 + with: + path: | + packages/basemap/dist/*.tar.gz + packages/basemap/dist/*.whl + name: dist-basemap-${{ matrix.os }} + + check: + name: Check packages + needs: [build_data, build_basemap] + runs-on: ubuntu-22.04 + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + pattern: "dist-*" + merge-multiple: true + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - name: Check packages with twine + run: | + python -m pip install twine + python -m twine check dist/*.tar.gz + python -m twine check dist/*.whl + + upload: + name: Upload packages + needs: [build_data, build_basemap, check] + runs-on: ubuntu-22.04 + environment: PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + pattern: "dist-*" + merge-multiple: true + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TOKEN }} + repository-url: ${{ secrets.PYPI_REPOSITORY_URL }} + skip-existing: true diff --git a/.github/workflows/run_before_all.py b/.github/workflows/run_before_all.py new file mode 100644 index 000000000..575a26763 --- /dev/null +++ b/.github/workflows/run_before_all.py @@ -0,0 +1,37 @@ +#! /usr/bin/env python +"""Helper script to be run by `cibuildwheel` as `before_all` step.""" + +import os +import sys + +HERE = os.path.abspath(__file__) +ROOT = os.path.dirname(os.path.dirname(os.path.dirname(HERE))) +sys.path.insert(0, os.path.join(ROOT, "packages", "basemap")) +import utils # noqa: E402 # pylint: disable=imports + + +def main(): + """Build the GEOS library based on parsed environment variables.""" + + geos_version = os.environ.get("GEOS_VERSION", None) + if geos_version is None: + raise ValueError("Undefined environment variable GEOS_VERSION") + + geos_dir = os.environ.get("GEOS_DIR", None) + if geos_dir is None: + raise ValueError("Undefined environment variable GEOS_DIR") + + geos_njobs = int(os.environ.get("GEOS_NJOBS", 1)) + + # pylint: disable=consider-using-f-string + print("Running before_all script with the following settings:") + print("GEOS_DIR: {0}".format(geos_dir)) + print("GEOS_VERSION: {0}".format(geos_version)) + print("GEOS_NJOBS: {0}".format(geos_njobs)) + + utils.GeosLibrary(geos_version).build(geos_dir, njobs=geos_njobs) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9bdc4fa9..b14c8acd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,66 @@ https://keepachangelog.com/en/1.0.0/ https://semver.org/spec/v2.0.0.html +## [Unreleased] + +### Added +- Python 3.13 support (PR [#619], solves issue [#608]). +- NumPy 2.0 support (PR [#614] by @cvanelteren, solves issue [#604]). +- Automated wheels for x86_64 and arm64 (PR [#620] by @cvanelteren, + solves issue [#608]). + +### Changed +- **BREAKING CHANGE**: Set Python minimum supported version to 3.9. +- **BREAKING CHANGE**: Migrate `basemap` libraries to use implicit + namespace packages (PR [#576] by @ksunden). +- Migrate workflows to use `cibuildwheel` (PRs [#614] and [#618] by + @cvanelteren and PR [#621], solves GitHub artifact actions v1 sunset). +- Update library dependencies: + - Upgrade upper limit for `basemap_data` to 3.0. + - Upgrade lower limit for `packaging` to 20.5. + - Upgrade upper limit for `packaging` to 25.0. + - Upgrade lower limit for `numpy` to 2.0. + - Upgrade upper limit for `numpy` to 2.3. + - Upgrade lower limit for `matplotlib` to 3.4. + - Upgrade upper limit for `matplotlib` to 3.11. + - Upgrade lower limit for `pyproj` to 3.0. + - Upgrade upper limit for `pyproj` to 3.8. + - Upgrade lower limit for `pyshp` to 2.0. +- Update optional library dependencies: + - Upgrade lower limit for `pillow` to 10.3 due to + vulnerabilities [CVE-2023-50447] and [CVE-2024-28219]. + - Upgrade upper limit for `pillow` to 11.2. + - Upgrade upper limit for `OWSLib` to 0.33. +- Update doc dependencies: + - Upgrade upper limit for `sphinx` to 8.0. + - Upgrade lower limit for `furo` to 2023.9.10. + - Upgrade upper limit for `furo` to 2024.8.7. + - Upgrade lower limit for `scipy` to 1.6. + - Upgrade upper limit for `scipy` to 1.16. + - Upgrade upper limit for `netCDF4` to 1.8.0. +- Update lint dependencies: + - Remove dependency on `unittest2`. + - Upgrade lower limit for `flake8` to 3.9. + - Upgrade upper limit for `flake8` to 7.2. + - Upgrade lower limit for `astroid` to 3.0. + - Upgrade upper limit for `astroid` to 3.4. + - Upgrade lower limit for `pylint` to 3.0. + - Upgrade upper limit for `pylint` to 3.4. +- Update test dependencies: + - Remove dependency on `unittest2`. + - Upgrade lower limit for `pytest` to 7.0. + - Upgrade upper limit for `pytest` to 8.4. + - Upgrade lower limit for `pytest-cov` to 3.0. + - Upgrade upper limit for `pytest-cov` to 6.1. + - Downgrade lower limit for `coverage` to 5.0. + - Upgrade upper limit for `coverage` to 7.7. + +### Fixed +- Fix Cython extension to use `noexcept` (PR [#615] by @cvanelteren). + +### Removed +- Deprecated `bdist_wheel.universal` option when building wheels. + ## [1.4.1] - 2024-02-15 ### Changed @@ -1096,6 +1156,22 @@ https://semver.org/spec/v2.0.0.html - Fix glitches in drawing of parallels and meridians. +[#621]: +https://github.com/matplotlib/basemap/pull/621 +[#620]: +https://github.com/matplotlib/basemap/pull/620 +[#619]: +https://github.com/matplotlib/basemap/pull/619 +[#618]: +https://github.com/matplotlib/basemap/pull/618 +[#615]: +https://github.com/matplotlib/basemap/pull/615 +[#614]: +https://github.com/matplotlib/basemap/pull/614 +[#608]: +https://github.com/matplotlib/basemap/issues/608 +[#604]: +https://github.com/matplotlib/basemap/issues/604 [#598]: https://github.com/matplotlib/basemap/pull/598 [#595]: @@ -1124,6 +1200,8 @@ https://github.com/matplotlib/basemap/pull/580 https://github.com/matplotlib/basemap/issues/579 [#577]: https://github.com/matplotlib/basemap/issues/577 +[#576]: +https://github.com/matplotlib/basemap/pull/576 [#574]: https://github.com/matplotlib/basemap/issues/574 [#573]: @@ -1296,6 +1374,10 @@ https://github.com/matplotlib/basemap/compare/v1.0.3rel...v1.0.4rel [1.0.3]: https://github.com/matplotlib/basemap/tree/v1.0.3rel +[CVE-2024-28219]: +https://nvd.nist.gov/vuln/detail/CVE-2024-28219 +[CVE-2023-50447]: +https://nvd.nist.gov/vuln/detail/CVE-2023-50447 [CVE-2023-27476]: https://nvd.nist.gov/vuln/detail/CVE-2023-27476 [CVE-2022-45198]: diff --git a/packages/basemap/LICENSE b/packages/basemap/LICENSE index 120eb7e3f..68cbd3d24 100644 --- a/packages/basemap/LICENSE +++ b/packages/basemap/LICENSE @@ -1,5 +1,5 @@ Copyright (c) 2011-2014 Jeffrey Whitaker -Copyright (c) 2015-2024 The Matplotlib development team +Copyright (c) 2015-2025 The Matplotlib development team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 460d15c92..daa4b1286 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -22,7 +22,7 @@ # -- Project information ----------------------------------------------- project = myself.__name__.rsplit(".", 1)[-1] -copyright = "2011-2014 Jeffrey Whitaker; 2015-2024 The Matplotlib development team" +copyright = "2011-2014 Jeffrey Whitaker; 2015-2025 The Matplotlib development team" author = "Jeffrey Whitaker" # The short X.Y version diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 6a50e2c78..a7d900689 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -1,15 +1,9 @@ [build-system] requires = [ - 'setuptools', - 'wheel', - 'numpy == 1.26.1; python_version >= "3.12"', - 'numpy == 1.23.3; python_version == "3.11"', - 'numpy == 1.21.4; python_version == "3.10"', - 'numpy == 1.21.4; sys_platform == "darwin" and (python_version >= "3.7" and python_version <= "3.9")', - 'numpy == 1.16.6; sys_platform != "darwin" and (python_version >= "3.7" and python_version <= "3.9")', - 'numpy == 1.16.6; python_version == "2.7" or (python_version >= "3.4" and python_version <= "3.6")', - 'numpy == 1.11.3; python_version == "2.6" or (python_version >= "3.2" and python_version <= "3.3")', - 'cython >= 0.29, < 3.1; python_version >= "3.3" or python_version < "3.0"', - 'cython >= 0.26, < 0.27; python_version == "3.2"' + 'setuptools >= 67.0, < 76.0', + 'wheel >= 0.40, < 0.46', + 'cython >= 0.29.31, < 3.1', + 'numpy == 2.1.0; python_version == "3.13"', + 'numpy == 2.0.0; python_version <= "3.12"', ] build-backend = "setuptools.build_meta" diff --git a/packages/basemap/requirements-doc.txt b/packages/basemap/requirements-doc.txt index 385d1e158..e89d7e235 100644 --- a/packages/basemap/requirements-doc.txt +++ b/packages/basemap/requirements-doc.txt @@ -1,6 +1,6 @@ -sphinx >= 5.3, < 7.2; python_version >= "3.8" -furo >= 2022.4.7, < 2023.9.11; python_version >= "3.8" +sphinx >= 7.0, < 8.0 +furo >= 2023.9.10, < 2024.8.7 -scipy >= 1.2, < 1.12; python_version >= "3.5" -cftime >= 1.4.0, < 1.7.0; python_version >= "3.6" -netCDF4 >= 1.5.6, < 1.7.0; python_version >= "3.6" +scipy >= 1.6, < 1.16 +cftime >= 1.4.0, < 1.7.0 +netCDF4 >= 1.5.6, < 1.8.0 diff --git a/packages/basemap/requirements-lint.txt b/packages/basemap/requirements-lint.txt index 2b2a187c4..a13cd4285 100644 --- a/packages/basemap/requirements-lint.txt +++ b/packages/basemap/requirements-lint.txt @@ -1,17 +1,4 @@ -unittest2; python_version <= "3.9" +flake8 >= 3.9, < 7.2 -flake8 >= 2.6, < 3.0; python_version == "2.6" -flake8 >= 2.6, < 4.0; python_version == "2.7" -flake8 >= 2.6, < 3.0; python_version == "3.2" -flake8 >= 2.6, < 3.0; python_version == "3.3" -flake8 >= 2.6, < 3.9; python_version == "3.4" -flake8 >= 2.6, < 6.2; python_version >= "3.5" - -astroid >= 1.6, < 2.0; python_version == "2.7" -astroid >= 2.4, < 2.5; python_version == "3.5" -astroid >= 2.5, < 2.7; python_version == "3.6" -astroid >= 2.8, < 3.1; python_version >= "3.7" -pylint >= 1.9, < 2.0; python_version == "2.7" -pylint >= 2.6, < 2.7; python_version == "3.5" -pylint >= 2.7, < 2.10; python_version == "3.6" -pylint >= 2.11, < 3.1; python_version >= "3.7" +astroid >= 3.0, < 3.4 +pylint >= 3.0, < 3.4 diff --git a/packages/basemap/requirements-owslib.txt b/packages/basemap/requirements-owslib.txt index 5c4f0439d..5c7425ee0 100644 --- a/packages/basemap/requirements-owslib.txt +++ b/packages/basemap/requirements-owslib.txt @@ -1,8 +1 @@ -ordereddict; python_version == "2.6" -OWSLib >= 0.8.0, < 0.15.0; python_version == "2.6" -OWSLib >= 0.8.0, < 0.19.0; python_version == "2.7" -OWSLib >= 0.8.0, < 0.11.0; python_version == "3.2" -OWSLib >= 0.8.0, < 0.11.0; python_version == "3.3" -OWSLib >= 0.8.0, < 0.18.0; python_version == "3.4" -OWSLib >= 0.8.0, < 0.20.0; python_version == "3.5" -OWSLib >= 0.28.1, < 0.30.0; python_version >= "3.6" +OWSLib >= 0.28.1, < 0.33 diff --git a/packages/basemap/requirements-pillow.txt b/packages/basemap/requirements-pillow.txt index 647257799..89493b01d 100644 --- a/packages/basemap/requirements-pillow.txt +++ b/packages/basemap/requirements-pillow.txt @@ -1,8 +1 @@ -pillow >= 3.4.0, < 4.0.0; python_version == "2.6" -pillow >= 6.2.2, < 7.0.0; python_version == "2.7" -pillow >= 3.4.0, < 4.0.0; python_version == "3.2" -pillow >= 4.3.0, < 5.0.0; python_version == "3.3" -pillow >= 5.4.0, < 6.0.0; python_version == "3.4" -pillow >= 7.1.0, < 8.0.0; python_version == "3.5" -pillow >= 8.3.2, < 9.0.0; python_version == "3.6" -pillow >= 9.4.0, < 10.2.0; python_version >= "3.7" +pillow >= 10.3, < 11.2 diff --git a/packages/basemap/requirements-setup.txt b/packages/basemap/requirements-setup.txt index 6f39a1a05..d12bb0661 100644 --- a/packages/basemap/requirements-setup.txt +++ b/packages/basemap/requirements-setup.txt @@ -1,2 +1 @@ -cython >= 0.29, < 3.1; python_version >= "3.3" or python_version < "3.0" -cython >= 0.26, < 0.27; python_version == "3.2" +cython >= 0.29.31, < 3.1 diff --git a/packages/basemap/requirements-test.txt b/packages/basemap/requirements-test.txt index 7491b2686..6a0458527 100644 --- a/packages/basemap/requirements-test.txt +++ b/packages/basemap/requirements-test.txt @@ -1,23 +1,4 @@ -unittest2; python_version <= "3.9" +pytest >= 7.0, < 8.4 -pytest >= 3.2.0, < 3.3; python_version == "2.6" -pytest >= 4.6.9, < 5.0; python_version == "2.7" -pytest >= 2.9.0, < 3.0; python_version == "3.2" -pytest >= 3.2.0, < 3.3; python_version == "3.3" -pytest >= 4.6.9, < 5.0; python_version == "3.4" -pytest >= 6.1.2, < 6.2; python_version == "3.5" -pytest >= 6.2.5, < 7.5; python_version >= "3.6" - -coverage >= 4.5, < 5.0; python_version == "2.6" -coverage >= 5.5, < 6.0; python_version == "2.7" -coverage >= 3.7, < 4.0; python_version == "3.2" -coverage >= 4.5, < 5.0; python_version == "3.3" -coverage >= 4.5, < 5.0; python_version == "3.4" -coverage >= 5.5, < 6.0; python_version == "3.5" -coverage >= 5.5, < 7.4; python_version >= "3.6" -pytest-cov >= 2.5, < 2.6; python_version == "2.6" -pytest-cov >= 2.9, < 3.0; python_version == "2.7" -pytest-cov >= 2.5, < 2.6; python_version == "3.2" -pytest-cov >= 2.5, < 2.6; python_version == "3.3" -pytest-cov >= 2.5, < 2.9; python_version == "3.4" -pytest-cov >= 2.9, < 4.2; python_version >= "3.5" +pytest-cov >= 3.0, < 6.1 +coverage >= 5.0, < 7.7 diff --git a/packages/basemap/requirements.txt b/packages/basemap/requirements.txt index 3c028489e..3f20dc53c 100644 --- a/packages/basemap/requirements.txt +++ b/packages/basemap/requirements.txt @@ -1,38 +1,8 @@ -basemap_data >= 1.3.2, < 1.4 +basemap_data >= 1.3.2, < 3.0 +packaging >= 20.5, < 25.0 -numpy >= 1.11, < 1.12; python_version == "2.6" -numpy >= 1.16, < 1.17; python_version == "2.7" -numpy >= 1.11, < 1.12; python_version == "3.2" -numpy >= 1.11, < 1.12; python_version == "3.3" -numpy >= 1.15, < 1.17; python_version == "3.4" -numpy >= 1.16, < 1.19; python_version == "3.5" -numpy >= 1.19, < 1.20; python_version == "3.6" -numpy >= 1.21, < 1.22; python_version == "3.7" -numpy >= 1.21, < 1.27; python_version >= "3.8" +numpy >= 2.0, < 2.3 +matplotlib >= 3.4, < 3.11 -cycler < 0.11; python_version == "3.2" -pyparsing >= 1.5, < 2.4.1; python_version == "2.6" -pyparsing >= 1.5, < 2.3.1; python_version == "3.2" -matplotlib >= 1.5, < 2.0; python_version == "2.6" -matplotlib >= 1.5, < 3.0; python_version == "2.7" -matplotlib >= 1.5, < 2.0; python_version == "3.2" -matplotlib >= 1.5, < 2.0; python_version == "3.3" -matplotlib >= 1.5, < 3.0; python_version == "3.4" -matplotlib >= 1.5, < 3.9; python_version >= "3.5" - -pyproj >= 1.9.3, < 2.1.0; python_version == "2.6" -pyproj >= 1.9.3, < 2.2.0; python_version == "2.7" -pyproj >= 1.9.3, < 1.9.6; python_version == "3.2" -pyproj >= 1.9.3, < 2.1.0; python_version == "3.3" -pyproj >= 1.9.3, < 2.1.0; python_version == "3.4" -pyproj >= 1.9.3, < 3.7.0; python_version >= "3.5" - -pyshp >= 1.2, < 2.0; python_version == "2.6" -pyshp >= 1.2, < 2.4; python_version >= "2.7" - -packaging >= 16.0, < 17.0; python_version == "2.6" -packaging >= 16.0, < 21.0; python_version == "2.7" -packaging >= 16.0, < 17.0; python_version == "3.2" -packaging >= 16.0, < 17.0; python_version == "3.3" -packaging >= 16.0, < 21.0; python_version == "3.4" -packaging >= 16.0, < 24.0; python_version >= "3.5" +pyproj >= 3.0, < 3.8 +pyshp >= 2.0, < 2.4 diff --git a/packages/basemap/setup.cfg b/packages/basemap/setup.cfg index 58e39b69a..643dee05f 100644 --- a/packages/basemap/setup.cfg +++ b/packages/basemap/setup.cfg @@ -22,11 +22,6 @@ ignore = [tool:pytest] filterwarnings = error - # To be removed when replacing `unittest2`. - ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated:DeprecationWarning:unittest2.compatibility:143 - # To be removed with `dateutil` release after 2.8.2. - # See: https://github.com/dateutil/dateutil/issues/1314 - ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning:dateutil.tz.tz:37 [coverage:paths] source = diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 4c98a8776..8927ac115 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -10,16 +10,10 @@ import glob import warnings from setuptools import setup -from setuptools import find_packages +from setuptools import find_namespace_packages from setuptools.command.sdist import sdist from setuptools.extension import Extension -try: - import Cython - cython_major_version = int(Cython.__version__.split(".", 1)[0]) -except ImportError: - cython_major_version = 0 - def get_content(name, splitlines=False): """Return the file contents with project root as root folder.""" @@ -162,28 +156,7 @@ def run(self): for ext in ext_modules: ext.cython_directives = [ ("language_level", str(sys.version_info[0])), - ("legacy_implicit_noexcept", True), - ][:1 + int(cython_major_version >= 3)] - -# Define all the different requirements. -setup_requires = get_content("requirements-setup.txt", splitlines=True) -install_requires = get_content("requirements.txt", splitlines=True) -if sys.version_info[:2] == (3, 2): - # Hack for Python 3.2 because pip < 8 cannot handle version markers. - marker1 = '; python_version == "3.2"' - marker2 = '; python_version >= "2.7"' - setup_requires = [ - item.replace(marker1, "").replace(marker2, "") for item in setup_requires - if item.endswith(marker1) or item.endswith(marker2) - or "python_version" not in item] - install_requires = [ - item.replace(marker1, "").replace(marker2, "") for item in install_requires - if item.endswith(marker1) or item.endswith(marker2) - or "python_version" not in item] -else: - marker1 = '; python_version == "3.2"' - setup_requires = [item for item in setup_requires if not item.endswith(marker1)] - install_requires = [item for item in install_requires if not item.endswith(marker1)] + ] setup(**{ "name": @@ -214,7 +187,6 @@ def run(self): "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development :: Libraries :: Python Modules", @@ -224,28 +196,23 @@ def run(self): "maps", "plots", ], - "namespace_packages": [ - "mpl_toolkits", - ], "package_dir": {"": "src"}, "packages": - find_packages(where="src"), + find_namespace_packages(where="src"), "ext_modules": ext_modules, "data_files": data_files, "python_requires": ", ".join([ - ">=2.6", - "!=3.0.*", - "!=3.1.*", - "<3.13", + ">=3.9", + "<3.14", ]), "setup_requires": - setup_requires, + get_content("requirements-setup.txt", splitlines=True), "install_requires": - install_requires, + get_content("requirements.txt", splitlines=True), "extras_require": { "doc": get_content("requirements-doc.txt", splitlines=True), diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index 1e2ced532..1298e6e91 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -2,7 +2,7 @@ import sys import numpy cimport numpy as cnp -__version__ = "1.4.1" +__version__ = "2.0.0-dev" # Need some Python C-API functions for strings. @@ -112,7 +112,7 @@ cdef extern from "geos_c.h": # Cython 3: Next cdef needs "noexcept" declaration unless # the compiler directive "legacy_implicit_noexcept" is used # ("noexcept" syntax supported since Cython 0.29.31). -cdef void notice_h(const char *fmt, ...): +cdef void notice_h(const char *fmt, ...) noexcept: pass #format = PyBytes_FromString(fmt) #message = PyBytes_FromString(msg) diff --git a/packages/basemap/src/mpl_toolkits/__init__.py b/packages/basemap/src/mpl_toolkits/__init__.py deleted file mode 100644 index b5cd40f18..000000000 --- a/packages/basemap/src/mpl_toolkits/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from __future__ import (absolute_import, division, print_function) - -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - pass # must not have setuptools diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 651a2dd5a..3f61c2c4f 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -48,7 +48,7 @@ from . proj import Proj -__version__ = "1.4.1" +__version__ = "2.0.0-dev" # basemap data files now installed in lib/matplotlib/toolkits/basemap/data # check to see if environment variable BASEMAPDATA set to a directory, diff --git a/packages/basemap/test/__init__.py b/packages/basemap/test/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/basemap/test/mpl_toolkits/__init__.py b/packages/basemap/test/mpl_toolkits/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py index 6a94d291f..f18b2c29e 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py @@ -4,10 +4,7 @@ import shutil import tempfile import datetime as dt -try: - import unittest2 as unittest -except ImportError: - import unittest +import unittest import numpy as np import matplotlib as mpl diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_cm.py b/packages/basemap/test/mpl_toolkits/basemap/test_cm.py index 77df7d3bf..66d8ef665 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_cm.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_cm.py @@ -1,10 +1,6 @@ """Import test for :mod:`mpl_toolkits.basemap.cm`.""" -try: - import unittest2 as unittest -except ImportError: - import unittest - +import unittest from mpl_toolkits.basemap import cm diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_diagnostic.py b/packages/basemap/test/mpl_toolkits/basemap/test_diagnostic.py index b5bacce3a..f5ac65564 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_diagnostic.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_diagnostic.py @@ -1,11 +1,7 @@ """Import test for :mod:`mpl_toolkits.basemap.diagnostic`.""" +import unittest from collections import namedtuple -try: - import unittest2 as unittest -except ImportError: - import unittest - from mpl_toolkits.basemap import diagnostic diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_proj.py b/packages/basemap/test/mpl_toolkits/basemap/test_proj.py index dfdcd69ba..4385c8f6f 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_proj.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_proj.py @@ -1,10 +1,6 @@ """Import test for :mod:`mpl_toolkits.basemap.proj`.""" -try: - import unittest2 as unittest -except ImportError: - import unittest - +import unittest from mpl_toolkits.basemap.proj import Proj diff --git a/packages/basemap/test/mpl_toolkits/test_basemap.py b/packages/basemap/test/mpl_toolkits/test_basemap.py index 80a31cb2e..2070c2e50 100644 --- a/packages/basemap/test/mpl_toolkits/test_basemap.py +++ b/packages/basemap/test/mpl_toolkits/test_basemap.py @@ -1,10 +1,6 @@ """Import test for the :mod:`mpl_toolkits.basemap` package.""" -try: - import unittest2 as unittest -except ImportError: - import unittest - +import unittest from mpl_toolkits import basemap diff --git a/packages/basemap/utils/GeosLibrary.py b/packages/basemap/utils/GeosLibrary.py index 4db6b88e9..0462d6775 100644 --- a/packages/basemap/utils/GeosLibrary.py +++ b/packages/basemap/utils/GeosLibrary.py @@ -1,7 +1,7 @@ #! /usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (c) 2021-2024 Víctor Molina García +# Copyright (c) 2021-2025 Víctor Molina García # # GeosLibrary.py is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published @@ -62,7 +62,7 @@ def __init__(self, version, root=None): def __del__(self): """Clean up after :class:`GeosLibrary` destruction.""" - if self.temp: + if getattr(self, "temp", None) and getattr(self, "root", None): try: shutil.rmtree(self.root) except OSError: diff --git a/packages/basemap_data/setup.cfg b/packages/basemap_data/setup.cfg index 46fc44d00..e22ef7143 100644 --- a/packages/basemap_data/setup.cfg +++ b/packages/basemap_data/setup.cfg @@ -7,6 +7,3 @@ license_files = [sdist] formats = zip - -[bdist_wheel] -universal = 1 diff --git a/packages/basemap_data/setup.py b/packages/basemap_data/setup.py index 2d8e4e620..d56dd243d 100644 --- a/packages/basemap_data/setup.py +++ b/packages/basemap_data/setup.py @@ -7,7 +7,7 @@ import os import itertools from setuptools import setup -from setuptools import find_packages +from setuptools import find_namespace_packages def get_content(name, splitlines=False): @@ -73,7 +73,7 @@ def get_content(name, splitlines=False): "name": "basemap_data", "version": - "1.3.2", + "2.0.0-dev", "license": "GNU Lesser General Public License v3 or later (LGPLv3+)", "description": @@ -98,7 +98,6 @@ def get_content(name, splitlines=False): "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Operating System :: OS Independent", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development :: Libraries :: Python Modules", @@ -108,22 +107,17 @@ def get_content(name, splitlines=False): "maps", "plots", ], - "namespace_packages": [ - "mpl_toolkits.basemap_data", - ], "package_dir": {"": "src"}, "packages": - find_packages(where="src"), + find_namespace_packages(where="src"), "package_data": { "mpl_toolkits.basemap_data": data_files, }, "python_requires": ", ".join([ - ">=2.6", - "!=3.0.*", - "!=3.1.*", + ">=3.9", "<4", ]), "project_urls": { diff --git a/packages/basemap_data/src/__init__.py b/packages/basemap_data/src/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/basemap_data/src/mpl_toolkits/__init__.py b/packages/basemap_data/src/mpl_toolkits/__init__.py deleted file mode 100644 index 02de4115d..000000000 --- a/packages/basemap_data/src/mpl_toolkits/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - pass # must not have setuptools diff --git a/packages/basemap_data/src/mpl_toolkits/basemap_data/__init__.py b/packages/basemap_data/src/mpl_toolkits/basemap_data/__init__.py deleted file mode 100644 index 02de4115d..000000000 --- a/packages/basemap_data/src/mpl_toolkits/basemap_data/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - pass # must not have setuptools diff --git a/packages/basemap_data_hires/setup.cfg b/packages/basemap_data_hires/setup.cfg index e408a4da9..e43de0337 100644 --- a/packages/basemap_data_hires/setup.cfg +++ b/packages/basemap_data_hires/setup.cfg @@ -5,6 +5,3 @@ license_files = [sdist] formats = zip - -[bdist_wheel] -universal = 1 diff --git a/packages/basemap_data_hires/setup.py b/packages/basemap_data_hires/setup.py index 7dbe83cf6..7421194d1 100644 --- a/packages/basemap_data_hires/setup.py +++ b/packages/basemap_data_hires/setup.py @@ -7,7 +7,7 @@ import os import itertools from setuptools import setup -from setuptools import find_packages +from setuptools import find_namespace_packages def get_content(name, splitlines=False): @@ -51,7 +51,7 @@ def get_content(name, splitlines=False): "name": "basemap_data_hires", "version": - "1.3.2", + "2.0.0-dev", "license": "GNU Lesser General Public License v3 or later (LGPLv3+)", "description": @@ -76,7 +76,6 @@ def get_content(name, splitlines=False): "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Operating System :: OS Independent", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development :: Libraries :: Python Modules", @@ -86,22 +85,17 @@ def get_content(name, splitlines=False): "maps", "plots", ], - "namespace_packages": [ - "mpl_toolkits.basemap_data", - ], "package_dir": {"": "src"}, "packages": - find_packages(where="src"), + find_namespace_packages(where="src"), "package_data": { "mpl_toolkits.basemap_data": data_files, }, "python_requires": ", ".join([ - ">=2.6", - "!=3.0.*", - "!=3.1.*", + ">=3.9", "<4", ]), "project_urls": { diff --git a/packages/basemap_data_hires/src/__init__.py b/packages/basemap_data_hires/src/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/basemap_data_hires/src/mpl_toolkits/__init__.py b/packages/basemap_data_hires/src/mpl_toolkits/__init__.py deleted file mode 100644 index 02de4115d..000000000 --- a/packages/basemap_data_hires/src/mpl_toolkits/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - pass # must not have setuptools diff --git a/packages/basemap_data_hires/src/mpl_toolkits/basemap_data/__init__.py b/packages/basemap_data_hires/src/mpl_toolkits/basemap_data/__init__.py deleted file mode 100644 index 02de4115d..000000000 --- a/packages/basemap_data_hires/src/mpl_toolkits/basemap_data/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - pass # must not have setuptools