Feature/modernization uv migration#46
Merged
Merged
Conversation
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 #29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.