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

Improve install conflict warning #8594

Merged
merged 14 commits into from Jul 28, 2020

Conversation

pradyunsg
Copy link
Member

@pradyunsg pradyunsg commented Jul 17, 2020

Closes #8546
Resolves #8513

Changes

Installing collected packages: pycodestyle, flake8-import-order, mccabe, pyflakes, flake8
ERROR: flake8 3.5.0 requires mccabe<0.7.0,>=0.6.0, but you'll have mccabe 0.5.3 which is incompatible.
ERROR: flake8 3.5.0 requires pycodestyle<2.4.0,>=2.0.0, but you'll have pycodestyle 2.6.0 which is incompatible.
Successfully installed flake8-3.5.0 flake8-import-order-0.17.1 mccabe-0.5.3 pycodestyle-2.6.0 pyflakes-1.6.0

To

Installing collected packages: pycodestyle, flake8-import-order, pyflakes, mccabe, flake8
ERROR: Pip will install or upgrade your package(s) and its dependencies without taking into account other packages you already have installed. This may cause an uncaught dependency conflict. If you would like pip to take your other packages into account, please tell us here: https://forms.gle/cWKMoDs8sUVE29hz9
flake8 3.5.0 requires mccabe<0.7.0,>=0.6.0, but you'll have mccabe 0.5.3 which is incompatible.
flake8 3.5.0 requires pycodestyle<2.4.0,>=2.0.0, but you'll have pycodestyle 2.6.0 which is incompatible.
Successfully installed flake8-3.5.0 flake8-import-order-0.17.1 mccabe-0.5.3 pycodestyle-2.6.0 pyflakes-1.6.0

@pradyunsg pradyunsg added the skip news Does not need a NEWS file entry (eg: trivial changes) label Jul 17, 2020
@pradyunsg
Copy link
Member Author

I think this doesn't need dedicated tests, since (1) I'm lazy (2) see 1 and (3) this is an error messaging change and I'm genuinely not sure if we need additional tests for this.

Oh, and because I'm bored, here's before/after screenshots, from a 80-char wide terminal:

Before:

Screenshot 2020-07-17 at 6 17 28 AM

After:

Screenshot 2020-07-17 at 6 18 44 AM

Honestly, I don't like how either output looks but that's maybe more #4649 thing. :)

src/pip/_internal/commands/install.py Outdated Show resolved Hide resolved
@pradyunsg pradyunsg added this to the 20.2 milestone Jul 22, 2020
@ei8fdb
Copy link
Contributor

ei8fdb commented Jul 22, 2020

I've posted recommendation on in #8546 what the output message should be, how it should be formatted and how a portion should be hidden after 48 hours.

@pradyunsg pradyunsg force-pushed the improve-install-conflict-warning branch 2 times, most recently from e3defa0 to 08cc238 Compare July 27, 2020 08:13
@pradyunsg pradyunsg force-pushed the improve-install-conflict-warning branch from 08cc238 to 8db3542 Compare July 27, 2020 08:21
@pradyunsg
Copy link
Member Author

Okay, looks like past me wrote a lot more tests than I'd thought. :)

I'll let the CI run and come back after lunch.

@pradyunsg pradyunsg force-pushed the improve-install-conflict-warning branch from bcb80d7 to 3962f9d Compare July 27, 2020 14:23
@pradyunsg
Copy link
Member Author

E AssertionError: regex ['c==1\.0\.0', 'incompatible'] not found in stderr: u'DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support\nERROR: Exception:\nTraceback (most recent call last):\n File "/tmp/pytest-of-vsts/pytest-1/popen-gw1/pip0/pip/src/pip/_internal/cli/base_command.py", line 216, in _main\n status = self.run(options, args)\n File "/tmp/pytest-of-vsts/pytest-1/popen-gw1/pip0/pip/src/pip/_internal/cli/req_command.py", line 182, in wrapper\n return func(self, options, args)\n File "/tmp/pytest-of-vsts/pytest-1/popen-gw1/pip0/pip/src/pip/_internal/commands/install.py", line 450, in run\n new_resolver='2020-resolver' in options.features_enabled,\n File "/tmp/pytest-of-vsts/pytest-1/popen-gw1/pip0/pip/src/pip/_internal/commands/install.py", line 561, in _warn_about_conflicts\n elif not today_is_later_than(year=2020, month=7, day=31):\n File "/tmp/pytest-of-vsts/pytest-1/popen-gw1/pip0/pip/src/pip/_internal/utils/datetime.py", line 9, in today_is_later_than\n today = datetime.date.today()\nAttributeError: 'module' object has no attribute 'date'\n'

OH COME ON.

@pradyunsg pradyunsg marked this pull request as ready for review July 28, 2020 10:17
@pradyunsg pradyunsg closed this Jul 28, 2020
@pradyunsg pradyunsg reopened this Jul 28, 2020
@pradyunsg
Copy link
Member Author

Retriggered the CI -- hopefully it'll not fail again because PyPI wasn't responding to XMLRPC for a minute.

@pradyunsg
Copy link
Member Author

Thanks for the review @pfmoore!

@pradyunsg pradyunsg merged commit a8edffd into pypa:master Jul 28, 2020
@pradyunsg pradyunsg deleted the improve-install-conflict-warning branch July 28, 2020 12:52
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip news Does not need a NEWS file entry (eg: trivial changes)
Projects
None yet
4 participants