diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml deleted file mode 100644 index a33ddb14..00000000 --- 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 629213f3..00000000 --- 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 cdd577b1..00000000 --- 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 92eb337f..00000000 --- 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-data.yml b/.github/workflows/build-data.yml new file mode 100644 index 00000000..79ff13df --- /dev/null +++ b/.github/workflows/build-data.yml @@ -0,0 +1,86 @@ +name: Build Data Packages + +env: + PYTHONUNBUFFERED: "1" + PYTHONWARNINGS: "ignore:DEPRECATION" + +on: + push: + paths: + - "packages/basemap_data/**" + - "packages/basemap_data_hires/**" + pull_request: + paths: + - "packages/basemap_data/**" + - "packages/basemap_data_hires/**" + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + package: [basemap_data, basemap_data_hires] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Build package + run: | + cd packages/${{ matrix.package }} + pip install build + python -m build + + - uses: actions/upload-artifact@v4 + with: + name: dist-${{ matrix.package }} + path: packages/${{ matrix.package }}/dist/* + + upload_testpypi: + needs: [build] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + strategy: + matrix: + package: [basemap_data, basemap_data_hires] + environment: + name: TestPyPI + url: https://test.pypi.org/p/${{ matrix.package }} + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: dist-${{ matrix.package }} + path: dist + + - name: Upload to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + + upload_pypi: + needs: [build, upload_testpypi] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + strategy: + matrix: + package: [basemap_data, basemap_data_hires] + environment: + name: PyPI + url: https://pypi.org/p/${{ matrix.package }} + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: dist-${{ matrix.package }} + path: dist + + - name: Upload to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..d979051f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,134 @@ +name: Build and Test + +env: + PKGDIR: "packages/basemap" + CIBW_BUILD_VERBOSITY: 1 + PYTHONUNBUFFERED: "1" + PYTHONWARNINGS: "ignore:DEPRECATION" + +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_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, windows-2019, macos-11] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.16.2 + + - name: Build wheels + env: + CIBW_SKIP: "pp* *-musllinux*" # Skip PyPy and musllinux + CIBW_BEFORE_BUILD: > + pip install numpy cython && + python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', njobs=16)" + CIBW_BEFORE_TEST: "pip install -r {project}/requirements-test.txt" + CIBW_TEST_COMMAND: > + cd {project} && python -m pytest --cov="mpl_toolkits.basemap" + --cov-report=term --ignore=dist --ignore=build + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_ENVIRONMENT: "GEOS_DIR={project}/extern" + run: | + cd ${{ env.PKGDIR }} + python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.os }} + path: ${{ env.PKGDIR }}/wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Build sdist + run: | + cd ${{ env.PKGDIR }} + pip install build + python -m build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: sdist + path: ${{ env.PKGDIR }}/dist/*.tar.gz + + upload_testpypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + environment: + name: TestPyPI + url: https://test.pypi.org/p/basemap + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + pattern: wheels-* + path: dist + merge-multiple: true + + - uses: actions/download-artifact@v4 + with: + name: sdist + path: dist + + - name: Upload to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + + upload_pypi: + needs: [build_wheels, build_sdist, upload_testpypi] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + environment: + name: PyPI + url: https://pypi.org/p/basemap + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + pattern: wheels-* + path: dist + merge-multiple: true + + - uses: actions/download-artifact@v4 + with: + name: sdist + path: dist + + - name: Upload to PyPI + uses: pypa/gh-action-pypi-publish@release/v1