Skip to content

🐛 fix(build): read the project metadata from the sdist - #457

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:sdist-suite
Sep 1, 2026
Merged

🐛 fix(build): read the project metadata from the sdist#457
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:sdist-suite

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

pytest against an unpacked 2.29.2 sdist ends with eight errors, all of them FileNotFoundError on pyproject-fmt/pyproject.toml (#454).

maturin hoists the package's pyproject.toml to the root of the tarball and ships a copy of build_backend.py under pyproject-fmt/, beside the tests. #451 made the backend read that file from beside itself, which holds in a checkout and in the tarball root, and holds nowhere in the directory the tests load it from. The backend reads it from either place.

The check that surfaced it

pkg_sdist built the sdist, built a wheel from it, installed that with --no-index and ran the console script. It proved the artifact installs. It never ran the suite the sdist ships, which is what a packager does and what the report in #450 spelled out.

It now ends with those steps: unpack the sdist, install it, run the suite it carries. tox supplies the environment and the test group, so the check installs into the interpreter it already runs under rather than building an environment of its own.

Against the code this PR fixes the check ends:

======================== 73 passed, 8 errors in 0.79s ========================

the same eight ids #454 lists. With the fix, 81 pass, and 60 for tox-toml-fmt.

Fixes #454

The sdist keeps a copy of build_backend.py beside the tests it ships, a
directory below the pyproject.toml maturin hoists to the tarball root,
so reading that file from beside the backend ended the eight tests that
load it. The backend reads it from either place.

pkg_sdist now unpacks the sdist, installs it and runs the suite it
carries, which is what a packager does and what surfaced this. Against
the code it fixes, the check ends with the eight errors from tox-dev#454.
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (362f57c) to head (2c22dab).

Additional details and impacted files
Flag Coverage Δ
pyproject-fmt 100.00% <ø> (?)
tox-rules 100.00% <ø> (?)
tox-toml-fmt 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 43 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gaborbernat
gaborbernat merged commit f1b5863 into tox-dev:main Sep 1, 2026
159 checks passed
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.

Test failures in 2.29.2 due to missing pyproject-fmt/pyproject.toml

1 participant