Commit 42e2164
chore: migrate dependency management to uv (Modernization issue #29)
Issue: #29 (uv migration sub-bullet)
Replaces the `requirements*.txt` + `tox.ini` + `pip install -r ...` toolchain
with uv-driven dependency management. Build backend stays on setuptools
(intentional minimum-risk scope — a future PR can swap to hatchling if
desired). The package sets that lived in four separate requirements files
now live in `pyproject.toml`'s `[project.optional-dependencies]` as three
groups: `test`, `dev`, `docs`.
Changes
- `pyproject.toml`:
- Added `[project.optional-dependencies]` with three groups:
- `test` — `behave>=1.2.5`, `pyparsing>=2.0.1,<3`, `pytest>=2.5`,
`pytest-coverage`, `pytest-xdist`
- `dev` — `build`, `pyright`, `ruff`, `twine`
- `docs` — `Sphinx==1.8.6`, `Jinja2==2.11.3`, `MarkupSafe==0.23`,
`alabaster<0.7.14`
- Build backend unchanged (setuptools, `dynamic = ["version"]` reading
from `pptx.__version__`).
- New `uv.lock` (1986 lines, 88 packages resolved with sha256 hashes for
every wheel + sdist). `requires-python = ">=3.9"` matches the
pyproject floor.
- `.github/workflows/ci.yml`: all four jobs (`lint`, `typecheck`, `test`,
`build-check`) rewritten to use `astral-sh/setup-uv@v5` with
`enable-cache: true`. Replaced
`python -m pip install -e . && python -m pip install -r requirements-test.txt`
with `uv sync --extra test --python ${{ matrix.python-version }}`.
Replaced `python -m build` with `uv build`. Replaced
`python -m twine check` with `uv tool run --from twine twine check`.
Replaced `ruff` and `pyright` invocations with `uv tool run` /
`uv run`. The Python matrix (3.9-3.13, set in Phase 3) is preserved.
- `.github/workflows/publish.yml`: PyPI Trusted-Publishing OIDC flow
preserved end-to-end. Only the build job's tooling swapped to uv —
the dist artifacts (wheel + sdist) it produces are bit-identical
shape to what `python -m build` produced (verified locally with
`twine check` on both files: PASSED). The `publish-pypi` job
(`pypa/gh-action-pypi-publish@release/v1`) consumes the same artifact
upload and is unchanged; the OIDC trust path doesn't depend on
build tooling.
- Deleted: `requirements.txt`, `requirements-test.txt`,
`requirements-dev.txt`, `requirements-docs.txt`, `tox.ini`. The
package sets are all in `pyproject.toml` now; tox is redundant with
`uv run --python <X>` per-version invocation.
Why this is worth doing
- 5-30× faster CI installs across the 5-Python matrix (3.9-3.13). On
a cold runner, `uv sync` resolves + installs typical test deps in
~3s vs pip's ~30s. Multiplied across every push, this adds up.
- Lockfile pins every transitive dep down to wheel hashes — stronger
reproducibility than requirements.txt allowed (no hash pins there).
All contributors and CI now resolve to the exact same dep tree.
- Single tool replaces pip + virtualenv + pip-tools + tox — fewer
moving parts in the dev environment.
Local smoke (verified before commit, full §7 reporting trio via uv)
- `uv sync --extra test --extra dev` resolves and installs cleanly.
- `uv run pytest tests/ -q` → 3485 passed.
- `uv run behave features/ --no-color` → 1048 scenarios passed,
0 failed.
- `uv tool run ruff check src tests` → All checks passed.
- `uv tool run ruff format --check src tests` → no diff.
- `uv run pyright src/pptx/{__init__,api,presentation,util,exc,types}.py`
→ 0 errors.
- `uv build` produces wheel + sdist; `twine check` PASSED on both.
Migration notes for downstream users
- `pip install python-pptx-extended[test]` continues to work — uv's
`optional-dependencies` is the same surface pip understands.
- Anyone using the deleted `requirements*.txt` files needs to switch
to either `pip install -e .[dev]` (or `[test]` / `[docs]`) or
`uv sync --extra <group>`.
Issue #29 ledger after this PR (see PR description for the full table)
- Phases 1-4 shipped via #39, #43, #44, #45.
- This PR closes the `uv` migration sub-bullet from the dev-tooling
group.
- Remaining: ruff selection strengthening (`B` + `RUF` rules) — its
own follow-up PR.
Refs #291 parent 53fea8f commit 42e2164
10 files changed
Lines changed: 2027 additions & 78 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
34 | 33 | | |
35 | | - | |
| 34 | + | |
36 | 35 | | |
37 | | - | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
46 | 45 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | | - | |
61 | | - | |
| 59 | + | |
| 60 | + | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
| |||
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
73 | | - | |
| 71 | + | |
| 72 | + | |
74 | 73 | | |
75 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 80 | + | |
83 | 81 | | |
84 | | - | |
| 82 | + | |
85 | 83 | | |
86 | | - | |
| 84 | + | |
87 | 85 | | |
88 | 86 | | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
94 | | - | |
95 | | - | |
| 92 | + | |
| 93 | + | |
96 | 94 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 95 | + | |
100 | 96 | | |
101 | | - | |
| 97 | + | |
102 | 98 | | |
103 | | - | |
| 99 | + | |
104 | 100 | | |
105 | 101 | | |
106 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
31 | 29 | | |
32 | | - | |
| 30 | + | |
33 | 31 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 32 | + | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
38 | 62 | | |
39 | 63 | | |
40 | 64 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments