🐛 fix(build): read the project metadata from the sdist - #457
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pytestagainst an unpacked 2.29.2 sdist ends with eight errors, all of themFileNotFoundErroronpyproject-fmt/pyproject.toml(#454).maturin hoists the package's
pyproject.tomlto the root of the tarball and ships a copy ofbuild_backend.pyunderpyproject-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_sdistbuilt the sdist, built a wheel from it, installed that with--no-indexand 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:
the same eight ids #454 lists. With the fix, 81 pass, and 60 for tox-toml-fmt.
Fixes #454