Skip to content

Build(deps): Bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0 #2117

Build(deps): Bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0

Build(deps): Bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0 #2117

Workflow file for this run

name: Tests
on:
push:
pull_request:
schedule:
# 10th of each month
- cron: "0 0 10 * *"
workflow_dispatch:
jobs:
tests:
if: github.repository == 'scitools/cartopy'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.11', '3.12', '3.13', '3.14']
use-network: [true]
include:
- os: ubuntu-latest
# do not use the version we use for coverage
python-version: '3.12'
use-network: false
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Minimum packages
if: |
matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' &&
(github.event_name == 'push' || github.event_name == 'pull_request')
id: minimum-packages
run: |
pip install cython==3.0 matplotlib==3.8 numpy==1.26 owslib==0.29 pyproj==3.6 scipy==1.11 shapely==2.0 pyshp==2.3.1
- name: Coverage packages
id: coverage
# only want the coverage to be run on the latest ubuntu and for code changes i.e. push and pr
# switch to py 3.14 when fiona wheels are available https://github.com/Toblerity/Fiona/issues/1504
if: |
matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' &&
(github.event_name == 'push' || github.event_name == 'pull_request')
run: |
echo "CYTHON_COVERAGE=1" >> $GITHUB_ENV
# Also add doctest here to avoid windows runners which expect a different path separator
echo "EXTRA_TEST_ARGS=--cov=cartopy -ra --doctest-modules" >> $GITHUB_ENV
pip install cython # Required for Cython.Coverage plugin.
- name: Install Nightlies
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
run: |
# Install Nightly builds from Scientific Python
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple matplotlib pyproj scipy shapely
- name: Install Cartopy
id: install
shell: bash
run: |
if [ ${{ steps.minimum-packages.conclusion }} == 'skipped' ]; then
# Default is to install just the minimum testing requirements,
# but we want to get as much coverage as possible.
if [ ${{ matrix.python-version }} == '3.14' ]; then
# remove this if loop when fiona wheels are available for py3.14
# https://github.com/Toblerity/Fiona/issues/1504
EXTRA_PACKAGES=',ows,plotting'
pip install pykdtree
else
EXTRA_PACKAGES=',ows,plotting,speedups'
fi
fi
pip install -e .[test${EXTRA_PACKAGES}]
python -c "import cartopy; print('Version ', cartopy.__version__)"
- name: Testing
id: test
if: matrix.use-network
# we need to force bash to use line continuations on Windows
shell: bash
run: |
# Check that the downloader tool at least knows where to get the data from (but don't actually download it)
python -m cartopy.feature.download gshhs physical --dry-run
# It should also be available as a script
cartopy_feature_download gshhs physical --dry-run
CARTOPY_GIT_DIR=$PWD
pytest -rfEsX -n 4 \
--color=yes \
--mpl --mpl-generate-summary=html \
--mpl-results-path="cartopy_test_output-${{ matrix.os }}-${{ matrix.python-version }}" \
--pyargs cartopy ${EXTRA_TEST_ARGS}
- name: No Network Tests
# Ensure any test that needs network access has been marked as such
if: ${{ ! matrix.use-network }}
run: |
pip install pytest-socket
pytest -rfEsX -n 4 \
--color=yes \
--pyargs cartopy -m "not natural_earth and not network" --disable-socket
- name: Coveralls
if: steps.coverage.conclusion == 'success'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
coveralls --service=github
- name: Upload image results
uses: actions/upload-artifact@v7
if: failure()
with:
name: image-failures-${{ matrix.os }}-${{ matrix.python-version }}
path: cartopy_test_output-${{ matrix.os }}-${{ matrix.python-version }}
# Separate dependent job to only upload one issue from the matrix of jobs
create-issue:
if: ${{ failure() && github.event_name == 'schedule' }}
needs: [tests]
permissions:
issues: write
runs-on: ubuntu-latest
name: Create issue on failure
steps:
- name: Create issue on failure
uses: imjohnbo/issue-bot@v3
with:
title: "[TST] Upcoming dependency test failures"
body: |
The build with nightly wheels from matplotlib, pyproj, scipy, shapely and
their dependencies has failed. Check the logs for any updates that need to
be made in cartopy.
https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
pinned: false
close-previous: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
conda-tests:
# Tests our environment.yml file and will get the latest PROJ library
# to test against rather than only the one included in pyproj wheels.
if: github.repository == 'scitools/cartopy'
name: Conda Tests
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: '3.14'
activate-environment: cartopy-dev
environment-file: environment.yml
- name: Conda info
run: |
conda info
conda list
conda config --show-sources
conda config --show
- name: Install Cartopy
# All test and extra dependencies should come from the environment.yml file
run: |
pip install -e .
python -c "import cartopy; print('Version ', cartopy.__version__)"
- name: Testing
run: |
pytest -rfEsX -n 4 --color=yes --pyargs cartopy \
--mpl --mpl-generate-summary=html \
--mpl-results-path="cartopy_test_output-conda"
- name: Upload image results
uses: actions/upload-artifact@v7
if: failure()
with:
name: image-failures-conda
path: cartopy_test_output-conda