Skip to content

Commit

Permalink
ci: rename workflow names, revise uv setup, fix python versions (modf…
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews authored Feb 5, 2025
1 parent f76864f commit a2f6002
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 146 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: FloPy benchmarks
name: Benchmarks

on:
schedule:
Expand All @@ -22,15 +22,11 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup uv
- name: Setup Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
version: "0.5.18"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python-version }}

- name: Install FloPy
run: uv sync --all-extras
Expand Down Expand Up @@ -83,16 +79,13 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup uv
- name: Setup Python
uses: astral-sh/setup-uv@v5
with:
version: "0.5.18"
cache-dependency-glob: "**/pyproject.toml"

- name: Setup Python
uses: actions/setup-python@v5

- name: Install Python dependencies
run: uv pip install numpy pandas matplotlib seaborn
- name: Install FloPy
run: uv sync

- name: Download all artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -129,7 +122,7 @@ jobs:
fi
# process benchmarks
uv run python scripts/process_benchmarks.py $path $path
uv run scripts/process_benchmarks.py $path $path
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: FloPy code generation
name: Code generation
on:
schedule:
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST)
Expand All @@ -23,18 +23,14 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup uv
- name: Setup Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
version: "0.5.18"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python-version }}

- name: Install FloPy
run: uv sync
run: uv sync --extra test

- name: Generate classes
run: uv run python -m flopy.mf6.utils.generate_classes --ref ${{ matrix.ref }} --no-backup
61 changes: 17 additions & 44 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: FloPy continuous integration
name: Commit continuous integration
on:
push:
pull_request:
Expand All @@ -20,26 +20,16 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
version: "0.5.18"

- name: Setup Python
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v5
with:
python-version-file: pyproject.toml

- name: Install Python dependencies
run: |
uv sync --extra build
uv run python -c "import flopy; print(f'{flopy.__version__}')"
enable-cache: false

- name: Build package
run: uv build

- name: Check package
run: uv run twine check --strict dist/*
run: uvx twine check --strict dist/*

lint:
name: Lint
Expand All @@ -53,33 +43,25 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
version: "0.5.18"

- name: Setup Python
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v5
with:
python-version-file: pyproject.toml

- name: Install Python dependencies
run: uv sync --extra lint
enable-cache: false

- name: Lint
run: uv run ruff check .
run: uvx ruff check

- name: Check format
run: uv run ruff format . --check
run: uvx ruff format --check

- name: Check spelling
run: uv run codespell
run: uvx codespell

- name: Check CITATION.cff
run: |
uv run cffconvert --validate
uv run cffconvert -f apalike
uv run cffconvert -f bibtex
uvx cffconvert --validate
uvx cffconvert -f apalike
uvx cffconvert -f bibtex
smoke:
name: Smoke test
Expand All @@ -95,15 +77,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
version: "0.5.18"

- name: Setup Python
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v5
with:
python-version-file: pyproject.toml
cache-dependency-glob: "**/pyproject.toml"

- name: Install Python dependencies
# temp. allow prereleases for vtk on aarch64
Expand Down Expand Up @@ -149,15 +126,11 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup uv
- name: Setup Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
version: "0.5.18"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python-version }}

- name: Install FloPy
run: uv sync --all-extras
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: FloPy example script & notebook tests
name: Example script & notebook tests

on:
schedule:
Expand Down
45 changes: 15 additions & 30 deletions .github/workflows/mf6.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: FloPy Modflow6 continuous integration
name: Modflow6 continuous integration

on:
schedule:
Expand All @@ -24,23 +24,16 @@ jobs:
- name: Checkout flopy repo
uses: actions/checkout@v4

- name: Setup uv
- name: Setup Python
uses: astral-sh/setup-uv@v5
with:
version: "0.5.18"
cache-dependency-glob: "**/pyproject.toml"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
- name: Install FloPy
run: uv sync --all-extras

- name: Install Python dependencies
run: |
uv sync --all-extras
uv pip install https://github.com/modflowpy/pymake/archive/master.zip
uv pip install https://github.com/Deltares/xmipy/archive/develop.zip
uv pip install https://github.com/MODFLOW-USGS/modflowapi/archive/develop.zip
uv pip install meson ninja
- name: Install other dependencies from GitHub
run: uv pip install -r etc/requirements.mf6.txt

- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@v1
Expand All @@ -63,7 +56,7 @@ jobs:
- name: Update package classes
working-directory: modflow6/autotest
run: uv run python update_flopy.py
run: uv run update_flopy.py

- name: Install executables
working-directory: modflow6/autotest
Expand Down Expand Up @@ -109,24 +102,16 @@ jobs:
repository: MODFLOW-USGS/modflow6-examples
path: modflow6-examples

- name: Setup uv
- name: Setup Python
uses: astral-sh/setup-uv@v5
with:
version: "0.5.18"
cache-dependency-glob: "**/pyproject.toml"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
- name: Install FloPy
run: uv sync --all-extras

- name: Install Python dependencies
run: |
uv sync --all-extras
uv pip install https://github.com/modflowpy/pymake/archive/master.zip
uv pip install https://github.com/Deltares/xmipy/archive/develop.zip
uv pip install https://github.com/MODFLOW-USGS/modflowapi/archive/develop.zip
uv pip install meson ninja
uv pip install -r modflow6-examples/etc/requirements.pip.txt
- name: Install other dependencies from modflow6-examples and GitHub
run: uv pip install -r etc/requirements.mf6.txt -r modflow6-examples/etc/requirements.pip.txt

- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@v1
Expand All @@ -147,7 +132,7 @@ jobs:
- name: Update package classes
working-directory: modflow6/autotest
run: uv run python update_flopy.py
run: uv run update_flopy.py

- name: Test MF6 examples
working-directory: modflow6-examples/autotest
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/optional.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow tests flopy with random subsets of optional dependencies.
# Flopy should not crash due to the absence of any optional dependencies,
# rather it should gracefully raise an ImportError if absent when needed.
name: FloPy optional dependency testing
name: Optional dependency testing
on:
schedule:
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST)
Expand All @@ -27,20 +27,16 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup uv
- name: Setup Python
uses: astral-sh/setup-uv@v5
with:
version: "0.5.18"
cache-dependency-glob: "**/pyproject.toml"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
- name: Install FloPy
run: uv sync --extra test

- name: Install Python dependencies
- name: Install other dependencies
run: |
uv sync --extra test
# Install optional dependencies according to matrix.optdeps.
# If matrix.optdeps is "some" remove 3 optional dependencies
# selected randomly using the current date as the seed.
Expand Down
Loading

0 comments on commit a2f6002

Please sign in to comment.