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

Add support for --no-strip-markers in pip compile output #4503

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Jun 25, 2024

Summary

This is an intermediary change in enabling universal resolution for requirements.txt files. To start, we need to be able to preserve markers in the requirements.txt output and propagate those markers, such that if you have a dependency that's only included with a given marker, the transitive dependencies respect that marker too.

Closes #1429.

@charliermarsh charliermarsh force-pushed the charlie/req-txt branch 6 times, most recently from c222eab to effc56e Compare June 25, 2024 01:33
@charliermarsh charliermarsh added the enhancement New feature or request label Jun 25, 2024
// Fold over the edges to combine the marker trees. If any edge is `None`, then
// the combined marker tree is `None`.
let mut edges = petgraph.edges_directed(index, Direction::Incoming);
edges
Copy link
Member

Choose a reason for hiding this comment

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

Can this be simplified with a let makers = edges.iter() ... .collect(); if !markers.is_empty() { MarkerTree::Or(markers)}?

Copy link
Member Author

Choose a reason for hiding this comment

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

The nice thing about the current solution is that it doesn't allocate a vec.

@charliermarsh charliermarsh force-pushed the charlie/req-txt branch 2 times, most recently from 82c6ea1 to 21f68a8 Compare June 25, 2024 18:48
@charliermarsh charliermarsh merged commit 5732209 into main Jun 25, 2024
46 checks passed
@charliermarsh charliermarsh deleted the charlie/req-txt branch June 25, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv pip compile Does not retain PEP-508 environment markers in output
2 participants