Commit Graph

3574 Commits

Author SHA1 Message Date
Pradyun Gedam cf3696a81b
Merge pull request #11080 from sbidoul/requested-with-constraints
Fix REQUESTED in presence of URL constraints
2022-05-06 18:15:35 +01:00
Stéphane Bidoul 52fd6436a2
Fix propagation of user_supplied with URL constrains 2022-05-01 19:43:25 +02:00
wim glenn 32f642d123 provide a better error message for "pip config get index-url" 2022-04-29 22:51:16 -05:00
wim glenn 4b35763d5f ``pip config`` normalizes names, converting underscores into dashes. closes #9330 2022-04-29 22:38:38 -05:00
Paul Moore cdeb8f9e63
Merge pull request #11059 from pfmoore/config_settings
Add a UI to set config settings for PEP 517 backends
2022-04-29 12:58:32 +01:00
wim glenn 6313d866e5
Improve ``pip config --help`` text (#11074) 2022-04-29 10:32:52 +01:00
Pradyun Gedam 7eb75413e8
Merge pull request #10959 from pradyunsg/better-upgrade-warning
Improve the presentation style of the pip upgrade prompt
2022-04-28 18:26:43 +01:00
Pradyun Gedam 7164b1af50
Merge pull request #10827 from q0w/project-urls
Include Project-URLs in `pip show -v` output
2022-04-23 21:39:51 +01:00
Tomáš Hrnčiar 452d7da880
Fallback to pyproject.toml-based builds if setuptools cannot be imported (#10717)
This fallback is only triggered if the project has a `setup.py` file.

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2022-04-23 15:56:59 +01:00
Paul Moore 4db45851b6 Explicitly test installs (and fix a bug found by those tests!) 2022-04-23 13:14:22 +01:00
Pradyun Gedam 85ccf51b64
Better accomodate for case-insensitive file systems 2022-04-23 12:30:43 +01:00
Pradyun Gedam 4e53eaf3e7
Use `python -m pip` for the upgrade prompt on Windows 2022-04-23 12:30:43 +01:00
Pradyun Gedam ee72f55de6
Add an early return with comment if pip wasn't installed by pip
This addresses a review comment around the code style, and makes it
possible to provide additonal context in the comment.
2022-04-23 12:30:42 +01:00
Pradyun Gedam e247195e21 Move self-check logic into a dedicated function
This makes it easier to test this code.
2022-04-22 16:36:29 +01:00
Pradyun Gedam 59db67c8b2 Add some debugging logs to `self_outdated_check`
This would make it easier to diagnose what an issue might be, related to
this logic, since the things that affect whether the message is printed,
are now available in the debugging logs.
2022-04-22 16:36:29 +01:00
Pradyun Gedam 4a3c4c90ef Improve style of the pip upgrade prompt
This style makes the upgrade prompt less of blurb of yellow text, making
it easier to read while clarifying the presentation style to make it
easier to figure out what the user is supposed to run.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
2022-04-22 16:36:29 +01:00
Pradyun Gedam 4f35572ae7 Refactor the logic in self_outdated_check
- Move the lookup within `selfcheck/*.json` files into a method on
  `SelfCheckState`.
- Factor out `PackageFinder` interaction into a separate function.
- Rename variables to more clearly reflect what they're for.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
2022-04-22 16:36:29 +01:00
Pradyun Gedam ea0d976d9f Add a way to get a simpler invocation of pip
This makes it possible to provide more terse suggestions that are still
correct, depending on the user's environment.
2022-04-22 16:36:29 +01:00
Pradyun Gedam c4470ba3bd Rename `[present-diagnostic]` to `[present-rich]`
This makes it more reasonable to use a rich renderable for regular
logging messages, instead of only using it for the diagnostic error
messages.
2022-04-22 16:36:29 +01:00
Paul Moore 962b0738fd Add documentation 2022-04-22 10:42:16 +01:00
Paul Moore 044091afbf Don't assume options has a config_settings attribute 2022-04-21 22:53:11 +01:00
Paul Moore 6da9b5c694 Call the PEP 517 backend with the requirement's config settings 2022-04-21 18:30:48 +01:00
Paul Moore af28440792 Store config settings on the install requirement 2022-04-21 18:30:48 +01:00
Paul Moore 01690b8423 Add new --config-settings option to install and wheel commands 2022-04-21 18:30:48 +01:00
Stéphane Bidoul bc0f4c36ee
Remove resolved_revision from DirectUrl VcsInfo
Altough resolved_revision it is part of PEP 610, it is currently not
implemented in pip, so remove it from the code
base to avoid confusion.
2022-04-18 13:56:22 +02:00
Tzu-ping Chung 8133d83929
Merge pull request #11030 from uranusjr/build-env-req-check-evaluate-marker 2022-04-16 19:46:23 +08:00
Tzu-ping Chung 233db7c31b Skip conditional build req without matching marker 2022-04-16 16:02:15 +08:00
Pradyun Gedam c6e274e7fd
Merge pull request #10709 from uranusjr/metadata-importlib-backend 2022-04-15 12:49:32 +01:00
Frost Ming 6a1ed5c0f4
Add completion script for powershell (#9025) 2022-04-15 09:32:42 +01:00
Tzu-ping Chung 2e1112a814
Make the root warning silence flag multi-state (#11035)
Instead of a flag, make the option take an argument like this:

    --root-user-action=ignore

This allows us to add more alternatives in the future, for example to
emit a hard error when a root user is detected.

Also re-label the news fragment to point to the issue instead of the PR
that introduced the option.
2022-04-14 18:10:19 +01:00
Tzu-ping Chung ee81f71d7c Make version hack more reliable 2022-04-12 03:33:19 +08:00
Tzu-ping Chung f9e554c999 Fix outdated comments 2022-04-12 03:33:19 +08:00
Tzu-ping Chung b89408179c Add note on distutils expecting pathlib.Path
A distutils installation is always "flat" (not in e.g. egg form), so
if this distribution's info location is NOT a pathlib.Path (but e.g.
zipfile.Path), it can never contain any distutils scripts.
2022-04-12 03:33:19 +08:00
Tzu-ping Chung a55f0ddb23 Wording 2022-04-12 03:33:19 +08:00
Tzu-ping Chung 8073f65c14 Properly normalize and handle linked dist 2022-04-12 03:33:18 +08:00
Tzu-ping Chung eea84b33fb Clean up egg compatibility notes 2022-04-12 03:33:18 +08:00
Tzu-ping Chung 321c9675db Add compat shim to find eggs in importlib backend 2022-04-12 03:33:18 +08:00
Tzu-ping Chung 173ef62c8e Fix constructor arguments 2022-04-12 03:33:18 +08:00
Tzu-ping Chung 41de887ae0 Satisfy mypy 2022-04-12 03:33:18 +08:00
Tzu-ping Chung 0f085e1c85 Better ZIP support 2022-04-12 03:33:18 +08:00
Tzu-ping Chung 5e9c5ad252 Implement egg-link support 2022-04-12 03:33:18 +08:00
Tzu-ping Chung 4c096b752d Refactor importlib metadata backend to subpackage 2022-04-12 03:33:18 +08:00
Tzu-ping Chung 1544a31011 Implement our own requires.txt parser
This replaces importlib.metadata's parser and allows us to "properly"
normalize extras as we need. It is not wrong for importlib.metadata to
not normalize extras --- if extra normalization is standardized
properly, packaging.markers should instead implement 'evaluate()' to
properly normalize on comparison, instead of just doing a naive string
equality check. Unfortunately, no-one has made a concrete effort to make
that happen yet, so pip needs to do what it needs to do to keep things
working.
2022-04-12 03:33:18 +08:00
Tzu-ping Chung 1d22560c7d Evaluate dependencies for package without extras 2022-04-12 03:33:18 +08:00
Tzu-ping Chung b0ec2c0cd0 Only return one distribution under a name
This matches pkg_resources's behavior. There are various places in the
code base that assumes only one entry is returned for a package name,
and not doing that would potentially cause a distribution in lower
precedence path to override a higher precedence one, if the caller is
not careful.

Eventually we probably want to make it possible to see lower precedence
installations as well (it's useful), but this is not the time.
2022-04-12 03:33:18 +08:00
Tzu-ping Chung 4fd0e09a37 Rename iter_distribution() with 'all' for clarity 2022-04-12 03:33:15 +08:00
Tzu-ping Chung e371bf2498 Catch wheel content error to emit appropriate exception 2022-04-12 03:31:50 +08:00
Tzu-ping Chung 846d8e5965 Try to cover Path interface differences 2022-04-12 03:31:46 +08:00
Tzu-ping Chung e3952f8357 Fix unit test to check against the correct backend 2022-04-12 03:26:12 +08:00
Tzu-ping Chung a9cf547dd1 Add workflow to run tests against the new backend 2022-04-12 03:26:12 +08:00