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

Pass --ignore-installed and other flags to pip install #62

Closed
petobens opened this issue Apr 26, 2018 · 8 comments
Closed

Pass --ignore-installed and other flags to pip install #62

petobens opened this issue Apr 26, 2018 · 8 comments

Comments

@petobens
Copy link

Is there a way to pass the --ignore-installed flag? If there isn't can you add the feature? Thanks!

@jgonggrijp jgonggrijp assigned jgonggrijp and unassigned jgonggrijp Apr 26, 2018
@jgonggrijp
Copy link
Owner

Currently, pip-review passes all arguments it doesn't recognise to pip list but not to pip install (to which the --ignore-installed flag belongs). So no, currently there is no way to do that.

Adding it is not trivial. Naievely, we could try to just pass all unknown options both to pip list and to pip install, but that wouldn't work because there are several options to pip list that pip install doesn't recognize and vice versa. So we'd need a clever way to distinguish options that should be forwarded to pip list from options that should be forwarded to pip install. We could hardcode some options, but I'm not a fan of that. Suggestions welcome.

@jgonggrijp jgonggrijp changed the title Pass --ignore-installed flag Pass --ignore-installed and other flags to pip install Apr 26, 2018
@petobens
Copy link
Author

Ok. Will set the option through the pip config file in the mean time. Thanks for the quick reply.

@jgonggrijp
Copy link
Owner

I think I want to go for a compromise: hardcode a set of options that is recognized by pip list but not by pip install and vice versa. Pass those options only to the respective pip command. Pass all other unrecognized options to both.

This approach would mostly fix bugs, especially with the --user flag, but it may also cause unexpected behaviour in some cases. Technically, it is a breaking change. Opinions welcome: should I leave this for the 2.0 release, or could it be in a 1.x release?

@bobzomer
Copy link

bobzomer commented Sep 5, 2019

To avoid breaking change, we could add two new specific options:

  • --install_only_parameters: All the parameters after this will be sent to install only
  • --common_parameters: All the parameters after this will be sent to both list and install
    Without these parameters, the unknown parameters are sent to list only => we keep a full backward compatibility.

@jgonggrijp
Copy link
Owner

@bobzomer Clever! But isn't that a bit long-winded? If somebody is using the --user flag, they'll have to choose between two evils:

  • pip-review -i --user, which is broken, or
  • pip-review -i --common_parameters --user, which is rather long to type.

I imagine such users would happily accept a little bit of breaking change so they can have a short command that works correctly.

@tan-wei
Copy link

tan-wei commented Mar 17, 2020

Waiting for the update which makes --user more useful.

@jgonggrijp
Copy link
Owner

@tan-wei @bobzomer @petobens @joshbode @mihaic @HaleTom @x-ji @cjbassi @dimitry-ishenko @Konfekt This should be solved in version 1.1.0. Please install the update and report back here if there is still something not working.

Also, I'm looking for somebody to take over. See #76.

@tan-wei
Copy link

tan-wei commented Mar 25, 2020

Thanks. I can confirm it works well on Manjaro now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants