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

requirements file parsing with normal option defaults #2725

Merged
merged 5 commits into from
Apr 28, 2015
Merged

requirements file parsing with normal option defaults #2725

merged 5 commits into from
Apr 28, 2015

Conversation

qwcode
Copy link
Contributor

@qwcode qwcode commented Apr 25, 2015

  1. parse with defaults set as they are (vs forcing to None) and adjust the logic to match; the result is simpler.
  2. Due to No instructions for how to install pip #1, we can remove some hairy "format_control" hacks that arose in response.
  3. Due to No instructions for how to install pip #1, let's relax the parsing and allow:

cc @rbtcollins , since you had to work around this for format_control parsing

   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)
@rbtcollins
Copy link

Looks much cleaner to me.

@qwcode
Copy link
Contributor Author

qwcode commented Apr 28, 2015

@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:

  • an option happens to set the default value
  • when there's multiple of the same option

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 --install-option/--global-option on those lines are scoped to the requirement.

@pfmoore
Copy link
Member

pfmoore commented Apr 28, 2015

#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.

qwcode added a commit that referenced this pull request Apr 28, 2015
requirements file parsing with normal option defaults
@qwcode qwcode merged commit 94a6829 into pypa:develop Apr 28, 2015
aapa added a commit to aapa/pyfibot that referenced this pull request May 31, 2015
> - **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'`
aapa added a commit to aapa/pyfibot that referenced this pull request May 31, 2015
> - **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'`
aapa added a commit to aapa/pyfibot that referenced this pull request May 31, 2015
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'`
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants