From 9b6125ab302573e0620b6fa664bfc7a91602a8e2 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Tue, 11 Aug 2026 23:44:40 -0400 Subject: [PATCH 1/3] Use lockless uv workflow for pure Python Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- ...% if add_docs %}docs.yaml{% endif %}.jinja | 2 +- python/pure/.gitignore.jinja | 1 + python/pure/Makefile.jinja | 19 +++++++++---------- python/pure/pyproject.toml.jinja | 9 ++------- .../contribute/Build-from-Source.md.jinja | 4 ++-- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/python/pure/.github/workflows/{% if add_docs %}docs.yaml{% endif %}.jinja b/python/pure/.github/workflows/{% if add_docs %}docs.yaml{% endif %}.jinja index 0c3cb3a..c33b066 100644 --- a/python/pure/.github/workflows/{% if add_docs %}docs.yaml{% endif %}.jinja +++ b/python/pure/.github/workflows/{% if add_docs %}docs.yaml{% endif %}.jinja @@ -44,7 +44,7 @@ jobs: - name: Install from source (manual trigger) run: | - uv pip install .[develop] + uv pip install --group dev -e . uv pip install "yardang[themes]" if: github.event_name == 'workflow_dispatch' diff --git a/python/pure/.gitignore.jinja b/python/pure/.gitignore.jinja index f57991a..8e87447 100644 --- a/python/pure/.gitignore.jinja +++ b/python/pure/.gitignore.jinja @@ -87,6 +87,7 @@ celerybeat.pid # Environments .env .venv +uv.lock env/ venv/ ENV/ diff --git a/python/pure/Makefile.jinja b/python/pure/Makefile.jinja index 699682c..7e7edac 100644 --- a/python/pure/Makefile.jinja +++ b/python/pure/Makefile.jinja @@ -4,15 +4,13 @@ .PHONY: develop build install develop: ## install dependencies and build library - uv pip install -e .[develop] + uv pip install --group dev -e . -requirements: ## install prerequisite python build requirements - python -m pip install --upgrade pip toml - python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))'` - python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print(" ".join(c["project"]["optional-dependencies"]["develop"]))'` +requirements: ## install development dependencies + uv pip install --group dev build: ## build the python library - python -m build -n + uv build install: ## install library uv pip install . @@ -49,7 +47,8 @@ format: fix .PHONY: check-dist check-types checks check check-dist: ## check python sdist and wheel with check-dist - check-dist -v + uv build + check-dist -v --pre-built dist check-types: ## check python types with ty ty check --python $$(which python) @@ -96,10 +95,10 @@ major: ## bump a major version .PHONY: dist dist-build dist-sdist dist-local-wheel publish dist-build: # build python dists - python -m build -w -s + uv build -dist-check: ## run python dist checker with twine - python -m twine check dist/* +dist-check: ## check built python distributions + check-dist -v --pre-built dist dist: clean dist-build dist-check ## build all dists diff --git a/python/pure/pyproject.toml.jinja b/python/pure/pyproject.toml.jinja index 3c7ae3e..d1689ab 100644 --- a/python/pure/pyproject.toml.jinja +++ b/python/pure/pyproject.toml.jinja @@ -37,22 +37,17 @@ classifiers = [ dependencies = [] -[project.optional-dependencies] -develop = [ - "build", +[dependency-groups] +dev = [ "bump-my-version", "check-dist", "codespell", - "hatchling", "mdformat", "mdformat-tables>=1", "pytest", "pytest-cov", "ruff", - "twine", "ty", - "uv", - "wheel", ] [project.scripts] diff --git a/python/pure/{% if add_wiki %}docs{% endif %}/wiki/contribute/Build-from-Source.md.jinja b/python/pure/{% if add_wiki %}docs{% endif %}/wiki/contribute/Build-from-Source.md.jinja index d1afac6..7f324aa 100644 --- a/python/pure/{% if add_wiki %}docs{% endif %}/wiki/contribute/Build-from-Source.md.jinja +++ b/python/pure/{% if add_wiki %}docs{% endif %}/wiki/contribute/Build-from-Source.md.jinja @@ -38,13 +38,13 @@ cd {{ project_name_formatted }} ## Install Python dependencies -Python build and develop dependencies are specified in the `pyproject.toml`, but you can manually install them: +Python development dependencies are specified in the `dev` dependency group in `pyproject.toml`. Install them with `uv`: ```bash make requirements ``` -Note that these dependencies would otherwise be installed normally as part of [PEP517](https://peps.python.org/pep-0517/) / [PEP518](https://peps.python.org/pep-0518/). +Build dependencies are installed separately in an isolated environment as part of [PEP517](https://peps.python.org/pep-0517/) / [PEP518](https://peps.python.org/pep-0518/). ## Build From 75a88dbcdd8891ec760ed925eb65e7dfa42e347f Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Thu, 13 Aug 2026 10:10:27 -0400 Subject: [PATCH 2/3] Preserve published development dependencies Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- .../workflows/{% if add_docs %}docs.yaml{% endif %}.jinja | 2 +- python/pure/Makefile.jinja | 4 ++-- python/pure/pyproject.toml.jinja | 4 ++-- .../wiki/contribute/Build-from-Source.md.jinja | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python/pure/.github/workflows/{% if add_docs %}docs.yaml{% endif %}.jinja b/python/pure/.github/workflows/{% if add_docs %}docs.yaml{% endif %}.jinja index c33b066..f13857b 100644 --- a/python/pure/.github/workflows/{% if add_docs %}docs.yaml{% endif %}.jinja +++ b/python/pure/.github/workflows/{% if add_docs %}docs.yaml{% endif %}.jinja @@ -44,7 +44,7 @@ jobs: - name: Install from source (manual trigger) run: | - uv pip install --group dev -e . + uv pip install -e ".[develop]" uv pip install "yardang[themes]" if: github.event_name == 'workflow_dispatch' diff --git a/python/pure/Makefile.jinja b/python/pure/Makefile.jinja index 7e7edac..e41f7c3 100644 --- a/python/pure/Makefile.jinja +++ b/python/pure/Makefile.jinja @@ -4,10 +4,10 @@ .PHONY: develop build install develop: ## install dependencies and build library - uv pip install --group dev -e . + uv pip install -e ".[develop]" requirements: ## install development dependencies - uv pip install --group dev + uv pip install -r pyproject.toml --extra develop build: ## build the python library uv build diff --git a/python/pure/pyproject.toml.jinja b/python/pure/pyproject.toml.jinja index d1689ab..d1166ee 100644 --- a/python/pure/pyproject.toml.jinja +++ b/python/pure/pyproject.toml.jinja @@ -37,8 +37,8 @@ classifiers = [ dependencies = [] -[dependency-groups] -dev = [ +[project.optional-dependencies] +develop = [ "bump-my-version", "check-dist", "codespell", diff --git a/python/pure/{% if add_wiki %}docs{% endif %}/wiki/contribute/Build-from-Source.md.jinja b/python/pure/{% if add_wiki %}docs{% endif %}/wiki/contribute/Build-from-Source.md.jinja index 7f324aa..36b8a59 100644 --- a/python/pure/{% if add_wiki %}docs{% endif %}/wiki/contribute/Build-from-Source.md.jinja +++ b/python/pure/{% if add_wiki %}docs{% endif %}/wiki/contribute/Build-from-Source.md.jinja @@ -38,7 +38,7 @@ cd {{ project_name_formatted }} ## Install Python dependencies -Python development dependencies are specified in the `dev` dependency group in `pyproject.toml`. Install them with `uv`: +Python development and test dependencies are published in the `develop` extra in `pyproject.toml`. Install them with `uv`: ```bash make requirements From 3204f965d2169a8f77c2b92a8e0d2090da699673 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Fri, 14 Aug 2026 00:07:39 -0400 Subject: [PATCH 3/3] Avoid rebuilding cached Rust tools Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- python/rust/rust/Makefile.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/rust/rust/Makefile.jinja b/python/rust/rust/Makefile.jinja index 32d986e..f98df40 100644 --- a/python/rust/rust/Makefile.jinja +++ b/python/rust/rust/Makefile.jinja @@ -3,8 +3,8 @@ requirements: ## install required dev dependencies rustup component add rustfmt rustup component add clippy - cargo install --locked --force cargo-nextest - cargo install --force cargo-llvm-cov + cargo install --locked cargo-nextest --version 0.9.143 + cargo install --locked cargo-llvm-cov --version 0.8.7 develop: requirements ## install required dev dependencies