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

72 commits

Author SHA1 Message Date
Tzu-ping Chung
d589795834 Allow constraining an explicit requirement 2020-11-21 22:14:24 +08:00
Tzu-ping Chung
bf55229fc6 Use set to dedup package list in error message 2020-11-04 21:29:19 +08:00
Xavier Fernandez
fad456a165 resolver: stabilize output for tests (& users)
Otherwise the test_install_distribution_union_with_versions test can end
up with either:

    Cannot install localextras[bar] 0.0.2 and localextras[baz] 0.0.1 because these package versions have conflicting dependencies.

or

    Cannot install localextras[baz] 0.0.2 and localextras[bar] 0.0.1 because these package versions have conflicting dependencies.
2020-10-31 00:07:34 +01:00
Tzu-ping Chung
8326148149 Implement "lazy sequence" to avoid Internet
find_matches() is modified to return a special type that implements
the sequence protocol (instead of a plain list). This special sequence
type tries to use the installed candidate as the first element if
possible, and only access indexes when the installed candidate is
considered unsatisfactory.
2020-10-13 16:06:00 +08:00
Noah Gorny
960dca9949 resolvelib: factory: Get installed distributions correctly 2020-10-10 02:23:08 +03:00
Pradyun Gedam
25ab172b55
Update linter: isort 2020-09-23 19:52:28 +05:30
Pradyun Gedam
e61bb616ef
Merge pull request #8839 from uranusjr/new-resolver-hash-intersect 2020-09-17 10:58:44 +05:30
cca500f053 Remove unused definitions 2020-09-04 17:37:43 +07:00
Tzu-ping Chung
dfaa111004 Pull in hashes from constraint files 2020-09-03 17:26:52 +08:00
Tzu-ping Chung
700eb7734f Hashes from lines should intersect, not union 2020-09-03 17:19:01 +08:00
Pradyun Gedam
ee4371c386
Merge pull request #8685 from chrahunt/use-preparer-for-lazy-wheels 2020-08-04 18:46:56 +05:30
Chris Hunt
f0d4df10eb Propagate lazy_wheel option through RequirementPreparer
Reduces dependence on Candidate (and Resolver (and Factory)).
2020-08-02 18:40:11 -04:00
Pradyun Gedam
c412613efe
Tweak ResolutionImpossible error line
This makes it more consistent with how error "summary" lines look.

eg:
     IndexError: list index out of range
      ModuleNotFoundError: No module named 'notamodule'
2020-08-02 07:55:49 +05:30
Pradyun Gedam
b97c199cf7
Point to latest documentation
This allows us to update the content users would see as we get feedback.
2020-08-02 07:53:02 +05:30
Tzu-ping Chung
3ff9ee151d Account for comes_from string 2020-07-26 15:59:42 +08:00
5d15291274 Use lazy wheel to obtain dep info for new resolver 2020-07-21 16:00:34 +07:00
f8b06a3906 Enable flake8-logging-format 2020-07-17 14:33:19 +07:00
Pradyun Gedam
b419ca7317
Fix the link on new-resolver dependency conflicts 2020-07-17 06:03:01 +05:30
Tzu-ping Chung
01e0700e68 Skip installing if the version matches locally
This check only applies to explicit requirements since we avoid
downloading the dist from finder altogether when there is a matching
installation (although the check wouldn’t change the behaviour in that
case anyway).

We can do this when we build the `ExplicitRequirement` instead, like how
we did for `SpecifierRequirement`, but that would require us to resolve
the direct requirement’s version eagerly, which I don’t want to.

The implemented approach checks the version only after resolution, at
which point the distribution is already built anyway and the operation
is cheap.
2020-07-06 11:06:14 +08:00
Paul Moore
d287033599
Merge pull request #8394 from pfmoore/nr_conflict_message
Improve the message for "Resolution Conflict" errors
2020-06-18 13:45:51 +01:00
Paul Moore
868ba81a74 Next iteration of message 2020-06-17 17:11:32 +01:00
Paul Moore
2795742b31 Add handling of inconsistent root requirements 2020-06-17 16:47:04 +01:00
Paul Moore
09d311594e Move error handling to factory.get_installation_error() 2020-06-17 16:44:53 +01:00
Tzu-ping Chung
ebb90c6411 Reject incompatibile direct wheel link
This mirrors the behavior in the legacy resolver. In the future we may
want to backtrack in this situation instead, but I haven't found a clean
way to do this. We may need to introduce an "empty" requirement class.

