Skip to content

fix(packaging): add setuptools to dev extra so packaging test collects - #34854

Closed
teknium1 wants to merge 1 commit into
mainfrom
fix/packaging-test-setuptools-dep
Closed

fix(packaging): add setuptools to dev extra so packaging test collects#34854
teknium1 wants to merge 1 commit into
mainfrom
fix/packaging-test-setuptools-dep

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

tests/test_packaging_metadata.py (added in #34811) now collects in CI instead of erroring out.

The test imports from setuptools import find_packages at module level. setuptools is declared only under [build-system].requires, not as a runtime/test dependency — so CI's uv-managed test venv (uv pip install -e ".[all,dev]") doesn't have it, and the module fails at collection with ModuleNotFoundError: No module named 'setuptools'. This shows up as a red test (slice 4/6) shard on every PR branched off main since #34811 landed, even though all 4026 tests pass.

Changes

  • pyproject.toml: add setuptools>=61.0 to the dev extra (matching the [build-system] pin), so the wheel-packaging regression test keeps running in CI rather than being skipped or erroring.
  • uv.lock: regenerated (setuptools was already a transitive entry; just adds it to the all/dev extra references).

Validation

$ python3 -m pytest tests/test_packaging_metadata.py -q
4 passed in 0.10s

Before: ERROR collecting tests/test_packaging_metadata.pyModuleNotFoundError: No module named 'setuptools' → shard 4 red.

@teknium1
teknium1 requested a review from a team May 29, 2026 20:31
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Unbounded PyPI Dependency Detected

This PR adds PyPI dependencies without a <next_major upper bound. Per our supply chain policy, all PyPI deps must be pinned as >=floor,<next_major.

Unbounded specs found:

"setuptools>=61.0"

Fix: Add an upper bound, e.g. "package>=1.2.0,<2"


See PR #2810 and CONTRIBUTING.md for the full policy rationale.

@github-actions

github-actions Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: fix/packaging-test-setuptools-dep vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9455 on HEAD, 9455 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4909 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

tests/test_packaging_metadata.py (added in #34811) imports
`from setuptools import find_packages` at module level. setuptools is
only declared under [build-system] requires, not as a runtime/test dep,
so CI's uv-managed test venv (uv pip install -e '.[all,dev]') lacks it
and the module errors at collection with ModuleNotFoundError. Adding
setuptools>=61.0 to the dev extra keeps the wheel-packaging regression
test running in CI instead of skipping or erroring.
@teknium1
teknium1 force-pushed the fix/packaging-test-setuptools-dep branch from 170a09f to 52524c7 Compare May 29, 2026 20:33
@alt-glitch alt-glitch added type/test Test coverage or test infrastructure P2 Medium — degraded but workaround exists python:uv Pull requests that update python:uv code labels May 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #34851 — both add setuptools to dev extra for test_packaging_metadata.py. #34851 also adds pytest.importorskip guard as belt-and-suspenders.

@teknium1

Copy link
Copy Markdown
Contributor Author

Duplicate of #34851 (created 4 min earlier, same root cause). #34851 also adds a defensive pytest.importorskip guard so the shard skips gracefully if setuptools is ever absent — keeping that one. Relaxing its exact pin to a version range there.

@teknium1 teknium1 closed this May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists python:uv Pull requests that update python:uv code type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants