Skip to content

Change pip --force-reinstall behaviour #8238

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

Open
ei8fdb opened this issue May 14, 2020 · 2 comments
Open

Change pip --force-reinstall behaviour #8238

ei8fdb opened this issue May 14, 2020 · 2 comments
Labels
UX: functionality research epic Temporary label to link tickets to #8516 UX User experience related

Comments

@ei8fdb
Copy link
Contributor

ei8fdb commented May 14, 2020

What is this?

This is a proposal to make pip how pip --force-reinstall works.

The difficulty here is this is current behaviour, and this would modify how pip works.

What is the problem?

Currently, when pip install [package-name] --force-reinstall is executed, instead of reinstalling the package at the version previously installed, pip installs the package at the newest version available.

i.e. pip install [package name] --force-reinstall acts as pip [package name] --upgrade

Using the Nielsen Norman good usability heuristics, this behaviour goes against #2: Match between system and the real world. This behaviour would be confusing to a new pip user.

What does pip user guide say?

About --force-reinstall the pip user guide says:

Reinstall all packages even if they are already up-to-date.

Replicate

See below:

testbox@testbox:/code/reinstall-test$ pip install click==5.0.0
Collecting click==5.0.0
Downloading https://files.pythonhosted.org/packages/af/55/056901e9f504a7cda9e955592360ce2c516b2b92f3da9318ba074be5d280/click-5.0-py2.py3-none-any.whl (65kB)
100% |████████████████████████████████| 71kB 441kB/s
Installing collected packages: click
Successfully installed click-5.0
osboxes@osboxes:
/code/reinstall-test$ pip install --force-reinstall click
Collecting click
Downloading https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl (82kB)
100% |████████████████████████████████| 92kB 303kB/s
Installing collected packages: click
Found existing installation: click 5.0
Uninstalling click-5.0:
Successfully uninstalled click-5.0
Successfully installed click-7.1.2

Possible solutions

Best solution

When the user issues:

pip install [package name] --force-reinstall

they are prompted:
You had [package name] version [a.b.c] installed. Would you like to update to version [a.b.f]? Y/N

This solution would:

  1. make --force-reinstall behave as expected
  2. maintain previous behaviour if the user requested it

Minimum solution

When a user issues:

pip install [package name] --force-reinstall

[package name] is reinstalled at the version it was previously installed at.

Other solutions

  • deprecate the --force-install

Next steps

Carry out a survey of pip users to get their understanding of what pip --force-reinstall does and should do, and what their opinions would be if the change to behaviour was made.

Based on a Zulip thread about about confusing current pip behaviour, we should audit the current pip commands to see they match the executed commands.

https://www.notion.so/simplysecure/Improve-the-CLI-structure-8238-d13ed2b1d0b64449b532cddd6df90a0e

Additional context**

Link to the discussion in Zulip.

@ghost ghost added the S: needs triage Issues/PRs that need to be triaged label May 14, 2020
@pradyunsg pradyunsg added the UX User experience related label May 14, 2020
@ghost ghost removed the S: needs triage Issues/PRs that need to be triaged label May 14, 2020
@ei8fdb ei8fdb changed the title Improve the CLI structure Make pip -- reinstall behave as expected May 20, 2020
@ei8fdb ei8fdb changed the title Make pip -- reinstall behave as expected pip --force-reinstall behaves as pip --upgrade May 20, 2020
@ei8fdb ei8fdb changed the title pip --force-reinstall behaves as pip --upgrade Change pip --force-reinstall behaviour May 20, 2020
@nlhkabu nlhkabu added the UX: functionality research epic Temporary label to link tickets to #8516 label Jul 28, 2020
@nlhkabu
Copy link
Member

nlhkabu commented Jul 28, 2020

Adding this to the functionality research epic.

@brainwane
Copy link
Contributor

As of right now, Pradyun, Georgia and I think that this doesn't need to happen in time for 20.3. But @ei8fdb and @nlhkabu please speak up if you think there is a strong chance that #8516 will lead us to need to change functionality by pip 20.3 in October, and we'll reprioritize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UX: functionality research epic Temporary label to link tickets to #8516 UX User experience related
Projects
None yet
Development

No branches or pull requests

4 participants