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

Docs: add instructions on config to default to new resolver #8661

Closed
brainwane opened this issue Jul 30, 2020 · 10 comments · Fixed by #8942
Closed

Docs: add instructions on config to default to new resolver #8661

brainwane opened this issue Jul 30, 2020 · 10 comments · Fixed by #8942
Assignees
Labels
state: needs discussion This needs some more discussion type: docs Documentation related

Comments

@brainwane
Copy link
Contributor

Some people would like to set an environment variable manually on the command line, or something in pypi.rc or pip.conf, so they can tell pip to default to the new resolver #6536 #988 and test it more easily, without having to manually include --use-feature=2020-resolver each time. Example via Twitter:

It would be handy to be able to enable the new deps resolver via an env var. This would allow testing it in conjunction with tools such as poetry and pipenv.

@Julian in IRC logs suggested editing pip.conf and daturkel says this worked:

[install]
use-feature = 2020-resolver

We should decide whether we want to support this, and then if we do, we should add a line about it to the how-to-test docs.

@brainwane brainwane added type: docs Documentation related state: needs discussion This needs some more discussion C: new resolver labels Jul 30, 2020
@pfmoore
Copy link
Member

pfmoore commented Jul 30, 2020

This is standard pip functionality (both environment variable and config file), so yes, we should support it. I'm not sure we want to promote it, though, as I feel like it would be awfully easy for people to forget they had it set and use it in a live environment without meaning to.

@lig
Copy link

lig commented Jul 30, 2020

@pfmoore the point on accidental production user is fair. In case of an environment variable it seems reasonable to advice using env utility or local .env file.

@pradyunsg
Copy link
Member

pradyunsg commented Jul 30, 2020

We do support this. I agree that we should mention this in the testing guide, albeit with a note/caveat mentioning how this will persist after you set it. I'm happy to expect folks who do this testing (which has "don't use in prod" very clearly stated) to be cautious and aware of the fact that they have set this variable/config-file value. :)

@brainwane
Copy link
Contributor Author

OK! What recommendation should we make?

@pradyunsg
Copy link
Member

pradyunsg commented Jul 31, 2020

I think the easiest way to do this might be pip config set global.use-feature 2020-resolver... so that? And mentioning PIP_USE_FEATURE (env var) as well.

The other option is describing how you have to edit the relevant file and the format of it.

@akaihola
Copy link
Contributor

Note that if you modify configuration using

pip config set global.use-feature 2020-resolver

it isn't possible to disable the resolver simply using

pip config unset global.use-feature

Instead, you'll need

pip config unset --user global.use-feature

I see this behavior on Fedora 30, Python 3.7 and pip 20.2.

@McSinyx
Copy link
Contributor

McSinyx commented Jul 31, 2020

I can't reproduce this on my Debian machine with CPython 3.8 and pip 20.2. pip config unset global.use-feature does unset the feature, but I notice that it unsets the entire option and AFAIK there's yet to be a way to deselect just one feature. I'm wondering if we want to support that, and if so I'll file a separate ticket tracking it.

@akaihola, I wonder what pip config debug says on your system.

@akaihola
Copy link
Contributor

akaihola commented Aug 4, 2020

@McSinyx, after running pip config set global.use-feature 2020-resolver, the pip config debug command shows

env_var:
env:
global:
  /etc/xdg/pip/pip.conf, exists: False
  /etc/pip.conf, exists: False
site:
  /usr/pip.conf, exists: False
user:
  /home/akaihola/.pip/pip.conf, exists: False
  /home/akaihola/.config/pip/pip.conf, exists: True

@pradyunsg
Copy link
Member

pradyunsg commented Aug 18, 2020

I think the easiest way to do this might be pip config set global.use-feature 2020-resolver... so that? And mentioning PIP_USE_FEATURE (env var) as well.

Let's add this to the documentation, with a link to this bug in case people need variations/help with the variations.

@pradyunsg
Copy link
Member

@akaihola Could you file a new issue for the behavior you're seeing? It seems like a bug in pip config or something that's more environment specific.

@pradyunsg pradyunsg assigned pradyunsg and brainwane and unassigned pradyunsg Aug 18, 2020
brainwane added a commit to brainwane/pip that referenced this issue Sep 30, 2020
brainwane added a commit to brainwane/pip that referenced this issue Sep 30, 2020
brainwane added a commit to brainwane/pip that referenced this issue Sep 30, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
state: needs discussion This needs some more discussion type: docs Documentation related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants