Skip to content

Commit

Permalink
chore: add support for Python 3.13 (#712)
Browse files Browse the repository at this point in the history
* add python 3.13 to ci.yml

* allow lxml 5

* add minimal pandas version for py3.13

* updated numpy dependency and lockfile

* updated poetry lockfile

* updated workflow files and sonar properties to python 3.13
  • Loading branch information
veenstrajelmer authored Jan 9, 2025
1 parent 93573a3 commit f4e77e8
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 157 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.11", "3.12"]
python-version: ["3.9", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Run image
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.8.3
poetry-version: 1.8.4
- name: Cache Poetry virtualenv
uses: actions/cache@v4
id: cache
Expand All @@ -49,7 +49,7 @@ jobs:
run: poetry run pytest --cov . --cov-report xml:coverage-reports/coverage-hydrolib-core.xml --junitxml=xunit-reports/xunit-result-hydrolib-core.xml

- name: Autoformat code if the check fails
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == 3.12) }}
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == 3.13) }}
run: |
poetry run isort .
poetry run black .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: 3.13

- name: Run image
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.8.3
poetry-version: 1.8.4
- name: Cache Poetry virtualenv
uses: actions/cache@v4
id: cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: 3.13

- name: Run image
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.8.3
poetry-version: 1.8.4
- name: Cache Poetry virtualenv
uses: actions/cache@v4
id: cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.12]
python-version: [3.13]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Run image
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.8.3
poetry-version: 1.8.4

- name: Cache Poetry virtualenv
uses: actions/cache@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: 3.13

- name: Run image
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.8.3
poetry-version: 1.8.4

- name: Cache Poetry virtualenv
uses: actions/cache@v4
Expand Down
350 changes: 206 additions & 144 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ python = "^3.9"
# exclude yanked netcdf versions 1.7.0 and 1.7.1, but include 1.7.2 (first with python 3.12 support)
netCDF4 = "^1.5,!=1.7.0,!=1.7.1"
# no caret here, since numpy v2 is required for future python 3.13 support, but this is not yet widely supported by packages numpy v1 support is also still required.
numpy = ">=1.25,<3"
numpy = [
{ version = ">=1.25,<3", python = "^3.9" },
{ version = "^2.1", python = "^3.13" }
]
pydantic = "^2.5"
# lxml 5.0 is from December 2023
lxml = "^5.0"
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ sonar.organization=deltares
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8

sonar.python.version=3.9, 3.10, 3.11, 3.12
sonar.python.version=3.9, 3.10, 3.11, 3.12, 3.13

0 comments on commit f4e77e8

Please sign in to comment.