Skip to content

Commit 7d6dd70

Browse files
committed
fix: set PYTHONPATH at job level so all steps can import build_backend
Step-level env only applies to a single step. uv sync passed but uv build and tox steps still failed with ModuleNotFoundError: No module named build_backend. Moving PYTHONPATH to job-level env ensures it is available for all steps: uv sync, uv build, tox, and any future steps that invoke the build backend. Also fix docstring example in build_backend.py to include packaging in build-system.requires, matching what the packages actually declare.
1 parent db4c89b commit 7d6dd70

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ jobs:
8585
defaults:
8686
run:
8787
working-directory: ./
88+
env:
89+
PYTHONPATH: ${{ github.workspace }}/versioning/helper
8890

8991
strategy:
9092
matrix:
@@ -105,8 +107,6 @@ jobs:
105107

106108
- name: Install the project
107109
run: uv lock && uv sync --locked --all-extras --dev
108-
env:
109-
PYTHONPATH: ${{ github.workspace }}/versioning/helper
110110

111111
- name: Verify centralized version constraints
112112
run: uv run --frozen tox -e verify-constraints

versioning/helper/build_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
Usage in package pyproject.toml:
1212
[build-system]
13-
requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit"]
13+
requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"]
1414
build-backend = "build_backend"
1515
1616
The build backend module is resolved via PYTHONPATH, which must include the

0 commit comments

Comments
 (0)