-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Annotate sources of requirements #3269
Merged
charliermarsh
merged 36 commits into
astral-sh:main
from
palfrey:annotate-requirements-sources
May 9, 2024
Merged
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
8afbb25
Annotate packages that are from a requirements file
palfrey 6db1eec
Merge branch 'main' into annotate-requirements-sources
palfrey 5818459
Fix clippy, fmt and _most_ of the test failures
palfrey 8cad31d
Fix remaining "missing via -r" test fails
palfrey cf170e5
resolve_configuration has many snapshots
palfrey 9655e91
Fix contraints output
palfrey 90966c7
Merge branch 'main' into annotate-requirements-sources
palfrey 042432b
Strip sources out of pubgrub
palfrey 5358db9
Ignore too many args to DisplayResolutionGraph
palfrey c5b159b
Fix various extra constraints test failures
palfrey a53b968
Sort source annotations
palfrey 3044fa8
Fix pyproject to not be a -r annotation
palfrey e005d96
Merge branch 'main' into annotate-requirements-sources
palfrey cf56fc4
Update newer tests
palfrey 0ac36f7
Merge branch 'main' into annotate-requirements-sources
palfrey e15914d
Update to latest main
palfrey 8512f8d
Fix windows-specific test compile
palfrey cfba144
And reformat the windows-specific fix
palfrey 2c31ee6
Attempt to unfudge the windows testing
palfrey 54064be
Fix some remaining path regex errors
palfrey 264cc3d
Simplify expand_env_var_requirements_txt filters
palfrey 493cf85
Fix requirements-txt snapshots
palfrey 6332d06
Remove TrackedStr from other structs
charliermarsh 4da1f65
Use with_source instead of TrackedFromStr
charliermarsh 76df774
Merge branch 'main' into annotate-requirements-sources
charliermarsh 9f5fa04
Move sources to distribution-types
charliermarsh e832262
Change signature
charliermarsh e57ce3f
Re-generate fixtures
charliermarsh b8decb4
Fix Ubuntu and macOS test
charliermarsh eb3ea98
Add sources for editables
palfrey 6bd18ce
Fix clippy issue (and some test results along the way)
palfrey 0ebe593
Strip UNC
charliermarsh e09fe28
Add debug logging
charliermarsh cc89b87
Add debug logging
charliermarsh 641b107
Set stack size
charliermarsh 14630d2
Retry filters
charliermarsh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use std::path::Path; | ||
|
||
/// Like FromStr, but with information about where the str came from | ||
pub trait TrackedFromStr: Sized { | ||
/// The associated error which can be returned from parsing. | ||
type Err; | ||
|
||
/// Convert from input with optional source and working_dir | ||
fn tracked_from_str( | ||
input: &str, | ||
source: Option<&Path>, | ||
working_dir: Option<&Path>, | ||
) -> Result<Self, Self::Err>; | ||
} |
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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 am not entirely sure this is the right package, but AFAIK, it's the only crate that everything that needs it can depend on....
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 want to experiment with a slightly different approach here. Instead of a trait, could we just always use
None
for the source, and then add a method to set the source after parsing? Since the parsing itself doesn't depend on the source at all, right?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 can give it a try.)
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.
Sure. If you can make it work, all good!