Skip to content

ci: add ten more projects to the downstream matrix - #1261

Merged
henryiii merged 7 commits into
pypa:mainfrom
henryiii:ci/expand-downstream-matrix
Jun 15, 2026
Merged

henryiii merged 7 commits into
pypa:mainfrom
henryiii:ci/expand-downstream-matrix

Conversation

@henryiii

@henryiii henryiii commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Inspired by the downstream survey in #1250, this expands the downstream job to cover more of the ecosystem.

What's added

Ten projects, each verified green by running its real suite against this packaging through the actual nox session on a regular CPython 3.14 (matching CI).

Imported directly (not vendored):

Project Tests Time¹
dependency-groups 39 passed <1s
dep-logic 2479 passed <1s
twine 228 passed 3s
cibuildwheel 790 passed 4s
hatchling 941 passed 8s
virtualenv 282 passed 46s
pdm 1107 passed 56s
tox 7879 passed 70s

Vendored — tested via the copytree swap (the same trick the pip branch already uses: after the editable install, replace the vendored packaging dir with the current source; packaging's relative imports make the dropped-in copy self-contained under any vendor namespace). The swap is runtime-verified to report the dev version.

Project Vendored dir(s) replaced Tests Time¹
poetry-core src/poetry/core/_vendor/packaging 2826 passed 40s
pipenv pipenv/vendor/packaging, pipenv/patched/pip/_vendor/packaging 483 passed (tests/unit) 4s

¹ Test-run wall time (plus ~15–20s install each); every project runs on its own matrix runner.

What was deliberately left out

  • pex also vendors packaging and the swap is feasible (its import hook even tolerates the new _ranges.py), but its full suite is integration/network-heavy — only a thin ~24-test subset is runnable, so the signal isn't worth the matrix slot.
  • installer doesn't import packaging at all.
  • Too slow / network-bound: grayskull (>8 min against live PyPI), pip-audit (~95s, hits live OSV/PyPI).
  • Too environment-sensitive from a tarball: flit (sdist contents come from git, absent in the tag tarball), scikit-build-core (pytest-9.1 collection issues + needs a compiler), importlib_metadata (hard-requires CPython's bundled test module).

Harness details worth a look in review

  • SCM pretend-version is scoped to the build step. GitHub tag tarballs ship no .git, so setuptools-scm / pdm-backend need a pretend version to build — but leaving SETUPTOOLS_SCM_PRETEND_VERSION set during the test run breaks hatchling's version-detection tests, so it's passed only to install().
  • The test TMPDIR is pointed outside the checkout. nox's create_tmp() places the temp dir inside this git repo, so downstream tools that walk up the tree (hatchling's VCS sdist builder, tox/pdm config discovery) find packaging's own repo metadata and misbehave.
  • The vendored copies need a couple of project-specific deps: poetry-core's C-extension masonry fixtures need setuptools, and pipenv's --no-cov addopts is dropped since pytest-cov isn't in its test extra.

⚠️ This already caught a real regression

While probing, unearth's tests failed against current main on a genuine bug — SpecifierSet.contains() no longer applies implicit pre-release exclusion:

SpecifierSet(">=7").contains(Version("8.0.0dev0"))  # → True, should be False
SpecifierSet("").contains(Version("8.0.0a0"))        # → True, should be False

.filter() still excludes them correctly, so contains() and filter() now disagree. It's correct on 25.0 but broken on 26.1, 26.2, and main (came in with the range-engine work in _ranges.py; predates #1259). Tracking separately — flagging here since this PR's job is what surfaces it.

Opened as a draft pending maintainer decision on the project set and the regression.

henryiii added 2 commits June 14, 2026 23:51
Probe-tested the downstream consumers from pypa#1250 against this
packaging and add the ones that exercise it directly, install cleanly, and
run their suites in well under five minutes: dependency-groups, dep-logic,
twine, cibuildwheel, hatchling, virtualenv, pdm, and tox.

Projects that vendor packaging (pipenv, poetry-core, pex), do not import it
(installer), or are too slow/network-bound (grayskull, pip-audit) were left
out, as were ones whose suites are too environment-sensitive to run from a
release tarball (flit, scikit-build-core, importlib_metadata).

Two harness details the newer releases need:

- Scope SETUPTOOLS_SCM_PRETEND_VERSION / PDM_BUILD_SCM_VERSION to the build
  step. GitHub tag tarballs ship no .git, so the version backends need a
  pretend version; leaving it set during the test run breaks hatchling's
  version-detection tests.
- Point the test TMPDIR outside this checkout. nox's create_tmp() places it
  inside the repo, so tools that walk up the tree (hatchling's VCS sdist
  builder, tox/pdm config discovery) find packaging's own repo metadata.

The original five projects predate pytest 9.1.0 and keep their pytest<9.1.0
pin; the newer ones support 9.1.0 and must not get it.

Assisted-by: ClaudeCode:claude-opus-4.8
These vendor packaging, so installing them normally would exercise their
bundled copy, not this one. Reuse the trick the pip branch already uses:
after the editable install, replace the vendored packaging directory with the
current source. packaging's modules import relatively, so the dropped-in copy
is self-contained under any vendor namespace (poetry-core injects its _vendor
onto sys.path; pipenv keeps two copies, its own vendor tree and the patched
pip). Verified at runtime that the swapped copy reports the dev version.

poetry-core needs setuptools for its C-extension masonry build fixtures, and
pipenv's --no-cov addopts is dropped since pytest-cov is not in its test extra.

Assisted-by: ClaudeCode:claude-opus-4.8
@henryiii henryiii changed the title ci: add eight more projects to the downstream matrix ci: add ten more projects to the downstream matrix Jun 15, 2026
henryiii added 4 commits June 15, 2026 00:21
GitHub Actions sets CI=true, which makes tox append a pip-freeze line to
command output. Several of tox's own tests assert exact output and do not
expect it, so they failed only on CI. Unset CI for the tox test run.

Assisted-by: ClaudeCode:claude-opus-4.8
…ng pytest

The original pinned projects break under pytest 9.1.0 (2026-06-13), whose
parametrize handling turns their test collection into errors. Instead of
hand-pinning pytest<9.1.0 (which only constrains pytest and relies on install
ordering), cap dependency resolution at the day before via UV_EXCLUDE_NEWER and
PIP_UPLOADED_PRIOR_TO. They resolve pytest 9.0.x with otherwise-current deps,
on whichever backend nox uses, and the install-order workaround goes away.

Assisted-by: ClaudeCode:claude-opus-4.8
Replace the ~170-line if/elif chain with a frozen Project dataclass and a table
of entries. Each project declares its url, install args, optional build-only
install env (scoped SCM version overrides), vendored packaging dirs to swap,
pytest args, extra test env, and a date_limit flag; sensible defaults keep most
entries to a line or two.

One generic body then drives every project: apply the date cap, build a test
env with TMPDIR outside the checkout, install, swap any vendored copies, and run
pytest. pip keeps the only special case -- it pre-builds its common test wheels
before the swap.

No behavior change: all fifteen downstream projects were re-run and pass.

Assisted-by: ClaudeCode:claude-opus-4.8
tox's is_ci() (tox/util/ci.py) checks several variables, and GitHub Actions
sets both CI and GITHUB_ACTIONS. Unsetting only CI still left is_ci() true on
CI, so the pip-freeze line reappeared in command output and the output-asserting
tests failed there while passing locally. Unset GITHUB_ACTIONS too.

Assisted-by: ClaudeCode:claude-opus-4.8
@henryiii
henryiii marked this pull request as ready for review June 15, 2026 13:12
Comment thread noxfile.py Outdated

@notatallshaw notatallshaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need to update the cutoff value.

@henryiii
henryiii merged commit c97f696 into pypa:main Jun 15, 2026
69 checks passed
@henryiii
henryiii deleted the ci/expand-downstream-matrix branch June 15, 2026 23:50
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.

2 participants