Skip to content

Feature/modernization uv migration#46

Merged
MHoroszowski merged 2 commits into
masterfrom
feature/modernization-uv-migration
May 12, 2026
Merged

Feature/modernization uv migration#46
MHoroszowski merged 2 commits into
masterfrom
feature/modernization-uv-migration

Conversation

@MHoroszowski
Copy link
Copy Markdown
Owner

No description provided.

Matthew Horoszowski and others added 2 commits May 8, 2026 14:53
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
@MHoroszowski MHoroszowski merged commit 975fbd6 into master May 12, 2026
8 checks passed
@MHoroszowski MHoroszowski deleted the feature/modernization-uv-migration branch May 12, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant