Skip to content
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
23 changes: 21 additions & 2 deletions .github/actions/build-python-package/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,35 @@ runs:

steps:
- uses: actions/checkout@v5

- uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}
cache: 'pip'
cache-dependency-path: |
continuous-integration/environment.yaml
pyproject.toml
poetry.lock

- name: Cache conda packages
uses: actions/cache@v5
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ hashFiles('continuous-integration/environment.yaml') }}

- name: Install base Conda environment
uses: conda-incubator/setup-miniconda@v4
with:
environment-file: continuous-integration/environment.yaml
python-version: ${{ inputs.python-version }}
miniforge-version: latest
use-only-tar-bz2: true

- name: Build python package
shell: bash -l {0}
run: |
pip install build
python3 -m build
poetry build

- uses: actions/upload-artifact@v7
with:
Expand Down
70 changes: 26 additions & 44 deletions .github/actions/environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ inputs:
required: false
default: 'pinned'
extras:
description: Which set of emsarray 'extras' to install.
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.
default: 'complete'
groups:
description: Which set of emsarray dependency groups to install.
required: false
default: 'false'
default: 'testing'

runs:
using: composite
Expand All @@ -34,9 +31,9 @@ runs:
python-version: ${{ inputs.python-version }}
cache: 'pip'
cache-dependency-path: |
continuous-integration/requirements-${{ inputs.python-version }}.txt
continuous-integration/environment.yaml
setup.cfg
pyproject.toml
poetry.lock

- name: Fetch built emsarray package
uses: actions/download-artifact@v8
Expand All @@ -56,45 +53,30 @@ runs:
with:
environment-file: continuous-integration/environment.yaml
python-version: ${{ inputs.python-version }}
channels: conda-forge
- shell: bash -l {0}
run: |
conda install -c conda-forge pip wheel
miniforge-version: latest
use-only-tar-bz2: true

- name: Install pinned dependencies
if: ${{ inputs.dependencies == 'pinned' }}
- name: Install dependencies
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
if [[ "${INPUTS_DEPENDENCIES}" == "minimum" ]] ; then
export POETRY_SOLVER_MIN_RELEASE_AGE=365
export POETRY_SOLVER_MIN_RELEASE_AGE_EXCLUDE=certify,idna
# Remove the docs dependency group. It has minimum requirements that
# do not adhere to the minimum release age solver. This is jank.
sed -i -e '/^docs = \[$/,/^\]$/{d}' "pyproject.toml"
fi
if [[ "${INPUTS_DEPENDENCIES}" != "pinned" ]] ; then
rm poetry.lock
fi

- 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]}"
poetry install --no-root --extras="${INPUTS_EXTRAS}" --only="main,${INPUTS_GROUPS}"
pip install --no-deps "${wheels[0]}"
pip check
pip install \
-r continuous-integration/requirements-minimum.txt \
"${wheels[0]}[${{ inputs.extras }}]"

- name: Install latest dependencies
if: ${{ inputs.dependencies == 'latest' }}
shell: bash -l {0}
run: |
wheels=( dist/emsarray-*.whl )
pip install "${wheels[0]}[${{ inputs.extras }}]"
env:
INPUTS_DEPENDENCIES: ${{ inputs.dependencies }}
INPUTS_EXTRAS: ${{ inputs.extras }}
INPUTS_GROUPS: ${{ inputs.groups }}
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ jobs:
python-version: ${{ matrix.python-version }}
package-artifact-name: ${{ needs.build.outputs.artifact-name }}
dependencies: ${{ matrix.dependencies }}
strict: "true"

- run: |
echo "MATRIX_TAG=py${MATRIX_PYTHON_VERSION}-${MATRIX_DEPENDENCIES}-deps" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -164,7 +163,7 @@ jobs:
- uses: ./.github/actions/environment
with:
python-version: ${{ env.python-version }}
extras: docs
groups: docs
package-artifact-name: ${{ needs.build.outputs.artifact-name }}

- name: Set up cartopy cache directories
Expand Down
9 changes: 6 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ build:
os: "ubuntu-20.04"
tools:
python: "mambaforge-4.10"
jobs:
post_install:
- POETRY_VIRTUALENVS_CREATE=false poetry --no-ansi install --with docs --all-extras

conda:
environment: continuous-integration/docs.yaml

sphinx:
configuration: "docs/conf.py"
builder: "dirhtml"

conda:
environment: continuous-integration/docs.yaml
5 changes: 1 addition & 4 deletions continuous-integration/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ dependencies:
- udunits2 >=2.2.25
- python =3.14
- ffmpeg
- wheel
- pip:
- -r ./requirements-3.14.txt
- -e ..[docs]
- poetry
1 change: 1 addition & 0 deletions continuous-integration/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ channels:
dependencies:
- geos ~=3.12.2
- udunits2 >=2.2.25
- poetry ~=2.4.0
Loading