1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
Commit graph

131 commits

Author SHA1 Message Date
q0w 0c284520c6
Filter available distributions using hash declarations from constraints files (#10962) 2022-03-16 07:43:06 +00:00
Tzu-ping Chung d61b539353 More structured link evaluation result
A new enum class is implemented for the link evaluator to use instead
of a simple boolean to better distinguish between various evaluation
errors. This allows the caller to better distinguish error sources with
a structured check instead of fragile error string comparison.
2022-03-10 20:41:26 +08:00
Tzu-ping Chung 2e5e9e54bc
Merge branch 'main' into requires-python 2022-03-10 15:41:05 +08:00
Pradyun Gedam 8b36ba5d94
Fix typo
explicit{ely -> ly}
2022-01-29 09:11:51 +00:00
Pradyun Gedam 9d0db8839f
Add --use-deprecated=backtrack-on-build-failures
This serves as an opt-out from build failures causing the entire
installation to abort.
2022-01-27 18:11:05 +00:00
Pradyun Gedam 8eeee22304
Abort immediately on metadata generation failure instead of backtracking
This behaviour is more forgiving when a source distribution cannot be
installed (eg: due to missing build dependencies or platform
incompatibility) and favours early eager failures instead of trying to
ensure that a package is installed regardless of the amount of effort it
takes.
2022-01-27 18:11:02 +00:00
Pradyun Gedam a835e0a277
Prettify messages for discarding candidates due to issues
These are more pleasing colours and, more importantly, a clearer
presentation style of the package vs the error.
2022-01-25 01:38:23 +00:00
Pradyun Gedam 997c5a742b
Merge pull request #10625 from albertosottile/ignore_yanked 2022-01-24 23:47:54 +00:00
Alberto Sottile 705742337d Implement suggested changes 2021-11-07 21:26:12 +01:00
Alberto Sottile d1ba9d519e Fix permissions 2021-11-07 11:36:52 +01:00
Alberto Sottile 8293826bf0 Change specifier detection logic to exclude compatible release clauses 2021-11-06 16:24:00 +01:00
Ed Morley cfbdc48635
Update the docs URL shown for ResolutionImpossible errors
Previously the `ResolutionImpossible` error message referenced:
https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

However that section was moved in #10279, to:
https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Updating the URL not only saves a click, but also saves having to find the related
content halfway-down the dependency resolution page, since the forwarding link 
was to the top of the page rather than the specific section.
2021-11-03 09:38:27 +00:00
Alberto Sottile 6b62c28060 Skip yanked releases unless specified 2021-10-30 11:40:40 +02:00
Alex Hedges e1f81bfa4d Fix many typos 2021-10-11 15:48:17 -04:00
Joseph Bylund dee6690f06 Renames, moves, docstrings, comments 2021-10-07 07:11:33 -04:00
Joseph Bylund bd87828eae (joe) black + imports 2021-10-06 12:48:48 -04:00
Joseph Bylund bb8824439e (joe) requirement creation is very expensive, and at least in my test case there were only ~200 unique requirement objects created in ~5-10 minutes of resolution time 2021-10-06 12:42:44 -04:00
Jon Dufresne 60c274be2d Complete type annotations of tests/unit/ directory 2021-09-23 05:44:54 -07:00
ronaudinho 22ea509025
update log message 2021-09-21 00:33:02 +07:00
ronaudinho f2727bcf11 include skips due to requires-python in logged links 2021-09-19 12:55:29 +07:00
ronaudinho 42613daf36 explain requires-python ignored links 2021-09-19 12:54:12 +07:00
Tzu-ping Chung 135faabfd6
Remove direct pkg_resource usages from resolver and preparer 2021-08-23 02:07:33 +08:00
Tzu-ping Chung d4d2445350 Remove get_installed_distributions usages
The function itself is kept for now because it's currently used to test
the pip.metadata subpackage...
2021-07-22 23:22:12 +08:00
Tzu-ping Chung 73edd74c56 Detect user-requested package names by preparing
This always prepares each explicit requirements when the resolver is
run, instead of when they are being resolved. But we always want to
prepare them anyway (an explicit requirement has only one candidate, so
it's either do or die), so this is not really a problem.
2021-07-12 12:40:34 +08:00
Tzu-ping Chung 5d81040ee8 Refactor root requirement collection into factory 2021-07-12 12:40:32 +08:00
Harutaka Kawamura 72e1ff35c7
Complete type annotations in pip/_internal/resolution (#10125) 2021-07-12 11:41:48 +08:00
briantracy 37a2b12a21
Special case warning for requirements.txt install (#9915)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2021-07-12 11:40:43 +08:00
Tzu-ping Chung d18ac6250e Exclude a known incompatible installed candidate
The resolver collects previously known incompatibilites and sends them
to the provider. But previously the provider does not correctly exclude
the currently-installed candidate if it is present in that
incompatibility list, causing the resolver to enter a loop trying that
same candidate. This patch correctly applies incompat_ids when producing
an AlreadyInstalledCandidate and exclude it if its id() is in the set.
2021-05-18 23:00:25 +08:00
Tzu-ping Chung cf4e3aa055 Remove stray id(candidate) call
Also moves the incompatibility candidate calculation to closer to their
usages.
2021-04-24 02:09:24 +08:00
Tzu-ping Chung 9cab9834fa Refactor Factory.find_candidates() for readability 2021-04-19 12:21:35 +08:00
Tzu-ping Chung 0305e0d596 Implement extra-ed requirement merging
When a requirement is requested multiple times, some via a direct URL
("req @ URL") and some not but with extras ("req[extra] VERSION"), the
resolver previous could not correctly find "req[extra]" if "req" is
available in an index.

This additional logic makes the resolver, when encountering a
requirement with identifier "req[extra]", to also look for explicit
candidates listed under "req", and add them as found matches for
"req[extra]".
2021-04-19 08:37:35 +08:00
Stéphane Bidoul 8fc65ea53f
Merge pull request #9673 from mwchase/url-constraints-final-2
Support URL constraints in the new resolver
2021-04-18 12:31:45 +02:00
Max W Chase 4c69ab2a2c Support URL constraints in the new resolver
Fixes #8253
2021-04-17 07:59:57 -04:00
Tzu-ping Chung 4e56f1c52d Take responsibility to remove incompatibilities 2021-04-04 20:39:28 +08:00
Tzu-ping Chung 9ceabb568f Add note to explain the cast 2021-04-03 16:25:38 +08:00
Tzu-ping Chung 0d39ae9734 Pull in resolvelib's typing information 2021-04-03 16:25:38 +08:00
Andrey Bienkowski 622f104694 Use f-strings for formatting
suggested by pyupgrade --py36-plus
2021-03-30 15:48:27 +03:00
Tzu-ping Chung 56a8f3d8bd Typing fixes 2021-03-10 16:40:58 +08:00
Tzu-ping Chung 80e0163e03
Merge pull request #9552
From uranusjr/new-resolver-requires-python-error
2021-03-08 02:26:20 +08:00
Blazej Michalik d1d914597c
Refactor set(...){...}
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2021-02-28 00:41:04 +01:00
Tzu-ping Chung d87abdfdfe Fix error reporting on Requires-Python conflicts 2021-02-28 07:31:39 +08:00
Blazej Michalik a2c57948b6 Bring back the "from versions:" message
In the new resolver the "(from versions ...)" message, shown on
failure to resolve a package, has been removed. This commit brings it
back.
2021-02-27 20:37:10 +01:00
Tzu-ping Chung 917ecadd77 Show constraint in error message 2021-02-23 02:08:19 +08:00
Jon Dufresne 8a6f6ac19b Blacken src/pip/_internal/resolution directory 2021-02-20 06:51:44 -08:00
Jon Dufresne 0945809afc Remove typing.TYPE_CHECKING guards
The typing module has been available since Python 3.5. Guarding the
import has been unnecessary since dropping Python 2.

Some guards remain to either:

- Avoid circular imports
- Importing objects that are also guarded by typing.TYPE_CHECKING
- Avoid mypy_extensions dependency
2021-02-19 18:34:21 -08:00
Jon Dufresne a6392bd62e Replace pip._internal.utils.typing with stdlib typing
The stdlib module has been available since Python 3.5 and the
TYPE_CHECKING constant has been available since 3.5.2.

By using stdlib, this removes the need for pip to maintain its own
Python 2 typing compatibility shim.
2021-02-18 19:09:13 -08:00
Tzu-ping Chung 2e70ec0751 Create the candidate lazily to avoid download 2021-01-27 19:58:24 +08:00
Tzu-ping Chung 79cbe6b93f Avoid downloading candidates of a same version
Since 41a30089de, Candidate objects prepare their underlying
distribution eagerly on creation, so the error can be caught
deterministically to trigger backtracking.

This however has a negative side-effect. Since dist preparation involves
metadata validation, a remote distribution must be downloaded on
Candidate creation. This means that an sdist will be downloaded,
validated, and discarded (since its version is known to be incompatible)
during backtracking.

This commit moves version deduplication of candidates from indexes to
before the Candidate object is created, to avoid unneeded preparation.

Note that we still need another round of deduplication in FoundCandidates
to remove duplicated candidates when a distribution is already installed.
2021-01-06 17:19:59 +08:00
Jon Dufresne 133e146a88 Remove unused type VersionCandidate
Unused since 6a8956d7a8.
2020-12-28 19:18:20 -08:00
Tzu-ping Chung 41a30089de Re-apply invalid metadata skip
Skip candidate not providing valid metadata

This reverts commit 7165ab8cb9.
2020-12-27 04:16:24 +08:00