Skip to content

Commit 0e5599c

Browse files
authored
Merge pull request #12 from dnv-opensource/maintenance-update
Maintenance update
2 parents 0c57646 + 70ff93b commit 0e5599c

File tree

85 files changed

+11776
-8585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+11776
-8585
lines changed

.github/workflows/_build_and_publish_documentation.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout active branch
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v5
1717
with:
1818
lfs: true
1919
- name: Install uv
20-
uses: astral-sh/setup-uv@v5
20+
uses: astral-sh/setup-uv@v7
2121
with:
2222
enable-cache: true
23-
cache-dependency-glob: "uv.lock"
24-
- name: Set up Python
25-
uses: actions/setup-python@v5
26-
with:
27-
python-version-file: "pyproject.toml"
23+
cache-dependency-glob: 'uv.lock'
2824
- name: Install the project
29-
run: uv sync --upgrade
25+
run: uv sync --frozen
3026
- name: Print debugging information
3127
run: |
3228
echo "github.ref:" ${{github.ref}}

.github/workflows/_build_package.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ jobs:
77
name: Build source distribution
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v4
10+
- name: Checkout code
11+
uses: actions/checkout@v5
1112
with:
1213
lfs: true
1314
- name: Install uv
14-
uses: astral-sh/setup-uv@v5
15+
uses: astral-sh/setup-uv@v7
1516
with:
1617
enable-cache: true
17-
cache-dependency-glob: "uv.lock"
18-
- uses: actions/setup-python@v5
19-
with:
20-
python-version-file: "pyproject.toml"
21-
- name: Build source distribution and wheel
18+
cache-dependency-glob: 'uv.lock'
19+
- name: Build source distribution and wheels
2220
run: uv build
23-
- name: Run twine check
21+
- name: Check build artifacts
2422
run: uvx twine check --strict dist/*
25-
- uses: actions/upload-artifact@v4
23+
- name: Upload build artifacts
24+
uses: actions/upload-artifact@v5
2625
with:
26+
name: dist
2727
path: |
2828
dist/*.tar.gz
2929
dist/*.whl

.github/workflows/_code_quality.yml

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,74 +7,62 @@ jobs:
77
runs-on: ubuntu-latest
88
name: ruff format
99
steps:
10-
- uses: actions/checkout@v4
10+
- name: Checkout code
11+
uses: actions/checkout@v5
1112
- name: Install uv
12-
uses: astral-sh/setup-uv@v5
13+
uses: astral-sh/setup-uv@v7
1314
with:
1415
enable-cache: true
15-
cache-dependency-glob: "uv.lock"
16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version-file: "pyproject.toml"
16+
cache-dependency-glob: 'uv.lock'
2017
- name: Install the project
21-
run: uv sync --upgrade
18+
run: uv sync -U
2219
- name: Run ruff format
2320
run: uv run ruff format --diff
2421

2522
ruff_check:
2623
runs-on: ubuntu-latest
2724
name: ruff check
2825
steps:
29-
- uses: actions/checkout@v4
26+
- name: Checkout code
27+
uses: actions/checkout@v5
3028
- name: Install uv
31-
uses: astral-sh/setup-uv@v5
29+
uses: astral-sh/setup-uv@v7
3230
with:
3331
enable-cache: true
34-
cache-dependency-glob: "uv.lock"
35-
- name: Set up Python
36-
uses: actions/setup-python@v5
37-
with:
38-
python-version-file: "pyproject.toml"
32+
cache-dependency-glob: 'uv.lock'
3933
- name: Install the project
40-
run: uv sync --upgrade
34+
run: uv sync -U
4135
- name: Run ruff check
4236
run: uv run ruff check --diff
4337

4438
pyright:
4539
runs-on: ubuntu-latest
4640
name: pyright
4741
steps:
48-
- uses: actions/checkout@v4
42+
- name: Checkout code
43+
uses: actions/checkout@v5
4944
- name: Install uv
50-
uses: astral-sh/setup-uv@v5
45+
uses: astral-sh/setup-uv@v7
5146
with:
5247
enable-cache: true
53-
cache-dependency-glob: "uv.lock"
54-
- name: Set up Python
55-
uses: actions/setup-python@v5
56-
with:
57-
python-version-file: "pyproject.toml"
48+
cache-dependency-glob: 'uv.lock'
5849
- name: Install the project
59-
run: uv sync --upgrade
50+
run: uv sync -U
6051
- name: Run pyright
6152
run: uv run pyright
6253

6354
mypy:
6455
runs-on: ubuntu-latest
6556
name: mypy
6657
steps:
67-
- uses: actions/checkout@v4
58+
- name: Checkout code
59+
uses: actions/checkout@v5
6860
- name: Install uv
69-
uses: astral-sh/setup-uv@v5
61+
uses: astral-sh/setup-uv@v7
7062
with:
7163
enable-cache: true
72-
cache-dependency-glob: "uv.lock"
73-
- name: Set up Python
74-
uses: actions/setup-python@v5
75-
with:
76-
python-version-file: "pyproject.toml"
64+
cache-dependency-glob: 'uv.lock'
7765
- name: Install the project
78-
run: uv sync --upgrade
66+
run: uv sync -U
7967
- name: Run mypy
8068
run: uv run mypy

.github/workflows/_merge_into_release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
environment: release
1414
steps:
15-
- uses: actions/checkout@v4
15+
- name: Checkout code
16+
uses: actions/checkout@v5
1617
with:
1718
# Fetch the whole history to prevent unrelated history errors
1819
fetch-depth: 0

.github/workflows/_test.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,23 @@ on: workflow_call
44

55
jobs:
66
test:
7-
name: Test on ${{matrix.python.version}}-${{matrix.platform.runner}}
8-
runs-on: ${{ matrix.platform.runner }}
7+
name: Test (Python ${{ matrix.python }}, ${{ matrix.os }})
8+
runs-on: ${{ matrix.os }}
99
strategy:
10-
fail-fast: true
10+
fail-fast: false
1111
matrix:
12-
platform:
13-
- runner: ubuntu-latest
14-
- runner: windows-latest
15-
# - runner: macos-latest
16-
python:
17-
- version: '3.10'
18-
- version: '3.11'
19-
- version: '3.12'
20-
# - version: '3.13'
12+
os: [ubuntu-latest, windows-latest]
13+
python: ['3.11', '3.12', '3.13', '3.14']
2114
steps:
22-
- uses: actions/checkout@v4
15+
- name: Checkout code
16+
uses: actions/checkout@v5
2317
- name: Install uv
24-
uses: astral-sh/setup-uv@v5
18+
uses: astral-sh/setup-uv@v7
2519
with:
26-
enable-cache: false
27-
cache-dependency-glob: "uv.lock"
28-
- name: Install Python ${{ matrix.python.version }}
29-
uses: actions/setup-python@v5
30-
with:
31-
python-version: ${{ matrix.python.version }}
20+
enable-cache: true
21+
cache-dependency-glob: 'uv.lock'
3222
- name: Install the project
33-
run: uv sync -p ${{ matrix.python.version }} -U --no-dev
23+
run: uv sync -p ${{ matrix.python }} -U --no-dev --extra test
3424
- name: Run pytest
3525
run: >
3626
uv run --with pytest --with pytest-cov

.github/workflows/_test_future.yml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,41 @@
1-
name: Unit Tests (py313)
2-
# Test also with Python 3.13 (experimental; workflow will not fail on error.)
1+
name: Unit Tests (py315)
2+
# Test also with Python 3.15 (experimental; workflow will not fail on error.)
33

44
on: workflow_call
55

66
jobs:
7-
test313:
8-
name: Test on ${{matrix.python.version}}-${{matrix.platform.runner}} (experimental)
7+
test315:
8+
name: Test (Python ${{ matrix.python.version }}, ${{ matrix.os }}) (experimental)
99
continue-on-error: true
10-
runs-on: ${{ matrix.platform.runner }}
10+
runs-on: ${{ matrix.os }}
1111
strategy:
12+
fail-fast: true
1213
matrix:
13-
platform:
14-
- runner: ubuntu-latest
15-
- runner: windows-latest
14+
os: [ubuntu-latest, windows-latest]
1615
python:
17-
- version: '3.13.0-alpha - 3.13.0'
18-
uvpy: '3.13'
16+
- version: '3.15.0-alpha - 3.15.0'
17+
uvpy: '3.15'
1918
steps:
20-
- uses: actions/checkout@v4
19+
- name: Checkout code
20+
uses: actions/checkout@v5
2121
- name: Install uv
22-
uses: astral-sh/setup-uv@v5
22+
uses: astral-sh/setup-uv@v7
2323
with:
24-
enable-cache: false
25-
cache-dependency-glob: "uv.lock"
26-
- name: Install Python ${{ matrix.python.version }}
27-
uses: actions/setup-python@v5
28-
with:
29-
python-version: ${{ matrix.python.version }}
24+
enable-cache: true
25+
cache-dependency-glob: 'uv.lock'
26+
- name: Remove Python upper version constraint from pyproject.toml
27+
shell: pwsh
28+
run: |
29+
$File = Get-Item pyproject.toml
30+
$Content = Get-Content $File -Raw
31+
[regex]$RequiresPythonPattern = '(?<!-)(\brequires-python = "\s?[>=]{1,2}\s?\d+\.\d+\.?\d*\.?[\d\w]*\s?)(,\s?[<=]{1,2}\s?\d+\.?\d*\.?\d*\.?[\d\w]*\s?)?(")'
32+
if ($Content -match $RequiresPythonPattern) {
33+
$RequiresPythonFound = $Matches[0]
34+
$RequiresPythonReplacement = $Matches[1] + $Matches[3]
35+
$Content -Replace $RequiresPythonFound, $RequiresPythonReplacement | Set-Content $File -NoNewline
36+
}
3037
- name: Install the project
31-
run: uv sync -p ${{ matrix.python.uvpy }} -U --no-dev
38+
run: uv sync -p ${{ matrix.python.uvpy }} -U --no-dev --extra test
3239
- name: Run pytest
3340
run: >
3441
uv run --with pytest --with pytest-cov

.github/workflows/nightly_build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ run-name: Nightly Build (by @${{ github.actor }})
44
on:
55
schedule:
66
- cron: '30 5 * * *'
7+
workflow_dispatch: # Allow manual trigger
78

89
jobs:
9-
code_quality:
10-
uses: ./.github/workflows/_code_quality.yml
1110
test:
1211
uses: ./.github/workflows/_test.yml
1312
test_future:

.github/workflows/publish_release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ jobs:
1818
permissions:
1919
id-token: write
2020
steps:
21-
- uses: actions/download-artifact@v4
21+
- name: Download build artifacts
22+
uses: actions/download-artifact@v5
2223
with:
23-
name: artifact
24+
name: dist
2425
path: dist
25-
- uses: pypa/gh-action-pypi-publish@release/v1
26+
- name: Publish to PyPI
27+
uses: pypa/gh-action-pypi-publish@release/v1
2628
# with: # Uncomment this line to publish to testpypi
2729
# repository-url: https://test.pypi.org/legacy/ # Uncomment this line to publish to testpypi
2830
merge_into_release:

.github/workflows/pull_request_to_main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- converted_to_draft
1212
branches:
1313
- main
14+
workflow_dispatch: # Allow manual trigger
1415

1516
concurrency:
1617
group: pr-${{ github.ref }}-1

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ ipython_config.py
9191
# It is generally recommended to include `uv.lock` in version control.
9292
# However, in case of collaboration, if having platform-specific dependencies or dependencies
9393
# having no cross-platform support, `uv` might install dependencies in one environment that don't work in another.
94-
# In such case, `uv.lock` should be added to `.gitignore`
94+
# In such case, `uv.lock` should be added to `.gitignore` (and, as such, excluded from version control).
9595
# uv.lock
9696

9797
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm

0 commit comments

Comments
 (0)