Skip to content
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

Use pep440_rs and pep508_rs #1558

Merged
merged 2 commits into from
Apr 3, 2023
Merged

Use pep440_rs and pep508_rs #1558

merged 2 commits into from
Apr 3, 2023

Conversation

konstin
Copy link
Member

@konstin konstin commented Apr 2, 2023

This switches from string heuristics to proper PEP 440 and PEP 508 parsing. This includes full support for requires-python, extra handling and wasmtime detection.

@netlify
Copy link

netlify bot commented Apr 2, 2023

Deploy Preview for maturin-guide ready!

Name Link
🔨 Latest commit a2174ae
🔍 Latest deploy log https://app.netlify.com/sites/maturin-guide/deploys/6429abc2405d61000868d9ce
😎 Deploy Preview https://deploy-preview-1558--maturin-guide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

]

[[package]]
name = "pep508_rs"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effectively this only adds only one new dependency

operator: MarkerOperator::Equal,
r_value: MarkerValue::QuotedString(extra_value),
}) if &extra_value == extra => None,
MarkerTree::And(and) => match &*and {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how to deal with the borrow checker better here without vec patterns

@@ -61,6 +64,42 @@ pub struct Metadata21 {
pub entry_points: IndexMap<String, IndexMap<String, String>>,
}

impl Metadata21 {
/// Initializes with name, version and otherwise the defaults
pub fn new(name: String, version: Version) -> Self {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Version does not have a default

(min_python_minor..=MAXIMUM_PYPY_MINOR).map(|minor| format!("pypy3.{minor}")),
(min_python_minor..=MAXIMUM_PYPY_MINOR)
.filter(|minor| {
requires_python
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is some duplication unfortunately

Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

bors r+

bors bot added a commit that referenced this pull request Apr 3, 2023
1558: Use pep440_rs and pep508_rs r=messense a=konstin

This switches from string heuristics to proper PEP 440 and PEP 508 parsing. This includes full support for `requires-python`, extra handling and wasmtime detection.

Co-authored-by: konstin <[email protected]>
@bors
Copy link
Contributor

bors bot commented Apr 3, 2023

Build failed:

@messense messense merged commit 3f032af into main Apr 3, 2023
@messense messense deleted the pep440_rs-and-pep508_rs branch April 3, 2023 01:35
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.

2 participants