From 87a5b91c90ec5a6d29e71fd9f668690eed0ebc20 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 12:57:10 +0100 Subject: [PATCH 01/35] unified build and modernizes to CIBUILD --- .github/workflows/build.yml | 149 ++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..6716a6ec8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,149 @@ +name: Build +env: + GEOS_VERSION: "3.6.5" + +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 + 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.8" + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build wheel + + - name: Build package + run: | + cd packages/${{ matrix.package }} + python -m build --wheel --sdist + + - uses: actions/upload-artifact@v4 + with: + path: packages/${{ matrix.package }}/dist/* + name: dist-${{ matrix.package }} + + build_basemap: + name: Build basemap wheels (${{ matrix.os }}) + needs: [build_data] + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + include: + - os: ubuntu-latest + before_all: | + echo "Starting BEFORE_ALL script" + cd "{package}" + export GEOS_DIR="$(pwd)/extern" + echo "GEOS_DIR set to: $GEOS_DIR" + python -c "import sys; sys.path.append('utils'); from GeosLibrary import GeosLibrary; GeosLibrary('3.6.5', root='extern').build('extern', njobs=16)" + environment: >- + CFLAGS="-I/project/packages/basemap/extern/include -I/project/packages/basemap/extern/include/geos" + LDFLAGS="-L/project/packages/basemap/extern/lib" + PIP_DEFAULT_TIMEOUT=10 + PIP_DISABLE_PIP_VERSION_CHECK=1 + PIP_PREFER_BINARY=1 + PIP_RETRIES=0 + PYTHONUNBUFFERED=1 + PYTHONWARNINGS="ignore:DEPRECATION" + + - os: windows-latest + before_all: >- + pwsh -Command " + Write-Host 'Starting BEFORE_ALL script'; + $pwd = Get-Location; + Write-Host 'Current directory:' $pwd; + Set-Location '{package}'; + $env:GEOS_DIR = '{package}/extern'; + python -c 'import sys, os; sys.path.append(\"utils\"); from GeosLibrary import GeosLibrary; GeosLibrary(\"3.6.5\").build(\"extern\", njobs=16)' + " + environment: >- + GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" + CFLAGS="-ID:/a/basemap/basemap/packages/basemap/extern/include -ID:/a/basemap/basemap/packages/basemap/extern/include/geos/include" + LDFLAGS="-LD:/a/basemap/basemap/packages/basemap/extern/lib" + PIP_DEFAULT_TIMEOUT=10 + PIP_DISABLE_PIP_VERSION_CHECK=1 + PIP_PREFER_BINARY=1 + PIP_RETRIES=0 + PYTHONUNBUFFERED=1 + PYTHONWARNINGS="ignore:DEPRECATION" + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Build wheels + uses: pypa/cibuildwheel@v2.22.0 + env: + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" + CIBW_ARCHS_LINUX: auto64 + CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD: "cp39* cp310* cp311* cp312*" + CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" + CIBW_BEFORE_ALL: ${{ matrix.before_all }} + CIBW_ENVIRONMENT: ${{ matrix.environment }} + CIBW_BUILD_REQUIRES: "cython>=0.29,<3.1" + CIBW_REPAIR_WHEEL_COMMAND: "" + with: + package-dir: packages/basemap + + - uses: actions/upload-artifact@v4 + with: + path: ./wheelhouse/*.whl + name: wheels-basemap-${{ matrix.os }} + + upload_pypi: + needs: [build_data, build_basemap] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + strategy: + matrix: + package: [basemap, basemap_data, basemap_data_hires] + include: + - package: basemap + artifact_pattern: "wheels-basemap-*" + - package: basemap_data + artifact_pattern: "dist-basemap_data" + - package: basemap_data_hires + artifact_pattern: "dist-basemap_data_hires" + steps: + - uses: actions/download-artifact@v4 + with: + pattern: ${{ matrix.artifact_pattern }} + path: dist + merge-multiple: true + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TOKEN }} From ff3680f1ab43163b2984b622e89de368a8ebf677 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 12:57:36 +0100 Subject: [PATCH 02/35] removed eol support and set numpy standard --- packages/basemap/pyproject.toml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 6a50e2c78..89a9c07da 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -2,14 +2,7 @@ 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")', + 'numpy >= 2.0.0; python_version >= "3.9"', 'cython >= 0.29, < 3.1; python_version >= "3.3" or python_version < "3.0"', - 'cython >= 0.26, < 0.27; python_version == "3.2"' ] build-backend = "setuptools.build_meta" From 7bf4d9a0c540f77af7ec875dd2113b6755845ee4 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 12:58:00 +0100 Subject: [PATCH 03/35] update dependencies and remove eol support --- packages/basemap/requirements.txt | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/packages/basemap/requirements.txt b/packages/basemap/requirements.txt index 7e10e9c1b..78a1ce0d3 100644 --- a/packages/basemap/requirements.txt +++ b/packages/basemap/requirements.txt @@ -1,38 +1,10 @@ basemap_data >= 1.3.2, < 1.4 -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" - -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" +numpy >= 2.0.0; python_version >= "3.9" 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, < 25.0; python_version >= "3.5" From b3871cbfc4f529dd886713301f402551006ff93f Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 13:20:26 +0100 Subject: [PATCH 04/35] cleanup old workflows --- .github/workflows/basemap-for-manylinux.yml | 449 -------------------- .github/workflows/basemap-for-windows.yml | 326 -------------- 2 files changed, 775 deletions(-) delete mode 100644 .github/workflows/basemap-for-manylinux.yml delete mode 100644 .github/workflows/basemap-for-windows.yml diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml deleted file mode 100644 index 617568c9a..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: 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 From 4830331ffb15fb4798934b1065b42fdf0d468c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 18:43:51 +0100 Subject: [PATCH 05/35] Change Python version in setup step to 3.9 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6716a6ec8..a19cab4f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.9" - name: Install build dependencies run: | From 121ecb2f23ca963271cb059b2f64695539fc9a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 18:45:01 +0100 Subject: [PATCH 06/35] Restrict numpy version in pyproject.toml build requirements --- packages/basemap/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 89a9c07da..62fefffed 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -2,7 +2,7 @@ requires = [ 'setuptools', 'wheel', - 'numpy >= 2.0.0; python_version >= "3.9"', + 'numpy == 2.0.0', 'cython >= 0.29, < 3.1; python_version >= "3.3" or python_version < "3.0"', ] build-backend = "setuptools.build_meta" From 980584234d27abf1b60e20a52a0bb597fd31a9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 18:45:29 +0100 Subject: [PATCH 07/35] Clean Cython conditions in pyproject.toml build requirements --- packages/basemap/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 62fefffed..8ab927ff8 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -3,6 +3,6 @@ requires = [ 'setuptools', 'wheel', 'numpy == 2.0.0', - 'cython >= 0.29, < 3.1; python_version >= "3.3" or python_version < "3.0"', + 'cython >= 0.29, < 3.1', ] build-backend = "setuptools.build_meta" From bac26196ba69a639edaceb6bc608a113b1988157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 18:47:54 +0100 Subject: [PATCH 08/35] Update python_requires in setup.py files --- packages/basemap/setup.py | 4 +--- packages/basemap_data/setup.py | 4 +--- packages/basemap_data_hires/setup.py | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 4c98a8776..8d2bebdd0 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -237,9 +237,7 @@ def run(self): data_files, "python_requires": ", ".join([ - ">=2.6", - "!=3.0.*", - "!=3.1.*", + ">=3.9", "<3.13", ]), "setup_requires": diff --git a/packages/basemap_data/setup.py b/packages/basemap_data/setup.py index 2d8e4e620..2286b7419 100644 --- a/packages/basemap_data/setup.py +++ b/packages/basemap_data/setup.py @@ -121,9 +121,7 @@ def get_content(name, splitlines=False): }, "python_requires": ", ".join([ - ">=2.6", - "!=3.0.*", - "!=3.1.*", + ">=3.9", "<4", ]), "project_urls": { diff --git a/packages/basemap_data_hires/setup.py b/packages/basemap_data_hires/setup.py index 7dbe83cf6..5dc8009ad 100644 --- a/packages/basemap_data_hires/setup.py +++ b/packages/basemap_data_hires/setup.py @@ -99,9 +99,7 @@ def get_content(name, splitlines=False): }, "python_requires": ", ".join([ - ">=2.6", - "!=3.0.*", - "!=3.1.*", + ">=3.9", "<4", ]), "project_urls": { From ddc58bf076bf71041091df29fc662ea7bee8f919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 19:04:11 +0100 Subject: [PATCH 09/35] Remove CIBW_REPAIR_WHEEL_COMMAND entry in build.yml Based on the `cibuildwheel` docs: https://cibuildwheel.pypa.io/en/stable/options/ If `CIBW_REPAIR_WHEEL_COMMAND` is not specified, then the default behaviour for Linux is our desired behaviour: auditwheel repair -w {dest_dir} {wheel} Because `CIBW_REPAIR_WHEEL_COMMAND` was set before to "", the repair step was being skipped. --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a19cab4f3..723638074 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -113,7 +113,6 @@ jobs: CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_ENVIRONMENT: ${{ matrix.environment }} CIBW_BUILD_REQUIRES: "cython>=0.29,<3.1" - CIBW_REPAIR_WHEEL_COMMAND: "" with: package-dir: packages/basemap From 1010b530c42203b87fd46621e042776630cd35a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 19:14:32 +0100 Subject: [PATCH 10/35] Ensure auditwheel can find libraries to bundle This is done by forcing the value of `LD_LIBRARY_PATH` temporarily to the location of the GEOS shared library. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 723638074..593f34517 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,6 +65,7 @@ jobs: environment: >- CFLAGS="-I/project/packages/basemap/extern/include -I/project/packages/basemap/extern/include/geos" LDFLAGS="-L/project/packages/basemap/extern/lib" + LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" PIP_DEFAULT_TIMEOUT=10 PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 From a856f41957aeb2dc6f0788b62e8e0d3daaf93e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 19:30:14 +0100 Subject: [PATCH 11/35] Remove old workflows building the data packages --- .github/workflows/basemap-data-hires.yml | 137 ----------------------- .github/workflows/basemap-data.yml | 137 ----------------------- 2 files changed, 274 deletions(-) delete mode 100644 .github/workflows/basemap-data-hires.yml delete mode 100644 .github/workflows/basemap-data.yml 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 From 43c5e35b53cf44d1bee631404303bffe3c393e99 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 20:26:20 +0100 Subject: [PATCH 12/35] add sdist --- .github/workflows/build.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 593f34517..a1013f0bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,6 +103,15 @@ jobs: with: python-version: "3.9" + - name: Build SDist + if: matrix.os == 'ubuntu-latest' + run: | + pip install build + mkdir -p wheelhouse + cd packages/basemap + python -m build --sdist + mv dist/* ../../wheelhouse/ + - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: @@ -119,7 +128,9 @@ jobs: - uses: actions/upload-artifact@v4 with: - path: ./wheelhouse/*.whl + path: | + ./wheelhouse/*.whl + ./wheelhouse/*.tar.gz name: wheels-basemap-${{ matrix.os }} upload_pypi: From 3b817f905ad1e0517ce198048b8e6d122927ebd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 09:46:12 +0100 Subject: [PATCH 13/35] Add missing GEOS_DIR to build_basemap environment on GNU/Linux --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1013f0bc..fd8d5ef01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,6 +63,7 @@ jobs: echo "GEOS_DIR set to: $GEOS_DIR" python -c "import sys; sys.path.append('utils'); from GeosLibrary import GeosLibrary; GeosLibrary('3.6.5', root='extern').build('extern', njobs=16)" environment: >- + GEOS_DIR="/project/packages/basemap/extern" CFLAGS="-I/project/packages/basemap/extern/include -I/project/packages/basemap/extern/include/geos" LDFLAGS="-L/project/packages/basemap/extern/lib" LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" From 55b90161427e28172773f8a85cef320fd568e5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 10:38:44 +0100 Subject: [PATCH 14/35] Remove CFLAGS and LDFLAGS from workflow environments --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd8d5ef01..a64b60753 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,10 +62,9 @@ jobs: export GEOS_DIR="$(pwd)/extern" echo "GEOS_DIR set to: $GEOS_DIR" python -c "import sys; sys.path.append('utils'); from GeosLibrary import GeosLibrary; GeosLibrary('3.6.5', root='extern').build('extern', njobs=16)" + # LD_LIBRARY_PATH in environment is needed by auditwheel. environment: >- GEOS_DIR="/project/packages/basemap/extern" - CFLAGS="-I/project/packages/basemap/extern/include -I/project/packages/basemap/extern/include/geos" - LDFLAGS="-L/project/packages/basemap/extern/lib" LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" PIP_DEFAULT_TIMEOUT=10 PIP_DISABLE_PIP_VERSION_CHECK=1 @@ -86,8 +85,6 @@ jobs: " environment: >- GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" - CFLAGS="-ID:/a/basemap/basemap/packages/basemap/extern/include -ID:/a/basemap/basemap/packages/basemap/extern/include/geos/include" - LDFLAGS="-LD:/a/basemap/basemap/packages/basemap/extern/lib" PIP_DEFAULT_TIMEOUT=10 PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 From 042e1eb1a61c5e227eccd3334b2cb1d7b628d845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 10:54:34 +0100 Subject: [PATCH 15/35] Refactor pip calls and pip environment variables in new workflow --- .github/workflows/build.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a64b60753..32170579c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,13 +35,12 @@ jobs: - name: Install build dependencies run: | - python -m pip install --upgrade pip - pip install build wheel + python -m pip install build wheel - name: Build package run: | cd packages/${{ matrix.package }} - python -m build --wheel --sdist + python -m build --sdist --wheel - uses: actions/upload-artifact@v4 with: @@ -66,10 +65,8 @@ jobs: environment: >- GEOS_DIR="/project/packages/basemap/extern" LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" - PIP_DEFAULT_TIMEOUT=10 PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 - PIP_RETRIES=0 PYTHONUNBUFFERED=1 PYTHONWARNINGS="ignore:DEPRECATION" @@ -85,10 +82,8 @@ jobs: " environment: >- GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" - PIP_DEFAULT_TIMEOUT=10 PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 - PIP_RETRIES=0 PYTHONUNBUFFERED=1 PYTHONWARNINGS="ignore:DEPRECATION" @@ -104,7 +99,7 @@ jobs: - name: Build SDist if: matrix.os == 'ubuntu-latest' run: | - pip install build + python -m pip install build mkdir -p wheelhouse cd packages/basemap python -m build --sdist From 8b7ce96bec1b1c5ed56e1117c84f95cd567c9f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 11:04:14 +0100 Subject: [PATCH 16/35] Remove PIP_DISABLE_PIP_VERSION_CHECK from workflow environment Based on the `cibuildwheel` docs, this environment variable is already defined by `cibuildwheel`: https://cibuildwheel.pypa.io/en/stable/options/#environment --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32170579c..307014b20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,6 @@ jobs: environment: >- GEOS_DIR="/project/packages/basemap/extern" LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" - PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 PYTHONWARNINGS="ignore:DEPRECATION" @@ -82,7 +81,6 @@ jobs: " environment: >- GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" - PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 PYTHONWARNINGS="ignore:DEPRECATION" From 68a554178621cd75bd1327b3a471020f1582dea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 11:08:07 +0100 Subject: [PATCH 17/35] Remove PYTHONWARNINGS from workflow environment This used to be set in order to silence some deprecation warnings, but now we want these warnings to appear in the logs, to address them as soon as we see them. --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 307014b20..b970e8f96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,7 +67,6 @@ jobs: LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - PYTHONWARNINGS="ignore:DEPRECATION" - os: windows-latest before_all: >- @@ -83,7 +82,6 @@ jobs: GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - PYTHONWARNINGS="ignore:DEPRECATION" runs-on: ${{ matrix.os }} steps: From ea3437f158a06d46b8daea1b87713250185f8c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 11:44:31 +0100 Subject: [PATCH 18/35] Apply minor refactoring in new workflow --- .github/workflows/build.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b970e8f96..25aecaefa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,6 @@ jobs: strategy: matrix: package: [basemap_data, basemap_data_hires] - steps: - uses: actions/checkout@v4 @@ -33,13 +32,10 @@ jobs: with: python-version: "3.9" - - name: Install build dependencies - run: | - python -m pip install build wheel - - - name: Build package + - 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 @@ -48,7 +44,7 @@ jobs: name: dist-${{ matrix.package }} build_basemap: - name: Build basemap wheels (${{ matrix.os }}) + name: Build basemap package (${{ matrix.os }}) needs: [build_data] strategy: matrix: @@ -67,7 +63,6 @@ jobs: LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - - os: windows-latest before_all: >- pwsh -Command " @@ -82,7 +77,6 @@ jobs: GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -92,12 +86,12 @@ jobs: with: python-version: "3.9" - - name: Build SDist + - name: Build sdist if: matrix.os == 'ubuntu-latest' run: | - python -m pip install build mkdir -p wheelhouse cd packages/basemap + python -m pip install build python -m build --sdist mv dist/* ../../wheelhouse/ From 1af79b545b1908536c7e7a2d6101b3be4c90a9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 12:05:24 +0100 Subject: [PATCH 19/35] Simplify cibuildwheel before_all block for GNU/Linux --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25aecaefa..d716e327a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,10 +53,9 @@ jobs: - os: ubuntu-latest before_all: | echo "Starting BEFORE_ALL script" + echo "GEOS_DIR set to: ${GEOS_DIR}" cd "{package}" - export GEOS_DIR="$(pwd)/extern" - echo "GEOS_DIR set to: $GEOS_DIR" - python -c "import sys; sys.path.append('utils'); from GeosLibrary import GeosLibrary; GeosLibrary('3.6.5', root='extern').build('extern', njobs=16)" + python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" # LD_LIBRARY_PATH in environment is needed by auditwheel. environment: >- GEOS_DIR="/project/packages/basemap/extern" From f78a4b7ffb44de41e578804267085cb39989a317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 12:17:52 +0100 Subject: [PATCH 20/35] Move GEOS_VERSION definition to cibuildwheel GNU/Linux environment --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d716e327a..c89a76e2b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,4 @@ name: Build -env: - GEOS_VERSION: "3.6.5" on: push: @@ -58,6 +56,7 @@ jobs: python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" # LD_LIBRARY_PATH in environment is needed by auditwheel. environment: >- + GEOS_VERSION="3.6.5" GEOS_DIR="/project/packages/basemap/extern" LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" PIP_PREFER_BINARY=1 From 8e85717e64bc876a6d4a9250543bd7197c23d89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 12:44:36 +0100 Subject: [PATCH 21/35] Simplify cibuildwheel before_all block for Windows --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c89a76e2b..1b9aa5e5e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,13 +65,11 @@ jobs: before_all: >- pwsh -Command " Write-Host 'Starting BEFORE_ALL script'; - $pwd = Get-Location; - Write-Host 'Current directory:' $pwd; Set-Location '{package}'; - $env:GEOS_DIR = '{package}/extern'; - python -c 'import sys, os; sys.path.append(\"utils\"); from GeosLibrary import GeosLibrary; GeosLibrary(\"3.6.5\").build(\"extern\", njobs=16)' + python -c 'import utils; utils.GeosLibrary(\"${env:GEOS_VERSION}\").build(\"${env:GEOS_DIR}\", njobs=2)' " environment: >- + GEOS_VERSION="3.6.5" GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 From 57e0c402c6113e48aa90392417d6545d0339434e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 13:00:46 +0100 Subject: [PATCH 22/35] Edit before_all block in Windows workflow to use pwsh commands directly --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b9aa5e5e..93828513f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,11 +63,10 @@ jobs: PYTHONUNBUFFERED=1 - os: windows-latest before_all: >- - pwsh -Command " - Write-Host 'Starting BEFORE_ALL script'; - Set-Location '{package}'; - python -c 'import utils; utils.GeosLibrary(\"${env:GEOS_VERSION}\").build(\"${env:GEOS_DIR}\", njobs=2)' - " + Write-Host "Starting BEFORE_ALL script" + Write-Host "GEOS_DIR set to: ${env:GEOS_DIR}" + Set-Location "{package}" + python -c "import utils; utils.GeosLibrary('${env:GEOS_VERSION}').build('${env:GEOS_DIR}', njobs=2)" environment: >- GEOS_VERSION="3.6.5" GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" From 220cdc10203246f431b60a08c7038dbeac3e4dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 13:32:24 +0100 Subject: [PATCH 23/35] Rewrite before_all block in Windows workflow to use cmd --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93828513f..14d0832ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,11 +62,11 @@ jobs: PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - os: windows-latest - before_all: >- - Write-Host "Starting BEFORE_ALL script" - Write-Host "GEOS_DIR set to: ${env:GEOS_DIR}" - Set-Location "{package}" - python -c "import utils; utils.GeosLibrary('${env:GEOS_VERSION}').build('${env:GEOS_DIR}', njobs=2)" + before_all: | + echo Starting BEFORE_ALL script + echo GEOS_DIR set to: %GEOS_DIR% + cd "{package}" + python -c "import utils; utils.GeosLibrary('%GEOS_VERSION%').build('%GEOS_DIR%', njobs=2)" environment: >- GEOS_VERSION="3.6.5" GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" From 18fe4c4ee1b90dedeb50814fcabefc067a55f762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 14:12:42 +0100 Subject: [PATCH 24/35] Rewrite before_all block in Windows workflow as a one-liner --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14d0832ba..e10d1f452 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,10 +62,10 @@ jobs: PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - os: windows-latest - before_all: | - echo Starting BEFORE_ALL script - echo GEOS_DIR set to: %GEOS_DIR% - cd "{package}" + before_all: >- + echo Starting BEFORE_ALL script && + echo GEOS_DIR set to: %GEOS_DIR% && + cd "{package}" && python -c "import utils; utils.GeosLibrary('%GEOS_VERSION%').build('%GEOS_DIR%', njobs=2)" environment: >- GEOS_VERSION="3.6.5" From 37423253e1bc258543a84f70725008002fcb19eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 20 Feb 2025 19:28:25 +0100 Subject: [PATCH 25/35] Refactor handling of artifacts in new workflow --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e10d1f452..a7e9e4e02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -109,27 +109,39 @@ jobs: path: | ./wheelhouse/*.whl ./wheelhouse/*.tar.gz - name: wheels-basemap-${{ matrix.os }} + name: dist-basemap-${{ matrix.os }} - upload_pypi: + check: + name: Check basemap packages needs: [build_data, build_basemap] runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + pattern: "dist-*" + merge-multiple: true + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Check packages with twine + run: | + python -m pip install twine + python -m twine check dist/* + + upload: + name: Upload basemap packages + needs: [build_data, build_basemap, check] + runs-on: ubuntu-latest if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - strategy: - matrix: - package: [basemap, basemap_data, basemap_data_hires] - include: - - package: basemap - artifact_pattern: "wheels-basemap-*" - - package: basemap_data - artifact_pattern: "dist-basemap_data" - - package: basemap_data_hires - artifact_pattern: "dist-basemap_data_hires" steps: - uses: actions/download-artifact@v4 with: - pattern: ${{ matrix.artifact_pattern }} path: dist + pattern: "dist-*" merge-multiple: true - name: Publish to PyPI From 51c1c2bbac601de185a8154870d2492342f55f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 20 Feb 2025 19:40:58 +0100 Subject: [PATCH 26/35] Apply minor modification in twine check --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7e9e4e02..5841848a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -112,7 +112,7 @@ jobs: name: dist-basemap-${{ matrix.os }} check: - name: Check basemap packages + name: Check packages needs: [build_data, build_basemap] runs-on: ubuntu-latest steps: @@ -130,10 +130,11 @@ jobs: - name: Check packages with twine run: | python -m pip install twine - python -m twine check dist/* + python -m twine check dist/*.tar.gz + python -m twine check dist/*.whl upload: - name: Upload basemap packages + name: Upload packages needs: [build_data, build_basemap, check] runs-on: ubuntu-latest if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') From 35d848f83aa13fee6d3e5ce32e3f07c364db97ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 20 Feb 2025 20:47:17 +0100 Subject: [PATCH 27/35] Remove unused CIBW_BUILD_REQUIRES environment variable --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5841848a7..28982fcd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,7 +100,6 @@ jobs: CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_ENVIRONMENT: ${{ matrix.environment }} - CIBW_BUILD_REQUIRES: "cython>=0.29,<3.1" with: package-dir: packages/basemap From 80f45d69dc8daf750dafb8e89866c89279c42aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 21 Feb 2025 19:00:45 +0100 Subject: [PATCH 28/35] Remove unused CIBW_PROJECT_REQUIRES_PYTHON environment variable --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28982fcd7..b350f2095 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,7 +93,6 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" CIBW_ARCHS_LINUX: auto64 CIBW_BUILD_VERBOSITY: 1 CIBW_BUILD: "cp39* cp310* cp311* cp312*" From 28c88a8956f570ae664d7fed843ba90b82beeb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 21 Feb 2025 19:02:44 +0100 Subject: [PATCH 29/35] Make cibuildwheel store wheels in package dist folder --- .github/workflows/build.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b350f2095..9410e5a55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,9 @@ jobs: - uses: actions/upload-artifact@v4 with: - path: packages/${{ matrix.package }}/dist/* + path: | + packages/${{ matrix.package }}/dist/*.tar.gz + packages/${{ matrix.package }}/dist/*.whl name: dist-${{ matrix.package }} build_basemap: @@ -84,11 +86,9 @@ jobs: - name: Build sdist if: matrix.os == 'ubuntu-latest' run: | - mkdir -p wheelhouse cd packages/basemap python -m pip install build python -m build --sdist - mv dist/* ../../wheelhouse/ - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 @@ -100,13 +100,14 @@ jobs: CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_ENVIRONMENT: ${{ matrix.environment }} with: - package-dir: packages/basemap + package-dir: "packages/basemap" + output-dir: "packages/basemap/dist" - uses: actions/upload-artifact@v4 with: path: | - ./wheelhouse/*.whl - ./wheelhouse/*.tar.gz + packages/basemap/dist/*.tar.gz + packages/basemap/dist/*.whl name: dist-basemap-${{ matrix.os }} check: From 21368dc187769aebf267b7cceb67ee501f844043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 21 Feb 2025 19:48:09 +0100 Subject: [PATCH 30/35] Redefine GEOS_DIR in new workflow using pwd command --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9410e5a55..a0963b565 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,8 +59,8 @@ jobs: # LD_LIBRARY_PATH in environment is needed by auditwheel. environment: >- GEOS_VERSION="3.6.5" - GEOS_DIR="/project/packages/basemap/extern" - LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" + GEOS_DIR="$(pwd)/extern" + LD_LIBRARY_PATH="${GEOS_DIR}/lib" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - os: windows-latest @@ -71,7 +71,7 @@ jobs: python -c "import utils; utils.GeosLibrary('%GEOS_VERSION%').build('%GEOS_DIR%', njobs=2)" environment: >- GEOS_VERSION="3.6.5" - GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" + GEOS_DIR="$(pwd)/extern" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 runs-on: ${{ matrix.os }} From bed3d4d29d6b70ad8a174f57b4799c589fc83240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 22 Feb 2025 18:24:59 +0100 Subject: [PATCH 31/35] Unify setup of cibuildwheel environment variables in new workflow --- .github/workflows/build.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0963b565..6ce986151 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,24 +56,12 @@ jobs: echo "GEOS_DIR set to: ${GEOS_DIR}" cd "{package}" python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - # LD_LIBRARY_PATH in environment is needed by auditwheel. - environment: >- - GEOS_VERSION="3.6.5" - GEOS_DIR="$(pwd)/extern" - LD_LIBRARY_PATH="${GEOS_DIR}/lib" - PIP_PREFER_BINARY=1 - PYTHONUNBUFFERED=1 - os: windows-latest before_all: >- echo Starting BEFORE_ALL script && echo GEOS_DIR set to: %GEOS_DIR% && cd "{package}" && python -c "import utils; utils.GeosLibrary('%GEOS_VERSION%').build('%GEOS_DIR%', njobs=2)" - environment: >- - GEOS_VERSION="3.6.5" - GEOS_DIR="$(pwd)/extern" - PIP_PREFER_BINARY=1 - PYTHONUNBUFFERED=1 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -98,7 +86,13 @@ jobs: CIBW_BUILD: "cp39* cp310* cp311* cp312*" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} - CIBW_ENVIRONMENT: ${{ matrix.environment }} + CIBW_ENVIRONMENT: > + GEOS_VERSION="3.6.5" + GEOS_DIR="$(pwd)/extern" + PIP_PREFER_BINARY=1 + PYTHONUNBUFFERED=1 + LD_LIBRARY_PATH="${GEOS_DIR}/lib" + # LD_LIBRARY_PATH in environment is needed by auditwheel (Linux). with: package-dir: "packages/basemap" output-dir: "packages/basemap/dist" From 6170ef07dff13b96901b916fcc12b473d7aa1ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 22 Feb 2025 18:26:51 +0100 Subject: [PATCH 32/35] Make before_all block use YAML folded style --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ce986151..e809dec60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,13 +51,13 @@ jobs: os: [ubuntu-latest, windows-latest] include: - os: ubuntu-latest - before_all: | - echo "Starting BEFORE_ALL script" - echo "GEOS_DIR set to: ${GEOS_DIR}" - cd "{package}" + before_all: > + echo "Starting BEFORE_ALL script" && + echo "GEOS_DIR set to: ${GEOS_DIR}" && + cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: windows-latest - before_all: >- + before_all: > echo Starting BEFORE_ALL script && echo GEOS_DIR set to: %GEOS_DIR% && cd "{package}" && From 1a839251bbcb9726aef26e8b50abb1a884f3d847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 22 Feb 2025 18:31:14 +0100 Subject: [PATCH 33/35] Bring back hyphen in YAML folded syntax This ensures that no line break is appended at the end of the multiline string. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e809dec60..be11641f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,13 +51,13 @@ jobs: os: [ubuntu-latest, windows-latest] include: - os: ubuntu-latest - before_all: > + before_all: >- echo "Starting BEFORE_ALL script" && echo "GEOS_DIR set to: ${GEOS_DIR}" && cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: windows-latest - before_all: > + before_all: >- echo Starting BEFORE_ALL script && echo GEOS_DIR set to: %GEOS_DIR% && cd "{package}" && @@ -86,7 +86,7 @@ jobs: CIBW_BUILD: "cp39* cp310* cp311* cp312*" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} - CIBW_ENVIRONMENT: > + CIBW_ENVIRONMENT: >- GEOS_VERSION="3.6.5" GEOS_DIR="$(pwd)/extern" PIP_PREFER_BINARY=1 From 55b9718f4451f80d9e5c52d5bd7737e194031eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 22 Feb 2025 18:35:22 +0100 Subject: [PATCH 34/35] Apply minor reordering in build_data job --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be11641f6..8d7a9810f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,10 +18,10 @@ on: jobs: build_data: name: Build data packages - runs-on: ubuntu-latest strategy: matrix: package: [basemap_data, basemap_data_hires] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 71694578de69579d9dbce89cb2383366e0f9aa06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 22 Feb 2025 18:56:58 +0100 Subject: [PATCH 35/35] Remove unused CIBW_ARCHS_LINUX environment variable --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d7a9810f..23a7a299b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,7 +81,6 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: - CIBW_ARCHS_LINUX: auto64 CIBW_BUILD_VERBOSITY: 1 CIBW_BUILD: "cp39* cp310* cp311* cp312*" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l"