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

Feature request: ignore extras in constraints files, don't reject them #9209

Open
ncoghlan opened this issue Dec 3, 2020 · 1 comment
Open
Labels
C: constraint Dealing with "constraints" (the -c option) type: feature request Request for a new feature

Comments

@ncoghlan
Copy link
Member

ncoghlan commented Dec 3, 2020

What's the problem this feature will solve?

We have some CI pipelines that use the full locked set of project dependencies as a constraints file when installing a subset of the dependencies.

Rejecting extras in constraints files means that we can't do this with the new resolver, we have to pre-process the locked requirements file to remove all the extras declarations.

Describe the solution you'd like
Silently ignore extras in constraints files, don't fail the command.

Alternative Solutions

The workaround is to run sed -i 's/\[[^]]*\]//g' constraints.txt to pre-process a copy of the project requirements file to remove all the extras declarations, rather than using the requirements file directly.

Additional context

#6628 was an issue with the old resolver where extras declarations in constraints files were incorrectly interpreted as requesting that those extras be installed. This is not a request to bring back that behaviour - instead, it's a request to process constraints files as if they didn't contain any extras declarations, regardless of whether they do or not.

@uranusjr uranusjr added C: constraint Dealing with "constraints" (the -c option) type: feature request Request for a new feature labels Dec 3, 2020
@ulope
Copy link

ulope commented Dec 7, 2020

We're running into a similar problem.
In our project developers can place additional tools they like to have installed into a git excluded file which is installed as part of the dev install make target.
To ensure those additional tools don't cause conflicts we pass the our regular fully locked requirements-dev.txt file as a constraints file.
This no longer works with the new resolver as described by @ncoghlan.

ulope added a commit to ulope/raiden that referenced this issue Dec 7, 2020
`pip >= 20.3` is using a new resolver that no longer accepts extras in
constraints files.

In the `install-dev` task we used to pass our requirements-dev.txt file
verbatim as a constraints file to ensure additional local developer
tools (via `requirerments-local.txt`) don't cause breakage.

For now pre-process the requirements file with sed to remove extras.
See: pypa/pip#9209
eorituz pushed a commit to raiden-network/raiden that referenced this issue Dec 8, 2020
`pip >= 20.3` is using a new resolver that no longer accepts extras in
constraints files.

In the `install-dev` task we used to pass our requirements-dev.txt file
verbatim as a constraints file to ensure additional local developer
tools (via `requirerments-local.txt`) don't cause breakage.

For now pre-process the requirements file with sed to remove extras.
See: pypa/pip#9209
karlb pushed a commit to raiden-network/raiden that referenced this issue Apr 23, 2021
`pip >= 20.3` is using a new resolver that no longer accepts extras in
constraints files.

In the `install-dev` task we used to pass our requirements-dev.txt file
verbatim as a constraints file to ensure additional local developer
tools (via `requirerments-local.txt`) don't cause breakage.

For now pre-process the requirements file with sed to remove extras.
See: pypa/pip#9209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: constraint Dealing with "constraints" (the -c option) type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants