-
Notifications
You must be signed in to change notification settings - Fork 62
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
Better errors when an invalid requirement is encountered #507
Conversation
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Example with a subdependency:
The direct dependency error still isn't great:
...so I'll fix that one up as well. |
Signed-off-by: William Woodruff <[email protected]>
Well, it's still not fantastic, but this makes it a bit better:
|
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
cc @norg: if you get a chance, please give these changes a spin and let us know what you think! |
This is already a nice improvement. But it still prevents the further audit of other packages :) |
Yeah, I need to do some more thinking about how we should handle that...it's arguably incorrect of us to skip things just because we can't parse them, since there's probably a positive relationship between "old enough to have an invalid specifier" and "more likely to have known vulnerabilities." |
...we also could continue supporting legacy versions: see https://github.com/di/packaging_legacy and pypa/packaging#669. |
That works for me, although I wonder if we should establish some kind of (weak) policy around these kinds of compatibility concerns. Three ideas:
|
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.
LGTM!
As discussed, we can probably do better here. Either way, this is still a good improvement so let's get it in. |
Yep! I'll keep #478 open so we can come up with a more permanent solution. |
Thanks again for working on that :) |
## [2.5.1] ### Fixed * Fixed a crash on Windows caused by multiple open file handles to input requirements ([#551](pypa/pip-audit#551)) ## [2.5.0] ### Changed * Improved error messaging when a requirements input or indirect dependency has an invalid (non-PEP 440) requirements specifier ([#507](pypa/pip-audit#507)) * `pip-audit`'s handling of dependency resolution has been significantly refactored and simplified ([#523](pypa/pip-audit#523)) ### Fixed * Fixed a potential crash on invalid unicode in subprocess streams ([#536](pypa/pip-audit#536)) ## [2.4.15] **YANKED** ### Fixed * Fixed an issue where hash checking would fail when using third-party indices ([#462](pypa/pip-audit#462)) * Fixed the behavior of the `--skip-editable` flag, which had regressed with an internal API change ([#499](pypa/pip-audit#499)) * Fixed a dependency resolution bug that can potentially be triggered when multiple packages have the same subdependency ([#488](pypa/pip-audit#488))
See #478: this isn't a full fix, but will hopefully improve the overall quality and debuggability of the errors produced.