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

93 commits

Author SHA1 Message Date
Nguyễn Gia Phong 29940371cc Fix typo and simplify ireq call 2020-05-16 12:04:17 +07:00
Paul Moore c74577e18e
Merge pull request #8186 from uranusjr/install-req-from-dist-line-rewrite
Build ireq line from parent for installed dist
2020-05-15 22:33:03 +01:00
Paul Moore c258a1f517 Fix some test failures related to message differences 2020-05-15 14:17:47 +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 6b34b39b7e Build ireq line from parent for installed dist 2020-05-04 02:19:12 +08:00
Paul Moore 218e7d830d
Merge pull request #8146 from uranusjr/new-resolver-extra-in-explicit-requirement
New resolver: Carry extras info in ExplicitRequirement
2020-05-03 10:57:48 +01:00
Tzu-ping Chung 06d9ea0952 Mark local install as xfail 2020-04-27 14:36:59 +08:00
Tzu-ping Chung e03614fe6d Use req to populate candidate line instead of link
This ensures a candidate built from a "found" link (from e.g. index) is
categorized as specifier-based, not URL-based. This is important to
avoid a specifier-based candidate to be 'pip freeze'-ed in the direct
URL form due to PEP 610 (direct-url.json).
2020-04-24 19:14:00 +08:00
Pradyun Gedam 8cca170ceb
Merge pull request #7976 from uranusjr/installed-candidate-equal
New Resolver: Implement equality on candidate classes
2020-04-10 18:57:56 +05:30
Tzu-ping Chung 56e065f956 Move dist preparation to its own method 2020-04-09 02:27:37 +08:00
Tzu-ping Chung a7d17f8da6 Make sure candidates are prepared after resolution 2020-04-08 23:38:10 +08:00
Tzu-ping Chung 591d476fca Note on why we don't implement equality 2020-04-08 16:38:47 +08:00
Tzu-ping Chung 018c051a8e Implement equality on candidate classes 2020-04-08 16:38:47 +08:00
Paul Moore bd912cf0de
Merge pull request #7993 from uranusjr/new-resolver-normal-test-progress
Canonicalise project name from InstallationCandidate
2020-04-08 09:12:50 +01:00
Tzu-ping Chung 6d40804b12 Add __repr__ to requirement/candidate models 2020-04-07 20:53:25 +08:00
Tzu-ping Chung 2f36ac7587 Add assertion message for easier debugging 2020-04-07 19:02:17 +08:00
Tzu-ping Chung 74c5042052 Accept InsatllRequirement as comes_from 2020-04-05 12:17:25 +08:00
Tzu-ping Chung aead201fda No need to think about editable for installed dist 2020-04-04 21:53:04 +08:00
Tzu-ping Chung 05f7dbd0c8 Type hint hacks 2020-04-04 18:15:26 +08:00
Tzu-ping Chung 2430aba879 Implement editable candidate 2020-04-04 17:51:43 +08:00
Tzu-ping Chung 3b06cb6b53 Refactor ireq-related operations to base class 2020-04-03 21:33:16 +08:00
Paul Moore d53d3d6b24 Use the name/version from the InstallationCandidate 2020-04-03 11:23:35 +01:00
Tzu-ping Chung 7511737ee7 AlreadyInstalledCandidate 2020-04-03 01:27:34 +08:00
Tzu-ping Chung f061f3f691 Fetch install dist for a candidate if available
The candidate creation logic is further moved into the factory. The
factory would use pkg_resources.get_distribution() to find a matching
distribution for a givan InstallationCandidate. If found, the Candidate
would be created based on that found distribution, instead of the link.

--ignore-installed is implemented as to always use the link to create
candidates, even if an installed distribution is found.
2020-04-03 00:36:26 +08:00
Tzu-ping Chung 9ca2240530 More clarification on the name 2020-04-02 21:42:29 +08:00
Tzu-ping Chung 190c424b1e Implement Python as a dependency
If a dist contains Requires-Python metadata, it is converted into a
Requirement for the resolver based on whether the Requires-Python
is compatible or not.

If it is compatible, an ExplicitRequirement is returned to hold the
Python information (either sys.version_info, or the user-supplied
--python-version).

If it is incompatible, a special NoMatchRequirement is returned, which
never matches to anything, generating a ResolutionImpossible to report
the Python version incompatibility.

The --ignore-requires-python flag is implemented as to not return a
Requirement for Requires-Python at all.
2020-04-02 18:36:08 +08:00
Tzu-ping Chung d29c86af98 Add method to create requirement from spec 2020-04-01 16:53:39 +08:00
Tzu-ping Chung 4491f38047 Return Requirement directly from get_dependencies
This is possible now we have the factory construct.
2020-04-01 15:31:52 +08:00
Tzu-ping Chung e06048cb8b Aggregate helper usages into factory object
This prevents us from having to hold multiple references of
finder/preparer/make_install_req in each requirement/candidate class.
Instead we just pass around the factory object, and let others use the
instances on it.
2020-04-01 15:31:52 +08:00
Tzu-ping Chung 6db0df928c Move wheel cache out of InstallRequirment 2020-03-30 17:36:03 +08:00
Tzu-ping Chung 07563847b0 Decouple candidate and requirement modules
This introduces a new module "factory" that contains all methods dealing
with producing candidates/requirements from an input
requirement/candidate. This allows both models to know nothing about
each other, and simply rely on the intermediate to produce the other.

I *believe* this also helps us reduce merge conflicts due to adding
arguments to those producer functions, since now we only need to modify
the factory, and exactly one of candidate/requirement.

This is only part of a big scheme--the plan is to also move
Candidate.get_dependencies() and Requirement.find_matches() into the
factory class, so they can avoid holding and passing around finder,
preparer, and make_install_req. This is also necessary to change the
return type of Candidate.get_dependencies() to Requirement without
hard-coupling.
2020-03-27 03:14:51 +08:00
Paul Moore a68345e81c Warn if invalid extras are given 2020-03-26 14:53:24 +00:00
Paul Moore 7e97cf6426 Ignore invalid extras 2020-03-26 11:57:34 +00:00
Paul Moore 67bf5890ea Document the ExtrasCandidate class 2020-03-26 11:56:46 +00:00
Paul Moore ffb56db5dd Allow candidates to not have an associated install requirement 2020-03-26 11:19:10 +00:00
Paul Moore d79aacc61c Forgot to run lint before pushing again :-( 2020-03-25 12:39:21 +00:00
Paul Moore bd0f7fe346 Add an ExtrasCandidate class 2020-03-25 12:27:24 +00:00
Paul Moore 76de49bc24 Make a proper get_install_requirement method for candidates 2020-03-25 12:27:24 +00:00
Paul Moore ffe553638c Address review requirements 2020-03-19 10:55:33 +00:00
Paul Moore a23e936bc7 Ensure candidate name is canonicalised 2020-03-18 14:54:15 +00:00
Paul Moore f1b4be892a Fix bug in get_dependencies() passing Requirement object rather than string 2020-03-18 14:53:04 +00:00
Paul Moore 7d2eb544b5 Implement PipProvider 2020-03-18 14:42:16 +00:00