Rework pyproject.toml parsing to never raise under setuptools - #107
Merged
Conversation
This is super messy and needs a refactor.
The examples seemed to be running against a different version of Incremental (possibly from pip's cache?). Ensure they run against exactly the version of Incremental we're trying to test against by pre-installing it in an isolated environment. Since this introduces an isolated environment, also install coverage-p to enable coverage of the subprocess.
It seems we must rely on heuristics, so let's go all the way.
twm
commented
Jul 28, 2024
adiroiban
approved these changes
Jul 29, 2024
adiroiban
left a comment
Member
There was a problem hiding this comment.
Hi.
I did a very quick review... mostly just a placehoder review... in the case nobody else will have time for a full review.
Feel free to merge if another review is not provided in time.
Thanks
Member
Author
|
Thank you for the review @adiroiban! I will proceed to merge and release as I am concerned that the issue this fixes will cause more problems in the ecosystem as the work week gets going. |
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.
This turns out to be a logic bug in how Incremental detects whether it has been enabled under setuptools. To quote the newsfragment:
The blast radius is nasty because many packaging tools use the distutils/setuptools APIs that invoke setuptools hooks.
This PR changes the rules for setuptools. Incremental now only activates itself if all of the following are true:
pyproject.tomlcontains a[tool.incremental]tablepyproject.toml_version.pyfileIn the Hatch case we continue to treat any configuration problems as errors because the Hatch plugin is only loaded when explicitly configured.
Additionally, this improves the integration test suite to isolate the build of the example projects and patches a coverage hole around
_infthat brings us to 100% branch coverage.Fixes #106.