Skip to content

Commit 7f5b4d3

Browse files
gijzelaerrclaude
andcommitted
Modernize CI/CD: switch to uv and update Python versions
- Replace pip with uv across all GitHub Actions workflows - Use astral-sh/setup-uv@v5 action for uv installation - Update Python versions: drop 3.9 (EOL Oct 2025), add 3.14 - Update platform images to ubuntu-24.04 where appropriate - Update pyproject.toml: requires-python >= 3.10 - Update tox.ini: py310-py314, use python3.13 for tools - Update CLAUDE.md documentation to reflect new versions Benefits of uv: - Significantly faster package installation - Better dependency resolution - Modern Python packaging tool 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d8a01ba commit 7f5b4d3

14 files changed

Lines changed: 135 additions & 201 deletions

.github/workflows/doc.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,19 @@ on:
66
branches: [master]
77
jobs:
88
build:
9-
runs-on: ubuntu-22.04
9+
runs-on: ubuntu-24.04
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v4
13-
- name: Install Debian packages
14-
run: |
15-
sudo apt-get update -qq
16-
sudo apt-get install -y python3-pip make
1713
- name: Set up Python
1814
uses: actions/setup-python@v5
1915
with:
20-
python-version: 3.12
16+
python-version: "3.13"
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v5
2119
- name: Install dependencies
2220
run: |
23-
python3 -m venv venv
24-
venv/bin/pip install --upgrade pip
25-
venv/bin/pip install ".[doc,cli]"
21+
uv venv venv
22+
uv pip install --python venv/bin/python ".[doc,cli]"
2623
- name: Run doc
27-
run: venv/bin/sphinx-build -N -bhtml doc/ doc/_build -W
24+
run: venv/bin/sphinx-build -N -bhtml doc/ doc/_build -W

.github/workflows/linux-build-test-amd64.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
matrix:
4141
os: ["ubuntu-24.04", "ubuntu-22.04"]
42-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
42+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4343
steps:
4444
- name: Checkout
4545
uses: actions/checkout@v4
@@ -49,6 +49,9 @@ jobs:
4949
with:
5050
python-version: ${{ matrix.python-version }}
5151

52+
- name: Install uv
53+
uses: astral-sh/setup-uv@v5
54+
5255
- name: Download artifacts
5356
uses: actions/download-artifact@v4
5457
with:
@@ -57,10 +60,9 @@ jobs:
5760

