From 32d348bcb00a2264688d7823cab8a2961efd03fc Mon Sep 17 00:00:00 2001 From: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Date: Fri, 19 May 2023 14:46:27 +0200 Subject: [PATCH] CI: Fix setting of Python version (#230) Unfortunately, the mamba action only reports a warning when using invalid parameters. So setting the Python version never worked. --- .github/workflows/core_tests.yml | 3 +- .github/workflows/docs.yml | 7 ++-- .github/workflows/python_lint.yml | 46 ++++++------------------ .github/workflows/python_tests.yml | 9 ++--- environment.yml | 2 +- python/ribasim_testmodels/pyproject.toml | 2 +- 6 files changed, 21 insertions(+), 48 deletions(-) diff --git a/.github/workflows/core_tests.yml b/.github/workflows/core_tests.yml index 22246f023..a22a1428e 100644 --- a/.github/workflows/core_tests.yml +++ b/.github/workflows/core_tests.yml @@ -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 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 22d42aef5..8f651cb85 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 @@ -20,8 +20,6 @@ jobs: matrix: julia_version: - "1.9" - python_version: - - "3.11" arch: - x64 steps: @@ -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 diff --git a/.github/workflows/python_lint.yml b/.github/workflows/python_lint.yml index 5e077afab..0c9120b07 100644 --- a/.github/workflows/python_lint.yml +++ b/.github/workflows/python_lint.yml @@ -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 @@ -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 diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index d551de525..8843b6e74 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -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: @@ -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 diff --git a/environment.yml b/environment.yml index f70876ea5..f2659e404 100644 --- a/environment.yml +++ b/environment.yml @@ -21,7 +21,7 @@ dependencies: - pydantic - pyogrio - pytest - - python>3.9 + - python>=3.9 - ruff - shapely>=2.0 - tomli diff --git a/python/ribasim_testmodels/pyproject.toml b/python/ribasim_testmodels/pyproject.toml index fc2a8b41a..544fbd824 100644 --- a/python/ribasim_testmodels/pyproject.toml +++ b/python/ribasim_testmodels/pyproject.toml @@ -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"]