The `PackageFinder.target_python` interface is also not the most clean.
Maybe we should expose the target Python object instead. Not sure yet.
2020-06-10 20:57:23 +08:00
Tzu-ping Chung
e647b12540 Yield installed candidate at the correct position 2020-06-05 08:17:28 +08:00
Tzu-ping Chung
1719fc3dcc Merge spec->req constructors
Since both functions now return Optional[Requirement], we can just use
the same implementation.
2020-06-02 12:02:52 +08:00
Tzu-ping Chung
d5204dd0ba Move markers check into the ireq->req constructor
This makes the check apply to ALL requirement constructions, no
exceptions.
2020-06-02 12:02:52 +08:00
Pradyun Gedam
b5a5bcf13b
Rename parent to template 2020-05-28 18:50:09 +05:30
Tzu-ping Chung
9ee19a1190 Always use frozenset 2020-05-27 23:10:56 +08:00
Tzu-ping Chung
b8404fde99 Always read extras from InstallRequirement.extras 2020-05-27 23:10:56 +08:00
Tzu-ping Chung
6c6b6a7765 Implement new Provider.find_matches() 2020-05-27 23:10:56 +08:00
Tzu-ping Chung
48c3d0c8ec Typo in docstring
Co-authored-by: Paul Moore <p.f.moore@gmail.com>
2020-05-27 20:19:38 +08:00
Tzu-ping Chung
bc9b288b1e Implement wheel cache lookup in the new resolver 2020-05-27 20:19:37 +08:00
Tzu-ping Chung
dab7b94ade Derive Requirement name from ireq is possible
This is useful when resolving the wheel cache.
2020-05-27 20:19:37 +08:00
Pradyun Gedam
901898c84f
Make mypy happy 2020-05-21 21:47:42 +05:30
Pradyun Gedam
775f9ff6ca
Add a helper for making ExplicitRequirement objects 2020-05-21 21:47:38 +05:30
Tzu-ping Chung
de63eae0c3 Match logging 2020-05-21 18:09:35 +08:00
Tzu-ping Chung
e6352bc468 Return package dependencies only if markers match 2020-05-21 16:14:26 +08:00
Tzu-ping Chung
f39134699b Avoid the horrendous line break for type hints 2020-05-18 17:15:06 +08:00
Tzu-ping Chung
ec86cb1970 Use OrderedDict to prefer links found *later* 2020-05-18 16:35:09 +08:00
Paul Moore
e28b388c73
Merge pull request #7997 from uranusjr/resolver-use-user-site
New resolver: implement --user
2020-05-15 20:01:50 +01:00
Paul Moore
96b3377cd7 Type annotations 2020-05-15 10:57:07 +01:00
Paul Moore
9cf1bed78d Address review comments 2020-05-14 11:33:30 +01:00
Paul Moore
ddbc8fd7c1 Split find_matches into generation and sorting 2020-05-13 17:52:09 +01:00
Tzu-ping Chung
d8062791dd Implement use-user-site 2020-05-06 03:48:34 +08:00
Tzu-ping Chung
647dc6e128 Include prereleases in specifier check 2020-05-04 02:08:27 +08:00
Paul Moore
1599cc2a36 Merge branch 'master' into nr_upgrade_strategy 2020-05-03 11:01:27 +01:00
Paul Moore
1eb7011da4 Add an assertion that upgrade_strategy is valid 2020-04-28 10:39:53 +01:00
Tzu-ping Chung
d8aede42d1 Correctly pass extras to explicit requirement
Local source directory is still not working due to some other reasons.
Need to investigate.
2020-04-27 14:23:15 +08:00
Paul Moore
7a54b2b3a8 Use is_direct rather than an explicit root parameter 2020-04-24 14:30:34 +01:00