-
Notifications
You must be signed in to change notification settings - Fork 380
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
requirements.txt mis-parses lines that contain --hash #369
Labels
bug
Something isn't working
Comments
ah yup, I missed this section when implementing the parser (also https://pip.pypa.io/en/stable/topics/secure-installs/). I'd say we just want to split on the first space, and use the first element - @robotdana this could be a good one for you to pick up. |
robotdana
added a commit
to robotdana/osv-scanner
that referenced
this issue
May 12, 2023
This removes everything after the whitespace of the version to also catch the other per-requirement options --global-option and --config-settings and any future options that may be added https://pip.pypa.io/en/stable/reference/requirements-file-format/#per-requirement-options fixes: google#369
robotdana
added a commit
to robotdana/osv-scanner
that referenced
this issue
May 12, 2023
While addressing google#369 i noticed the pip documentation example for --hash used line continuations which weren't currently supported by this parser so i've added support for multiline escapes
robotdana
added a commit
to robotdana/osv-scanner
that referenced
this issue
May 12, 2023
This removes everything after the whitespace of the version to also catch the other per-requirement options --global-option and --config-settings and any future options that may be added https://pip.pypa.io/en/stable/reference/requirements-file-format/#per-requirement-options fixes: google#369 # Conflicts: # pkg/lockfile/parse-requirements-txt_test.go
robotdana
added a commit
to robotdana/osv-scanner
that referenced
this issue
May 12, 2023
While addressing google#369 i noticed the pip documentation example for --hash used line continuations which weren't currently supported by this parser so i've added support for line continuations
robotdana
added a commit
to robotdana/osv-scanner
that referenced
this issue
May 12, 2023
While addressing google#369 i noticed the pip documentation example for --hash used line continuations which weren't currently supported by this parser so i've added support for line continuations
another-rex
pushed a commit
that referenced
this issue
May 15, 2023
This removes everything after the whitespace of the version to also catch the other per-requirement options --global-option and --config-settings and any future options that may be added https://pip.pypa.io/en/stable/reference/requirements-file-format/#per-requirement-options fixes: #369 While addressing this i noticed the pip documentation example for --hash used line continuations which weren't currently supported by this parser so i've added support for this
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a
requirements.txt
file, a dependency may be written like:This specifies both the package version as well as the packages hash. However,
Parse
mishandles this and generates:Note how
Version
just contains the remainder of the line, not merely the version portion.The text was updated successfully, but these errors were encountered: