Skip to content

Commit

Permalink
CI: Fix setting of Python version (#230)
Browse files Browse the repository at this point in the history
Unfortunately, the mamba action only reports a warning when using
invalid parameters.
So setting the Python version never worked.
  • Loading branch information
Hofer-Julian authored May 19, 2023
1 parent 70ae10b commit 32d348b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 48 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/core_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/provision-with-micromamba@v15
with:
python_version: "3.11"
cache-downloads: true
cache-env: true
environment-file: ./environment.yml
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
cancel-in-progress: true
jobs:
publish:
name: Docs Julia ${{ matrix.julia_version }} - Python ${{ matrix.python_version }} - ${{ matrix.arch }}
name: Docs Julia ${{ matrix.julia_version }} - ${{ matrix.arch }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -20,8 +20,6 @@ jobs:
matrix:
julia_version:
- "1.9"
python_version:
- "3.11"
arch:
- x64
steps:
Expand All @@ -47,9 +45,8 @@ jobs:
${{ runner.os }}-test-
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/provision-with-micromamba@v15
with:
python_version: ${{ matrix.python_version }}
cache-downloads: true
cache-env: true
environment-file: ./environment.yml
Expand Down
46 changes: 11 additions & 35 deletions .github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,34 @@ concurrency:
cancel-in-progress: true
jobs:
black:
name: Black Python ${{ matrix.python_version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
name: Black
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os:
- ubuntu-latest
arch:
- x64
python_version:
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/provision-with-micromamba@v15
with:
python_version: ${{ matrix.python_version }}
cache-downloads: true
cache-env: true
environment-file: ./environment.yml

- name: Run black
run: |
black --check python
ruff:
name: Ruff Python ${{ matrix.python_version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
name: Ruff
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os:
- ubuntu-latest
arch:
- x64
python_version:
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/provision-with-micromamba@v15
with:
python_version: ${{ matrix.python_version }}
cache-downloads: true
Expand All @@ -66,24 +50,16 @@ jobs:
mypy:
name: Mypy Python ${{ matrix.python_version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
name: Mypy
runs-on: ubuntu-latest
continue-on-error: true
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
arch:
- x64
python_version:
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/provision-with-micromamba@v15
with:
python_version: ${{ matrix.python_version }}
cache-downloads: true
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true
jobs:
test:
name: Ribasim Python ${{ matrix.python_version }} - ${{ matrix.os }} - ${{ matrix.arch }}
name: Python ${{ matrix.python_version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
defaults:
run:
Expand All @@ -28,17 +28,18 @@ jobs:
- "3.10"
- "3.11"
arch:
- x64
- x86
steps:
- uses: actions/checkout@v3

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/provision-with-micromamba@v15
with:
python_version: ${{ matrix.python_version }}
cache-downloads: true
cache-env: true
environment-file: ./environment.yml
extra-specs: |
python=${{ matrix.python_version }}
- name: Install ribasim
run: pip install --editable python/ribasim
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies:
- pydantic
- pyogrio
- pytest
- python>3.9
- python>=3.9
- ruff
- shapely>=2.0
- tomli
Expand Down
2 changes: 1 addition & 1 deletion python/ribasim_testmodels/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ classifiers = [
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Hydrology",
]
requires-python = ">=3.10"
requires-python = ">=3.9"
dependencies = ["ribasim", "geopandas", "numpy", "pandas"]
dynamic = ["version"]

Expand Down

0 comments on commit 32d348b

Please sign in to comment.