diff --git a/.github/actions/build-docs/action.yml b/.github/actions/build-docs/action.yml index 824c1767905..2a666c2daf4 100644 --- a/.github/actions/build-docs/action.yml +++ b/.github/actions/build-docs/action.yml @@ -9,6 +9,10 @@ inputs: description: 'Key to use for artifacts' required: false default: '' + make-targets: + description: 'Extra Makefile targets to build' + required: false + default: 'overridecheck' outputs: doc-version: description: 'What version the docs correspond to' @@ -23,7 +27,11 @@ runs: - name: Set doc version id: docversion shell: bash -l {0} - run: echo "doc_version=$(python -c 'import metpy,re; print(re.search(r"(\d+\.\d+)", metpy.__version__)[0])')" >> $GITHUB_OUTPUT + run: echo "doc_version=$(python -c 'import importlib.metadata,os,re; print(re.search(r"(\d+\.\d+)", importlib.metadata.version(os.environ["GITHUB_REPOSITORY"].split("/")[-1].lower()))[0])')" >> $GITHUB_OUTPUT + + - name: Show doc version + shell: bash -l {0} + run: echo Building docs for version ${{ steps.docversion.outputs.doc_version }} - name: Build docs shell: bash -l {0} @@ -35,7 +43,7 @@ runs: run: | set -e -o pipefail pushd docs - make overridecheck html O=-W 2>&1 | tee ../build.log && popd || (popd && false) + make ${{ inputs.make-targets }} html O=-W 2>&1 | tee ../build.log && popd || (popd && false) - name: Run link checker # Running linkchecker separately so that we avoid problems with vendored LICENSE diff --git a/.github/actions/install-pypi/action.yml b/.github/actions/install-pypi/action.yml index db05ba94a75..64ddc64eadb 100644 --- a/.github/actions/install-pypi/action.yml +++ b/.github/actions/install-pypi/action.yml @@ -19,6 +19,10 @@ inputs: description: 'Whether to enable old builds for shapely and cartopy' required: false default: 'false' + need-cartopy: + description: 'Whether Cartopy support is needed' + required: false + default: 'false' runs: using: composite @@ -74,7 +78,7 @@ runs: -c ci/${{ inputs.version-file }} -c ci/${{ inputs.type }}_requirements.txt -c ci/extra_requirements.txt - name: Download Cartopy Maps - if: ${{ inputs.need-extras == 'true' }} + if: ${{ inputs.need-cartopy == 'true' }} shell: bash run: ci/download_cartopy_maps.py diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index ad11c9aa53f..0098a14d040 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -12,6 +12,10 @@ inputs: description: 'Whether to upload coverage report' required: false default: 'true' + pytest-args: + description: 'Additional arguments to pass to pytest' + required: false + default: '-W error::metpy.deprecation.MetpyDeprecationWarning' runs: using: composite steps: @@ -26,7 +30,7 @@ runs: # By running coverage in "parallel" mode and "combining", we can clean up the path names run: | set -e -o pipefail - python -m coverage run -p -m pytest --mpl -W error::metpy.deprecation.MetpyDeprecationWarning tests/ 2>&1 | tee tests-${{ inputs.key }}.log + python -m coverage run -p -m pytest --mpl ${{ inputs.pytest-args }} tests/ 2>&1 | tee tests-${{ inputs.key }}.log python -m coverage combine python -m coverage report python -m coverage xml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5eca0ec8f94..8806e70b383 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -50,6 +50,7 @@ jobs: type: 'doc' python-version: ${{ matrix.python-version }} need-extras: true + need-cartopy: true - name: Build docs id: build-docs diff --git a/.github/workflows/tests-pypi.yml b/.github/workflows/tests-pypi.yml index fcc1657779d..788d1a66658 100644 --- a/.github/workflows/tests-pypi.yml +++ b/.github/workflows/tests-pypi.yml @@ -76,6 +76,7 @@ jobs: type: 'test' python-version: ${{ matrix.python-version }} old-build: ${{ matrix.no-extras != 'No Extras' && matrix.dep-versions == 'Minimum' }} + need-cartopy: ${{ matrix.no-extras != 'No Extras' }} - name: Run tests uses: ./.github/actions/run-tests