-
Notifications
You must be signed in to change notification settings - Fork 3k
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 file parsing with normal option defaults #2725
Conversation
and adjust the logic to match; the result is simpler. 2) Due to #1, we can remove some hairy "format_control" hacks 3) Due to #1, we have to relax the parsing and allow: - multiple options per line - any supported option on a line with a requirement (not just --install-option/--global-option, although they are the only options that are passed into a requirement)
Looks much cleaner to me. |
@dstufft @pfmoore, can I get your thoughts on #3 from the description, since it's somewhat major. we could check when option values are != to the defaults, but it's only a partial solution. we'd still fail to detect when:
We could possibly do some low-level overrides in optparse to detect this, but it seems like the wrong path. The important thing is that requirements can still only be one per line, and |
#3 seems OK to me. It mostly allows things that I don't think people will (or should) ever do. I'd assume that the extra behaviour would be undocumented. So we have the option to treat weird behaviour as "don't do that" rather than as bugs to fix. I'd prefer that over trying to document and support all the corner cases. |
requirements file parsing with normal option defaults
> - **BACKWARD INCOMPATIBLE** Requirements in requirements files containing markers must now be quoted due to parser changes from ([PR #2697](pypa/pip#2697)) and ([PR #2725](pypa/pip#2725)). For example, use `"SomeProject; python_version < '2.7'"`, not simply `SomeProject; python_version < '2.7'`
> - **BACKWARD INCOMPATIBLE** Requirements in requirements files containing markers must now be quoted due to parser changes from ([PR #2697](pypa/pip#2697) and ([PR #2725](pypa/pip#2725). For example, use `"SomeProject; python_version < '2.7'"`, not simply `SomeProject; python_version < '2.7'`
From [pip 7.0.0 release notes](https://pip.pypa.io/en/latest/news.html): > - **BACKWARD INCOMPATIBLE** Requirements in requirements files containing markers must now be quoted due to parser changes from ([PR #2697](pypa/pip#2697)) and ([PR #2725](pypa/pip#2725)). For example, use `"SomeProject; python_version < '2.7'"`, not simply `SomeProject; python_version < '2.7'`
--install-option
/--global-option
, although they are the only options that are scoped to the requirement)pip install --editable and pip install clash for namespace packages #3 may be debatable, but it seems ok to me.
cc @rbtcollins , since you had to work around this for
format_control
parsing