Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
veenstrajelmer committed Oct 23, 2024
2 parents 159f316 + 1ef664e commit 3190a32
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 47 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Run image
uses: abatilo/actions-poetry@v2
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.8.2
poetry-version: 1.8.3
- name: Cache Poetry virtualenv
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: ~/.virtualenvs
Expand All @@ -40,11 +40,16 @@ jobs:
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'

- name: list env contents
run: |
poetry show
pip list
- name: Test with pytest
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.8) }}
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == 3.12) }}
run: |
poetry run isort .
poetry run black .
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: 1.4.0
poetry-version: 1.8.3
- name: Cache Poetry virtualenv
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: ~/.virtualenvs
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docs_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: 1.4.0
poetry-version: 1.8.3
- name: Cache Poetry virtualenv
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: ~/.virtualenvs
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.9]
python-version: [3.12]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: 1.4.0
poetry-version: 1.8.3

- name: Cache Poetry virtualenv
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: ~/.virtualenvs
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: 1.4.0
poetry-version: 1.8.3

- name: Cache Poetry virtualenv
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: ~/.virtualenvs
key: venv-ubuntu-latest-3.8-${{ hashFiles('**/poetry.lock') }}
key: venv-ubuntu-latest-${{ hashFiles('**/poetry.lock') }}

- name: Set Poetry config
run: |
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ When starting development on a branch, a pull request should be created for revi
In the description text area on GitHub, use a [closing keyword](https://docs.github.com/articles/closing-issues-using-keywords) such that this PR will be automatically linked to the issue.
For example: `Fixes #160`.

During continuous integration, the checks will be run with python 3.8, 3.9 and 3.12 on Windows, Ubuntu and MacOS. The checks consist of running the tests, checking the code formatting and running SonarCloud.
During continuous integration, the checks will be run with several Python versions on Windows, Ubuntu and MacOS. The checks consist of running the tests, checking the code formatting and running SonarCloud.
We advise to use a draft pull request, to prevent the branch to be merged back before developement is finished. When the branch is ready for review, you can update the status of the pull request to "ready for review".

### Reviews
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pip install hydrolib-core

If you want to create a fresh test environment for hydrolib-core, you could use the following command (only once):
``` bash
conda create -n hydrolib python=3.8 -c conda-forge
conda create -n hydrolib python=3.12 -c conda-forge
```
Prior to the `pip install`, first activate the desired environment:
``` bash
Expand Down
37 changes: 20 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,44 @@ homepage = "https://deltares.github.io/HYDROLIB-core"
"issue tracker" = "https://github.com/Deltares/HYDROLIB-core/issues"

[tool.poetry.dependencies]
python = "^3.8"
netCDF4 = "^1.5,!=1.7.*"
numpy = [
{ version = "^1.21", python = "^3.8" },
{ version = "^1.25", python = "^3.12" }
]
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"
pydantic = "^2.5"
lxml = ">=4.6"
meshkernel = "^4.2.0"
# lxml 5.0 is from December 2023
lxml = "^5.0"
meshkernel = "^5.0.1"
strenum = "^0"

[tool.poetry.dev-dependencies]
pytest = "^6.2"
pytest = "^8.0"
pytest-cov = "^5.0"
black = "^24.3"
isort = "^5.8"
devtools = "^0.6.1"
mkdocs = "^1.2"
mkdocs-material = "^8.0"
mkdocstrings = "^0.16"
mkdocs-autorefs = "^0.3, !=0.3.1"
mkdocs-macros-plugin = "^0.6.3"
pytest-cov = "^2.11"
mkdocs-table-reader-plugin = "^0.6.1"
mkdocs-jupyter = "^0.21.0"
pymdown-extensions = "^9.1"
commitizen = "^2.17"
flake8 = "^3.9.2"
mypy = "^0.910"
devtools = "^0.6.1"
matplotlib = "^3.4"
mkdocs-table-reader-plugin = "^0.6.1"
openpyxl = "^3.0.9"
mike = "^1.1.2"
jinja2 = "<4"
jinja2 = "^3.0"
markupsafe = "<2.1"
mkdocs-jupyter = "^0.21.0"
jupyter = "^1.0.0"
ipykernel = "^6.15.0"
xarray = ">=2023.0.0"
# matplotlib >=3.8 supports numpy 2.0
matplotlib = "^3.8"
# xarray >=2024.6.0 supports numpy 2.0, but consider looser version if adding it as actual package dependencies
xarray = ">=2024.6.0"
# add minimal pandas version for python 3.13 to prevent 2.0.3 to be installed by poetry
# if we do not combine it with the minimal version for py3.8 poetry tries to install
# pandas 2.2.3 for python 3.8 which will naturally fail. The >=1.3 dep comes from xarray.
Expand All @@ -73,7 +75,7 @@ changelog_file = "docs/changelog.md"

[tool.black]
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311']
target-version = ['py39', 'py310', 'py311', 'py312']
exclude = '''
(
/(
Expand All @@ -99,6 +101,7 @@ line_length = 88

[tool.pytest.ini_options]
markers = ["plots", "docker"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
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.8, 3.9
sonar.python.version=3.9, 3.10, 3.11, 3.12
2 changes: 2 additions & 0 deletions tests/dflowfm/test_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,10 @@ def test_create_2d_multiple_grids():
[
(DeleteMeshOption.INSIDE_NOT_INTERSECTED, False, 22, 68, 13),
(DeleteMeshOption.INSIDE_AND_INTERSECTED, False, 30, 98, 20),
(DeleteMeshOption.FACES_WITH_INCLUDED_CIRCUMCENTERS, False, 28, 90, 18),
(DeleteMeshOption.INSIDE_NOT_INTERSECTED, True, 33, 100, 19),
(DeleteMeshOption.INSIDE_AND_INTERSECTED, True, 20, 62, 12),
(DeleteMeshOption.FACES_WITH_INCLUDED_CIRCUMCENTERS, True, 23, 72, 14),
],
)
def test_create_clip_2d(deletemeshoption, inside, nnodes, nedgenodes, nfaces):
Expand Down

0 comments on commit 3190a32

Please sign in to comment.