Skip to content

fix(deps): declare setuptools in dev extra for packaging tests#34851

Merged
teknium1 merged 3 commits into
mainfrom
fix/dev-dep-setuptools
May 30, 2026
Merged

fix(deps): declare setuptools in dev extra for packaging tests#34851
teknium1 merged 3 commits into
mainfrom
fix/dev-dep-setuptools

Conversation

@teknium1

@teknium1 teknium1 commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Packaging tests stop breaking CI. tests/test_packaging_metadata.py does from setuptools import find_packages at module scope to validate package discovery against the live tree. setuptools used to be present ambiently in the GitHub runner image; recent ubuntu-latest images no longer ship it in the test venv, so the test (4) shard fails at collection with ModuleNotFoundError: No module named 'setuptools' on every PR — even though the 4996-test run itself is green.

Two fixes, belt-and-suspenders:

Changes

  • pyproject.toml: add setuptools==82.0.1 to the dev optional-dependencies so .[all,dev] installs it explicitly instead of relying on the runner environment.
  • tests/test_packaging_metadata.py: guard the module-level setuptools import with pytest.importorskip("setuptools", exc_type=ImportError) — if setuptools is ever absent again, these checks SKIP instead of erroring out collection for the whole shard.

Validation

scenario before after
test (4) collection, no ambient setuptools ModuleNotFoundError (shard fails) setuptools installed via [dev]; if still absent → 1 skipped, no error
setuptools present (normal) 4 pass 4 pass

Pre-existing breakage surfaced on PR #34839's CI; fixed standalone here.

tests/test_packaging_metadata.py imports `from setuptools import
find_packages` at module scope to validate package discovery against
the live tree. setuptools was being picked up ambiently from the CI
runner image, but recent ubuntu-latest images no longer ship it in the
test venv, so collection fails with ModuleNotFoundError on every PR.

Declare setuptools==82.0.1 in the dev optional-dependencies so `.[all,dev]`
installs it explicitly rather than relying on the runner environment.
@teknium1 teknium1 requested a review from a team May 29, 2026 20:27
@github-actions

github-actions Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: fix/dev-dep-setuptools 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: 9456 on HEAD, 9455 on base (🆕 +1)

🆕 New issues (1):

Rule Count
unresolved-import 1
First entries
tests/test_packaging_metadata.py:4: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`

✅ Fixed issues: none

Unchanged: 4909 pre-existing issues carried over.

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

teknium1 added 2 commits May 29, 2026 13:30
Belt-and-suspenders alongside declaring setuptools in [dev]: guard the
module-level `from setuptools import find_packages` with
pytest.importorskip so a runner missing setuptools SKIPS these checks
instead of erroring out collection for the entire test shard.
@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
@teknium1 teknium1 merged commit f9daa4a into main May 30, 2026
26 checks passed
@teknium1 teknium1 deleted the fix/dev-dep-setuptools branch May 30, 2026 00:24
sradetzky pushed a commit to sradetzky/hermes-agent that referenced this pull request May 30, 2026
…esearch#34851)

* fix(deps): declare setuptools in dev extra for packaging tests

tests/test_packaging_metadata.py imports `from setuptools import
find_packages` at module scope to validate package discovery against
the live tree. setuptools was being picked up ambiently from the CI
runner image, but recent ubuntu-latest images no longer ship it in the
test venv, so collection fails with ModuleNotFoundError on every PR.

Declare setuptools==82.0.1 in the dev optional-dependencies so `.[all,dev]`
installs it explicitly rather than relying on the runner environment.

* test(packaging): skip packaging-metadata tests when setuptools absent

Belt-and-suspenders alongside declaring setuptools in [dev]: guard the
module-level `from setuptools import find_packages` with
pytest.importorskip so a runner missing setuptools SKIPS these checks
instead of erroring out collection for the entire test shard.

* chore(deps): sync uv.lock for setuptools dev dependency
KKT-OPT pushed a commit to KKT-OPT/hermes-agent that referenced this pull request May 31, 2026
…esearch#34851)

* fix(deps): declare setuptools in dev extra for packaging tests

tests/test_packaging_metadata.py imports `from setuptools import
find_packages` at module scope to validate package discovery against
the live tree. setuptools was being picked up ambiently from the CI
runner image, but recent ubuntu-latest images no longer ship it in the
test venv, so collection fails with ModuleNotFoundError on every PR.

Declare setuptools==82.0.1 in the dev optional-dependencies so `.[all,dev]`
installs it explicitly rather than relying on the runner environment.

* test(packaging): skip packaging-metadata tests when setuptools absent

Belt-and-suspenders alongside declaring setuptools in [dev]: guard the
module-level `from setuptools import find_packages` with
pytest.importorskip so a runner missing setuptools SKIPS these checks
instead of erroring out collection for the entire test shard.

* chore(deps): sync uv.lock for setuptools dev dependency
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
* fix(deps): declare setuptools in dev extra for packaging tests

tests/test_packaging_metadata.py imports `from setuptools import
find_packages` at module scope to validate package discovery against
the live tree. setuptools was being picked up ambiently from the CI
runner image, but recent ubuntu-latest images no longer ship it in the
test venv, so collection fails with ModuleNotFoundError on every PR.

Declare setuptools==82.0.1 in the dev optional-dependencies so `.[all,dev]`
installs it explicitly rather than relying on the runner environment.

* test(packaging): skip packaging-metadata tests when setuptools absent

Belt-and-suspenders alongside declaring setuptools in [dev]: guard the
module-level `from setuptools import find_packages` with
pytest.importorskip so a runner missing setuptools SKIPS these checks
instead of erroring out collection for the entire test shard.

* chore(deps): sync uv.lock for setuptools dev dependency
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