5861
- name: Install python-snap7
5962
run: |
60-
python3 -m venv venv
61-
venv/bin/pip install --upgrade pip
62-
venv/bin/pip install pytest
63-
venv/bin/pip install dist/*.whl
63+
uv venv venv
64+
uv pip install --python venv/bin/python pytest
65+
uv pip install --python venv/bin/python dist/*.whl
6466
6567
- name: Run tests
6668
run: |

.github/workflows/linux-build-test-arm64.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-22.04
4242
strategy:
4343
matrix:
44-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
44+
python-version: ["3.10", "3.11", "3.12", "3.13"]
4545
steps:
4646
- name: Checkout
4747
uses: actions/checkout@v4
@@ -64,9 +64,9 @@ jobs:
6464
-v $PWD/dist:/dist \
6565
--platform linux/arm64 \
6666
"arm64v8/python:${{ matrix.python-version }}-bookworm" /bin/bash -s <<EOF
67-
python3 -m venv venv
68-
venv/bin/pip install --upgrade pip
69-
venv/bin/pip install pytest
70-
venv/bin/pip install dist/*.whl
67+
pip install --upgrade pip uv
68+
uv venv venv
69+
uv pip install --python venv/bin/python pytest
70+
uv pip install --python venv/bin/python dist/*.whl
7171
venv/bin/pytest -m "server or util or client or mainloop or partner"
7272
EOF

.github/workflows/linux-test-with-deb.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
build:
99
strategy:
1010
matrix:
11-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
11+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1212
runs-on: ["ubuntu-22.04", "ubuntu-24.04"]
1313
runs-on: ${{ matrix.runs-on }}
1414
steps:
@@ -21,16 +21,16 @@ jobs:
2121
sudo add-apt-repository -y ppa:gijzelaar/snap7
2222
sudo apt-get update -qq
2323
sudo apt-get install -y libsnap7-dev libsnap7-1
24-
- uses: actions/checkout@v4
2524
- name: Set up Python ${{ matrix.python-version }}
2625
uses: actions/setup-python@v5
2726
with:
2827
python-version: ${{ matrix.python-version }}
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v5
2930
- name: Install dependencies
3031
run: |
31-
python3 -m venv venv
32-
venv/bin/pip install --upgrade pip
33-
venv/bin/pip install ".[test]"
32+
uv venv venv
33+
uv pip install --python venv/bin/python ".[test]"
3434
- name: Run pytest
3535
run: |
3636
venv/bin/pytest -m "server or util or client or mainloop"

.github/workflows/mypy.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ on:
66
branches: [master]
77
jobs:
88
build:
9-
runs-on: ubuntu-22.04
9+
runs-on: ubuntu-24.04
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v4
13-
- name: Install Debian packages
14-
run: |
15-
sudo apt-get update -qq
16-
sudo apt-get install -y python3-pip
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.13"
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v5
1719
- name: Run mypy
18-
run: make mypy
20+
run: |
21+
uv venv venv
22+
uv pip install --python venv/bin/python -e ".[test]"
23+
venv/bin/mypy snap7 tests example

.github/workflows/osx-build-test-amd64.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
strategy:
4848
matrix:
4949
os: ["macos-13", "macos-14", "macos-15"]
50-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
50+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
5151

5252
steps:
5353
- name: Checkout
@@ -58,6 +58,9 @@ jobs:
5858
with:
5959
python-version: ${{ matrix.python-version }}
6060

61+
- name: Install uv
62+
uses: astral-sh/setup-uv@v5
63+
6164
- name: Download artifacts
6265
uses: actions/download-artifact@v4
6366
with:
@@ -66,10 +69,9 @@ jobs:
6669

6770
- name: Install python-snap7
6871
run: |
69-
python3 -m venv venv
70-
venv/bin/pip install --upgrade pip
71-
venv/bin/pip install pytest
72-
venv/bin/pip install dist/*.whl
72+
uv venv venv
73+
uv pip install --python venv/bin/python pytest
74+
uv pip install --python venv/bin/python dist/*.whl
7375
7476
- name: Run tests
7577
run: |

.github/workflows/osx-test-with-brew.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
osx_wheel:
99
strategy:
1010
matrix:
11-
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
11+
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
1212
runs-on: ["macos-13", "macos-14", "macos-15"]
1313

1414
runs-on: ${{ matrix.runs-on }}
@@ -17,11 +17,12 @@ jobs:
1717
uses: actions/checkout@v4
1818
- name: Install snap7
1919
run: brew install --overwrite snap7 python@${{ matrix.python-version }}
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
2022
- name: Install python-snap7
2123
run: |
22-
python${{ matrix.python-version }} -m venv venv
23-
venv/bin/python3 -m pip install --upgrade pip setuptools
24-
venv/bin/python3 -m pip install -e .[test]
24+
uv venv venv --python python${{ matrix.python-version }}
25+
uv pip install --python venv/bin/python -e ".[test]"
2526
- name: Run pytest
2627
run: |
2728
venv/bin/pytest -m "server or util or client or mainloop"

.github/workflows/source-build.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
name: Test with Debian packages
1+
name: Build source distribution
22
on:
33
push:
44
branches: [master]
55
pull_request:
66
branches: [master]
77
jobs:
88
build:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-24.04
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v4
13-
- name: Install Debian packages
14-
run: |
15-
sudo apt-get update -qq
16-
sudo apt-get install -y python3 python3-pip
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.13"
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v5
1719
- name: Install build tools
1820
run: |
19-
python3 -m venv venv
20-
venv/bin/pip install --upgrade pip wheel build setuptools
21+
uv venv venv
22+
uv pip install --python venv/bin/python build
2123
- name: Create source tarball
2224
run: |
2325
venv/bin/python -m build . --sdist

.github/workflows/windows-build-test-amd64.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
strategy:
3535
matrix:
3636
os: [windows-2022, windows-2025]
37-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
37+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
3838
steps:
3939
- name: Checkout
4040
uses: actions/checkout@v4
@@ -44,6 +44,9 @@ jobs:
4444
with:
4545
python-version: ${{ matrix.python-version }}
4646

47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v5
49+
4750
- name: Download artifacts
4851
uses: actions/download-artifact@v4
4952
with:
@@ -57,8 +60,8 @@ jobs:
5760
5861
- name: Install python-snap7
5962
run: |
60-
python3 -m pip install --upgrade pip pytest
61-
python3 -m pip install $(ls dist/*.whl)
63+
uv pip install --system pytest
64+
uv pip install --system $(ls dist/*.whl)
6265
6366
- name: Run pytest
6467
run: |

.github/workflows/windows-test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
runs-on: [ "windows-2022", "windows-2025" ]
12-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
12+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1313
runs-on: ${{ matrix.runs-on }}
1414
steps:
1515
- name: Checkout
@@ -20,6 +20,9 @@ jobs:
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222

23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
25+
2326
- name: Prepare snap7 archive
2427
uses: ./.github/actions/prepare_snap7
2528

@@ -29,7 +32,7 @@ jobs:
2932
Copy-Item snap7-full-1.4.2\release\Windows\Win64\snap7.dll C:\Windows\System32\.
3033
3134
- name: Install python libraries
32-
run: python3.exe -m pip install .[test]
35+
run: uv pip install --system ".[test]"
3336

3437
- name: Run tests
3538
run: python3 -m pytest -m "server or util or client or mainloop or partner"

0 commit comments

Comments
 (0)