Read package metadata from pyproject.toml when statically defined#2676
Merged
charliermarsh merged 1 commit intomainfrom Mar 27, 2024
Merged
Read package metadata from pyproject.toml when statically defined#2676charliermarsh merged 1 commit intomainfrom
pyproject.toml when statically defined#2676charliermarsh merged 1 commit intomainfrom
Conversation
c2fed4c to
adeb3e7
Compare
charliermarsh
commented
Mar 26, 2024
| ----- stderr ----- | ||
| Resolved 8 packages in [TIME] | ||
| Downloaded 7 packages in [TIME] | ||
| Downloaded 8 packages in [TIME] |
Member
Author
There was a problem hiding this comment.
This is correct, because we no longer download flit-core during the resolution phase.
konstin
approved these changes
Mar 27, 2024
| /// PEP 621 project metadata. | ||
| /// | ||
| /// This is a subset of the full metadata specification, and only includes the fields that are | ||
| /// relevant for dependency resolution. |
Member
There was a problem hiding this comment.
Suggested change
| /// relevant for dependency resolution. | |
| /// relevant for dependency resolution. | |
| /// See <https://packaging.python.org/en/latest/specifications/pyproject-toml>. |
Comment on lines
+440
to
+447
| let s = r#" | ||
| [project] | ||
| name = "asdf" | ||
| "#; | ||
| let meta = Metadata23::parse_pyproject_toml(s); | ||
| assert!(matches!(meta, Err(Error::FieldNotFound("version")))); |
Member
There was a problem hiding this comment.
That is even an invalid pyproject.toml ("The keys which are required but may be specified either statically or listed as dynamic are: version")
| assert!(meta.provides_extras.is_empty()); | ||
|
|
||
| let s = r#" | ||
| [project] |
Member
There was a problem hiding this comment.
I'm pretty sure most users don't get that eliding the dependencies key means declaring that you have no deps, but that's the spec.
adeb3e7 to
4f7168d
Compare
4f7168d to
0995e19
Compare
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.
Summary
Now that we're resolving metadata more aggressively for local sources, it's worth doing this. We now pull metadata from the
pyproject.tomldirectly if it's statically-defined.Closes #2629.