-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read package metadata from pyproject.toml
when statically defined
#2676
Conversation
c2fed4c
to
adeb3e7
Compare
@@ -987,7 +986,7 @@ fn reinstall_build_system() -> Result<()> { | |||
|
|||
----- stderr ----- | |||
Resolved 8 packages in [TIME] | |||
Downloaded 7 packages in [TIME] | |||
Downloaded 8 packages in [TIME] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct, because we no longer download flit-core
during the resolution phase.
/// PEP 621 project metadata. | ||
/// | ||
/// This is a subset of the full metadata specification, and only includes the fields that are | ||
/// relevant for dependency resolution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// relevant for dependency resolution. | |
/// relevant for dependency resolution. | |
/// See <https://packaging.python.org/en/latest/specifications/pyproject-toml>. |
let s = r#" | ||
[project] | ||
name = "asdf" | ||
"#; | ||
let meta = Metadata23::parse_pyproject_toml(s); | ||
assert!(matches!(meta, Err(Error::FieldNotFound("version")))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Summary
Now that we're resolving metadata more aggressively for local sources, it's worth doing this. We now pull metadata from the
pyproject.toml
directly if it's statically-defined.Closes #2629.