Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency version bump #137

Merged
merged 15 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 44 additions & 12 deletions .github/actions/environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@ inputs:
description: Name of the emsarray Python package artifact
required: false
default: "Python package"
install-latest:
description: Install latest dependency versions instead of locked versions
dependencies:
description: Install pinned, latest, or minimum dependency versions.
required: false
default: 'pinned'
extras:
description: Which set of emsarray 'extras' to install.
required: false
default: 'testing'
strict:
description: |
Whether to install transitive dependencies automatically. When installing
from a set of pinned dependencies the assumption is that all dependencies
are pinned, so there should be no missing transitive dependencies.
required: false
# All inputs are forced to strings
default: 'false'

runs:
Expand All @@ -23,7 +33,7 @@ runs:
with:
cache: 'pip'
cache-dependency-path: |
continuous-integration/requirements.txt
continuous-integration/requirements-${{ inputs.python-version }}.txt
continuous-integration/environment.yaml
setup.cfg

Expand Down Expand Up @@ -52,18 +62,40 @@ runs:
run: |
conda install -c conda-forge wheel

- name: Install locked Python packages
if: ${{ inputs.install-latest == 'false' }}
- name: Install pinned dependencies
if: ${{ inputs.dependencies == 'pinned' }}
shell: bash -l {0}
run: |
wheels=( dist/emsarray-*.whl )
args=()
if [[ "${{ inputs.strict }}" == "true" ]] ; then args+=('--no-deps') ; fi

pip install \
"${args[@]}" \
-r continuous-integration/requirements-${{ inputs.python-version }}.txt \
"${wheels[0]}[${{ inputs.extras }}]"
pip check

- name: Install minimum supported version dependencies
if: ${{ inputs.dependencies == 'minimum' }}
shell: bash -l {0}
run: |
wheels=( dist/emsarray-*.whl )
args=()
if [[ "${{ inputs.strict }}" == "true" ]] ; then args+=('--no-deps') ; fi

pip install \
"${args[@]}" \
-r continuous-integration/requirements-minimum.txt \
"${wheels[0]}"
pip check
pip install \
-r continuous-integration/requirements.txt \
dist/emsarray-*.whl
-r continuous-integration/requirements-minimum.txt \
"${wheels[0]}[${{ inputs.extras }}]"

- name: Install latest Python packages
if: ${{ inputs.install-latest != 'false'}}
- name: Install latest dependencies
if: ${{ inputs.dependencies == 'latest' }}
shell: bash -l {0}
run: |
wheels=( dist/emsarray-*.whl )
echo "${wheels[@]}"
pip install "${wheels[0]}[testing]"
pip install "${wheels[0]}[${{ inputs.extras }}]"
25 changes: 15 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
workflow_dispatch:

env:
python-version: "3.11"
python-version: "3.12"

jobs:
build:
Expand Down Expand Up @@ -55,29 +55,33 @@ jobs:
./scripts/build-local-conda-package.sh

test:
name: python ${{ matrix.python-version }}, ${{ matrix.experimental && 'latest' || 'pinned' }} dependencies
name: python ${{ matrix.python-version }}, ${{ matrix.dependencies }} dependencies
runs-on: ubuntu-latest
timeout-minutes: 10
needs: ["build"]

# Allow failures for the latest versions
continue-on-error: ${{ matrix.experimental }}
continue-on-error: ${{ matrix.dependencies == 'latest' }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
experimental: [false]
python-version: ["3.10", "3.11", "3.12"]
dependencies: ["pinned"]
include:
- python-version: "3.11"
experimental: true
- python-version: "3.12"
dependencies: "latest"
- python-version: "3.10"
dependencies: "minimum"


steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/environment
with:
python-version: ${{ matrix.python-version }}
package-artifact-name: ${{ needs.build.outputs.artifact-name }}
install-latest: ${{ matrix.experimental }}
dependencies: ${{ matrix.dependencies }}
strict: "true"

- name: Run tests
shell: bash -l {0}
Expand All @@ -95,13 +99,13 @@ jobs:
if: always()
with:
report_paths: 'junit-py*.xml'
check_name: "JUnit Test Report - python ${{ matrix.python-version }}, ${{ matrix.experimental && 'latest' || 'pinned' }} dependencies"
check_name: "JUnit Test Report - python ${{ matrix.python-version }}, ${{ matrix.dependencies }} dependencies"

- name: MPL image comparison report
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: "MPL image comparison report - python ${{ matrix.python-version }}, ${{ matrix.experimental && 'latest' || 'pinned' }} dependencies"
name: "MPL image comparison report - python ${{ matrix.python-version }}, ${{ matrix.dependencies }} dependencies"
path: './mpl-results'
# No guarantee that the test failures were due to image comparisons
if-no-files-found: 'ignore'
Expand Down Expand Up @@ -151,6 +155,7 @@ jobs:
- uses: ./.github/actions/environment
with:
python-version: ${{ env.python-version }}
extras: docs
package-artifact-name: ${{ needs.build.outputs.artifact-name }}

- run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ To get set up for development, make a virtual environment and install the depend
$ python3 -m venv
$ source venv/bin/activate
$ pip install --upgrade pip>=21.3
$ pip install -e . -r continuous-integration/requirements.txt
$ pip install -e .[testing]
```

## Tests
Expand Down
8 changes: 4 additions & 4 deletions continuous-integration/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ channels:
- conda-forge

dependencies:
- geos ~=3.10.2
- python =3.10
- geos ~=3.12.2
- python =3.12
- wheel
- pip:
- -r ./requirements.txt
- -e ..
- -r ./requirements-3.12.txt
- -e ..[docs]
2 changes: 1 addition & 1 deletion continuous-integration/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ channels:
- conda-forge

dependencies:
- geos ~=3.10.2
- geos ~=3.12.2
- udunits2 >=2.2.25
Loading
Loading