Skip to content

Commit 2999a3f

Browse files
Callum027Callum Dickinson
andauthored
Update package dependencies and requirements (#4)
* Switch from PDM to `uv`. * Add Poe the Poet to replace PDM scripts, which `uv` does not provide equivalent functionality for yet. * Remove support for Python 3.8 and 3.9. Python 3.10 is now the minimum supported version. * Update Ruff and Mypy to the latest versions. * Run the pre-commit hooks against all supported Python versions in the CI, because Mypy can only test against one Python version at a time. * Fix some deprecations and configuration issues in `pyproject.toml`. * Minor code changes in accordance with updates in Ruff. Co-authored-by: Callum Dickinson <[email protected]>
1 parent edc0f19 commit 2999a3f

File tree

15 files changed

+1026
-1078
lines changed

15 files changed

+1026
-1078
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
publish-github-pages:
12-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1313
permissions:
1414
contents: write
1515
steps:
@@ -21,14 +21,18 @@ jobs:
2121
run: |
2222
git config --global user.name "${GITHUB_ACTOR}"
2323
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
24-
- name: Setup Python and PDM
25-
uses: pdm-project/setup-pdm@v4
24+
- name: Setup Python
25+
uses: actions/setup-python@v6
2626
with:
27-
python-version: "3.12"
28-
version: "2.16.1"
27+
python-version: "3.14"
28+
cache: "pip"
29+
- name: Setup uv
30+
uses: astral-sh/setup-uv@v7
31+
with:
32+
version: "0.9.2"
2933
- name: Create virtual environment
30-
run: pdm install
34+
run: uv sync --only-dev
3135
- name: Publish the docs to GitHub Pages
32-
run: pdm run mike deploy --push develop
36+
run: uv run mike deploy --push develop
3337
- name: List available docs versions
34-
run: pdm run mike list
38+
run: uv run mike list

.github/workflows/tag.yml

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---
2+
13
name: tag
24

35
on:
@@ -7,19 +9,23 @@ on:
79

810
jobs:
911
build:
10-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1113
steps:
1214
- name: Clone full tree, and checkout tag
13-
uses: actions/checkout@v4
15+
uses: actions/checkout@v5
1416
with:
1517
fetch-depth: 0
16-
- name: Setup Python and PDM
17-
uses: pdm-project/setup-pdm@v4
18+
- name: Setup Python
19+
uses: actions/setup-python@v6
1820
with:
19-
python-version: "3.12"
20-
version: "2.16.1"
21+
python-version: "3.14"
22+
cache: "pip"
23+
- name: Setup uv
24+
uses: astral-sh/setup-uv@v7
25+
with:
26+
version: "0.9.2"
2127
- name: Build source dist and wheels
22-
run: pdm build --verbose
28+
run: uv build
2329
- name: Upload source dist and wheels to artifacts
2430
uses: actions/upload-artifact@v4
2531
with:
@@ -30,36 +36,40 @@ jobs:
3036

3137
publish-pypi:
3238
needs: build
33-
runs-on: ubuntu-22.04
39+
runs-on: ubuntu-24.04
3440
environment: pypi
3541
permissions:
3642
id-token: write
3743
steps:
3844
- name: Clone full tree, and checkout tag
39-
uses: actions/checkout@v4
45+
uses: actions/checkout@v5
4046
with:
4147
fetch-depth: 0
4248
- name: Download source dist and wheels from artifacts
4349
uses: actions/download-artifact@v4
4450
with:
4551
name: dist
4652
path: dist/
47-
- name: Setup Python and PDM
48-
uses: pdm-project/setup-pdm@v4
53+
- name: Setup Python
54+
uses: actions/setup-python@v6
4955
with:
50-
python-version: "3.12"
51-
version: "2.16.1"
56+
python-version: "3.14"
57+
cache: "pip"
58+
- name: Setup uv
59+
uses: astral-sh/setup-uv@v7
60+
with:
61+
version: "0.9.2"
5262
- name: Publish source dist and wheels to PyPI
53-
run: pdm publish --no-build --verbose
63+
run: uv publish
5464

5565
publish-github-release:
5666
needs: build
57-
runs-on: ubuntu-22.04
67+
runs-on: ubuntu-24.04
5868
permissions:
5969
contents: write
6070
steps:
6171
- name: Clone and checkout tag
62-
uses: actions/checkout@v4
72+
uses: actions/checkout@v5
6373
- name: Download source dist and wheels from artifacts
6474
uses: actions/download-artifact@v4
6575
with:
@@ -79,7 +89,7 @@ jobs:
7989
fail_on_unmatched_files: true
8090

8191
publish-github-pages:
82-
runs-on: ubuntu-22.04
92+
runs-on: ubuntu-24.04
8393
permissions:
8494
contents: write
8595
steps:
@@ -91,14 +101,18 @@ jobs:
91101
run: |
92102
git config --global user.name "${GITHUB_ACTOR}"
93103
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
94-
- name: Setup Python and PDM
95-
uses: pdm-project/setup-pdm@v4
104+
- name: Setup Python
105+
uses: actions/setup-python@v6
106+
with:
107+
python-version: "3.14"
108+
cache: "pip"
109+
- name: Setup uv
110+
uses: astral-sh/setup-uv@v7
96111
with:
97-
python-version: "3.12"
98-
version: "2.16.1"
112+
version: "0.9.2"
99113
- name: Create virtual environment
100-
run: pdm install
114+
run: uv sync --only-dev
101115
- name: Publish the docs to GitHub Pages
102-
run: pdm run mike deploy --push --update-aliases ${{ github.ref_name }} latest
116+
run: uv run mike deploy --push develop
103117
- name: List available docs versions
104-
run: pdm run mike list
118+
run: uv run mike list

.github/workflows/test.yml

Lines changed: 25 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---
2+
13
name: test
24

35
on:
@@ -8,107 +10,49 @@ on:
810

911
jobs:
1012
pre-commit:
11-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
14+
strategy:
15+
matrix:
16+
python_version:
17+
- "3.10"
18+
- "3.11"
19+
- "3.12"
20+
- "3.13"
21+
- "3.14"
1222
steps:
1323
- name: Clone and checkout branch
14-
uses: actions/checkout@v4
24+
uses: actions/checkout@v5
1525
- name: Setup Python
16-
uses: actions/setup-python@v5
26+
uses: actions/setup-python@v6
1727
with:
18-
python-version: "3.12"
28+
python-version: "${{ matrix.python_version }}"
1929
cache: "pip"
2030
- name: Run pre-commit hooks
2131
uses: pre-commit/[email protected]
2232

2333
build:
2434
needs: pre-commit
25-
runs-on: ubuntu-22.04
35+
runs-on: ubuntu-24.04
2636
steps:
2737
- name: Clone full tree, and checkout branch
28-
uses: actions/checkout@v4
38+
uses: actions/checkout@v5
2939
with:
3040
fetch-depth: 0
31-
- name: Setup Python and PDM
32-
uses: pdm-project/setup-pdm@v4
41+
- name: Setup Python
42+
uses: actions/setup-python@v6
43+
with:
44+
python-version: "3.14"
45+
cache: "pip"
46+
- name: Setup uv
47+
uses: astral-sh/setup-uv@v7
3348
with:
34-
python-version: "3.12"
35-
version: "2.16.1"
49+
version: "0.9.2"
3650
- name: Build source dist and wheels
37-
run: pdm build --verbose
51+
run: uv build
3852
- name: Upload source dist and wheels to artifacts
3953
uses: actions/upload-artifact@v4
4054
with:
4155
name: dist
4256
path: dist/
4357
retention-days: 5
4458
if-no-files-found: error
45-
46-
# test:
47-
# needs: pre-commit
48-
# permissions:
49-
# checks: write
50-
# strategy:
51-
# fail-fast: false
52-
# matrix:
53-
# operating_system:
54-
# - ubuntu-22.04
55-
# - windows-2022
56-
# python_version:
57-
# - "3.8"
58-
# - "3.9"
59-
# - "3.10"
60-
# - "3.11"
61-
# - "3.12"
62-
# runs-on: ${{ matrix.operating_system }}
63-
# steps:
64-
# - name: Clone full tree, and checkout branch
65-
# uses: actions/checkout@v4
66-
# with:
67-
# fetch-depth: 0
68-
# - name: Setup Python and PDM
69-
# uses: pdm-project/setup-pdm@v4
70-
# with:
71-
# python-version: ${{ matrix.python_version }}
72-
# version: "2.16.1"
73-
# - name: Create virtual environment
74-
# run: pdm install
75-
# - name: Run tests
76-
# run: pdm run test
77-
# - name: Publish test results
78-
# uses: mikepenz/action-junit-report@v4
79-
# # Always run, even if the tests fail.
80-
# if: success() || failure()
81-
# with:
82-
# report_paths: rspec.xml
83-
# - name: Upload coverage report to artifacts
84-
# uses: actions/upload-artifact@v4
85-
# # Always run, even if the tests fail.
86-
# if: success() || failure()
87-
# with:
88-
# name: coverage-${{ matrix.operating_system}}-${{ matrix.python_version }}
89-
# path: coverage.xml
90-
# retention-days: 5
91-
# if-no-files-found: warn
92-
93-
# coverage:
94-
# needs: test
95-
# # Always run, even if the test job failed.
96-
# if: success() || failure()
97-
# runs-on: ubuntu-22.04
98-
# steps:
99-
# - name: Download coverage reports from artifacts
100-
# uses: actions/download-artifact@v4
101-
# with:
102-
# pattern: coverage-*
103-
# merge-multiple: false
104-
# - name: Generate code coverage summary report
105-
# uses: irongut/[email protected]
106-
# with:
107-
# filename: coverage-*/coverage.xml
108-
# format: markdown
109-
# hide_branch_rate: false
110-
# hide_complexity: false
111-
# indicators: false
112-
# output: both
113-
# - name: Write to job summary
114-
# run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)