diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index c7e0d83f9..c6c0bba86 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -36,7 +36,7 @@ jobs: strategy: matrix: python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 3 fail-fast: false needs: checkout @@ -128,7 +128,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 3 fail-fast: false needs: build-geos @@ -158,18 +158,37 @@ jobs: case "${{ matrix.python-version }}" in 2.6|3.[23]) pkgvers=1.11.3;; 2.7|3.[456789]) pkgvers=1.16.6;; - *) pkgvers=1.21.4;; + 3.10) pkgvers=1.21.4;; + *) pkgvers=1.23.3;; esac - pip install "numpy == ${pkgvers}" + # Dirty solution to get NumPy headers for Python 3.11. + if [ "${{ matrix.python-version }}" = "3.11" ]; then + case "${{ matrix.arch }}" in + x64) kwds="--plat=manylinux_2_17_x86_64" ;; + x86) kwds="--plat=manylinux_2_17_i686" ;; + esac + pip download --no-deps ${kwds} "numpy==${pkgvers}" + oldpkgfile=$(ls *.whl | head -n1) + newpkgfile=$(echo "${oldpkgfile}" | sed 's/manylinux_2_17/linux/') + mv "${oldpkgfile}" "${newpkgfile}" + pip install "${newpkgfile}" + rm "${newpkgfile}" + else + pip install "numpy == ${pkgvers}" + fi - 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 + if [ "${{ matrix.python-version }}" = "3.11" ]; then + kwds="--no-build-isolation" + pip install setuptools wheel "cython >= 0.29, < 3.1" + fi cd ${{ env.PKGDIR }} python setup.py sdist - pip wheel -w dist --no-deps dist/*.zip + pip wheel -w dist --no-deps ${kwds} dist/*.zip - name: Upload build artifacts uses: actions/upload-artifact@v1 @@ -183,7 +202,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 3 fail-fast: false needs: build @@ -203,18 +222,11 @@ jobs: name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} path: ${{ env.PKGDIR }}/dist - - name: Install unzip + name: Install auditwheel run: | apt-get update apt-get install -y unzip - - - name: Install patchelf - run: | pip install patchelf - alias patchelf="python -m patchelf" - - - name: Install auditwheel - run: | pip install "auditwheel < 4.0" - name: Repair wheel @@ -235,7 +247,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 3 fail-fast: false needs: repair @@ -254,13 +266,6 @@ jobs: with: name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} path: ${{ env.PKGDIR }}/dist - - - name: Install matplotlib dependencies - run: | - apt-get update - apt-get install -y gcc g++ make - apt-get install -y pkg-config libfreetype6-dev libpng12-dev - if: matrix.arch == 'x86' && matrix.python-version == '3.5' - name: Install numpy from source run: | @@ -284,7 +289,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 1 if: startsWith(github.event.ref, 'refs/tags/v') needs: test diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index d9e68ce25..6107dea94 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -36,7 +36,7 @@ jobs: strategy: matrix: python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 3 fail-fast: false needs: checkout @@ -137,7 +137,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 3 fail-fast: false needs: build-geos @@ -179,7 +179,8 @@ jobs: 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" } - default { Set-Variable -Name "pkgvers" -Value "1.21.4" } + "^3\.10$" { Set-Variable -Name "pkgvers" -Value "1.21.4" } + default { Set-Variable -Name "pkgvers" -Value "1.23.3" } } $env:SETUPTOOLS_USE_DISTUTILS = "stdlib" python -m pip install "numpy == ${pkgvers}" @@ -210,7 +211,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 3 fail-fast: false needs: build @@ -232,11 +233,15 @@ jobs: name: Install package run: | pip install --prefer-binary (Get-Item ${{ env.PKGDIR }}/dist/*-win*.whl) + # We need to skip Py311 x86 because of missing pyproj wheels. + if: matrix.arch != 'x86' || matrix.python-version != '3.11' - name: Test package run: | python -c "from mpl_toolkits.basemap import Basemap" python -c "from mpl_toolkits.basemap import cm" + # We need to skip Py311 x86 because of missing pyproj wheels. + if: matrix.arch != 'x86' || matrix.python-version != '3.11' upload: strategy: @@ -244,7 +249,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 1 if: startsWith(github.event.ref, 'refs/tags/v') needs: test diff --git a/CHANGELOG.md b/CHANGELOG.md index d01577549..064df3ab9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ https://semver.org/spec/v2.0.0.html ## [1.3.6] +### Added +- Support for Python 3.11 (PR [#563], solves issue [#561]). + ### Changed - Upgrade `matplotlib` upper pin to 3.7. - Upgrade `pyproj` upper pin to 3.5. @@ -940,6 +943,10 @@ https://semver.org/spec/v2.0.0.html - Fix glitches in drawing of parallels and meridians. +[#563]: +https://github.com/matplotlib/basemap/pull/563 +[#561]: +https://github.com/matplotlib/basemap/issues/561 [#560]: https://github.com/matplotlib/basemap/pull/560 [#559]: diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index f9a33dfc0..26e78d87a 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -2,7 +2,8 @@ requires = [ 'setuptools', 'wheel', - 'numpy == 1.21.4; python_version >= "3.10"', + '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")',