Skip to content

Commit 78005fc

Browse files
committed
chore: migrate to uv and ruff, drop tox/pip
- Manage env and deps with uv; add committed uv.lock - Move test deps into PEP 735 [dependency-groups] dev group - Replace isort/flake8/black with ruff (lint + format) - Remove tox.ini; CI matrix + uv run --python replaces it - Add `make test-all` sweep using isolated per-version .venv-py* envs - Update GitHub workflows: setup-uv with caching, uv sync/run for test+coverage, uv build for release (OIDC publishing unchanged)
1 parent 11a8b5b commit 78005fc

7 files changed

Lines changed: 1253 additions & 109 deletions

File tree

‎.github/workflows/python-release.yml‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1515

16-
- name: Set up Python 3.14
17-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
1818
with:
19-
python-version: "3.14"
20-
21-
- name: Install build requirements
22-
run: python -m pip install wheel build
19+
enable-cache: true
2320

2421
- name: Build package
25-
run: python -m build
22+
run: uv build
2623

2724
- name: Publish package
2825
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0

‎.github/workflows/python-test.yml‎

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1616

17-
- name: Set up Python 3.14
18-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
1919
with:
20-
python-version: "3.14"
21-
22-
- name: Install dependencies
23-
run: pip install tox
20+
enable-cache: true
2421

2522
- name: Validate formatting
26-
run: tox -e format
23+
run: |
24+
uv run ruff check src tests
25+
uv run ruff format --check src tests
2726
2827
test:
2928
runs-on: ${{ matrix.platform }}
@@ -33,10 +32,6 @@ jobs:
3332
matrix:
3433
platform: [ubuntu-latest, macos-latest, windows-latest]
3534
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
36-
# # TODO: Remove Windows exclusion when binary wheel available for lxml
37-
# exclude:
38-
# - { platform: windows-latest, python-version: "3.14" }
39-
4035

4136
steps:
4237
- name: Install system dependencies
@@ -52,18 +47,21 @@ jobs:
5247
5348
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
5449

55-
- name: Set up Python ${{ matrix.python-version }}
56-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
5752
with:
53+
enable-cache: true
5854
python-version: ${{ matrix.python-version }}
5955

6056
- name: Install dependencies
61-
run: |
62-
python -m pip install --upgrade pip
63-
pip install tox tox-gh-actions
64-
65-
- name: Test with tox
66-
run: tox
57+
# xmlsec has no wheels for Windows / Python 3.14, so it is only installed
58+
# on mac/linux for Python <= 3.13 (matching the system deps above).
59+
run: >-
60+
uv sync --frozen --extra async
61+
${{ (matrix.platform != 'windows-latest' && matrix.python-version != '3.14') && '--extra xmlsec' || '' }}
62+
63+
- name: Test with pytest
64+
run: uv run --frozen coverage run --parallel -m pytest
6765
env:
6866
PLATFORM: ${{ matrix.platform }}
6967

@@ -89,15 +87,13 @@ jobs:
8987
merge-multiple: true
9088
path: .
9189

92-
- name: Set up Python 3.14
93-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
90+
- name: Install uv
91+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
9492
with:
95-
python-version: "3.14"
96-
97-
- name: Install dependencies
98-
run: |
99-
python -m pip install --upgrade pip
100-
pip install tox
93+
enable-cache: true
10194

10295
- name: Prepare Coverage report
103-
run: tox -e coverage-report
96+
run: |
97+
uv run --frozen coverage combine
98+
uv run --frozen coverage xml
99+
uv run --frozen coverage report

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ env/
22
*.egg-info
33
*.pyc
44
__pycache__
5-
.tox
65
.coverage
76
.coverage.*
87
.eggs
98
.cache
109
.python-version
1110
.venv
11+
.venv-py*
1212
.idea/
1313
/build/
1414
/dist/

‎Makefile‎

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
.PHONY: install clean test retest coverage docs
1+
.PHONY: install clean test test-all retest coverage docs lint format build
22

33
install:
4-
pip install -e .[docs,test,async]
5-
pip install bumpversion twine wheel
4+
uv sync --extra docs --extra async
65

76
lint:
8-
ruff check src tests
9-
ruff format --check src tests
7+
uv run ruff check src tests
8+
uv run ruff format --check src tests
109

1110
clean:
1211
find . -name '*.pyc' -delete
1312
find . -name '__pycache__' -delete
1413

1514
test:
16-
pytest -vvv
15+
uv run pytest -vvv
16+
17+
test-all:
18+
for v in 3.10 3.11 3.12 3.13 3.14; do \
19+
UV_PROJECT_ENVIRONMENT=.venv-py$$v uv run --python $$v --extra async pytest || exit 1; \
20+
done
1721

1822
retest:
19-
pytest -vvv --lf
23+
uv run pytest -vvv --lf
2024

2125
coverage:
22-
pytest --cov=zeep --cov-report=term-missing --cov-report=html
26+
uv run pytest --cov=zeep --cov-report=term-missing --cov-report=html
2327

2428
format:
25-
ruff check --fix src tests
26-
ruff format src tests
29+
uv run ruff check --fix src tests
30+
uv run ruff format src tests
2731

2832
docs:
2933
$(MAKE) -C docs html
3034

31-
release:
32-
pip install twine wheel
35+
build:
3336
rm -rf build/* dist/*
34-
python setup.py sdist bdist_wheel
35-
twine upload -s dist/*
37+
uv build

‎pyproject.toml‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ Changelog = "https://github.com/mvantellingen/python-zeep/blob/main/CHANGES"
3636

3737
[project.optional-dependencies]
3838
docs = ["sphinx>=1.4.0"]
39-
test = [
39+
async = [
40+
"httpx>=0.15.0",
41+
"packaging",
42+
]
43+
xmlsec = ["xmlsec>=0.6.1"]
44+
45+
[dependency-groups]
46+
dev = [
4047
"coverage[toml]==7.14.1",
4148
"freezegun==1.5.1",
4249
"pretend==1.0.9",
@@ -47,11 +54,6 @@ test = [
4754
"requests_mock==1.12.1",
4855
"ruff==0.15.17",
4956
]
50-
async = [
51-
"httpx>=0.15.0",
52-
"packaging",
53-
]
54-
xmlsec = ["xmlsec>=0.6.1"]
5557

5658
[build-system]
5759
requires = ["setuptools>=40.6.0", "wheel"]

‎tox.ini‎

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)