Commit Graph

62 Commits

Author SHA1 Message Date
Nguyễn Gia Phong 6887b0795b Merge usage of download_dir and wheel_download_dir
In every cases, at least one of them is None.  By doing this,
it is also possible to simplify wrapper codes around download_dir.
2020-10-07 13:42:21 +07:00
Pradyun Gedam 58c594c06b
Prepare isort for black 2020-09-23 21:47:47 +05:30
Nguyễn Gia Phong b46576d933 Give batch downloader a separate class 2020-08-12 16:07:27 +07:00
Nguyễn Gia Phong 487d00295c Define RequirementPreparer._session 2020-08-06 18:42:59 +07:00
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
Chris Hunt e49dcfdc35 Move lazy_wheel warning out of Resolver
This warning just needs to be traced in one place for all commands,
there's no need for the resolver to know about it. Moving the warning
out of the Resolver will make it easier to change how we provide the
option.
2020-08-02 18:40:11 -04:00
Nguyễn Gia Phong 5d15291274 Use lazy wheel to obtain dep info for new resolver 2020-07-21 16:00:34 +07:00
Christopher Hunt 4ba51d2e9c
Merge pull request #8501 from uranusjr/refactor-create-link-collector
Tidy up link collector constructor imports
2020-07-05 21:44:31 -04:00
Pradyun Gedam 79de2c8911
Switch to --use-feature for determining which resolver to use
Also changes all invocations in the tests, to the new flag.
2020-07-03 18:49:56 +05:30
Tzu-ping Chung ec7324fba0 Tidy up link collector constructor imports
make_link_collector() was in self_outdated_check, a module responsible
for checking whether the currently-running pip is outdated, but is
imported by things that has nothing to do with this outdated check. Move
the function to be a class method in LinkCollector so the module
hierarchy makes more sense.
2020-06-26 17:31:28 +08:00
Stéphane Bidoul aa0c167498
Make sure user_supplied is propagated where needed 2020-05-31 18:33:51 +02:00
Stéphane Bidoul b9a19f6be0
Rename is_direct to user_supplied 2020-05-31 18:33:51 +02:00
Stéphane Bidoul a226f65cf5
A constraint is not a top level requirement 2020-05-31 18:33:51 +02:00
Tzu-ping Chung 8facc4cee1 Avoid RequirementSet before reaching the resolver
The RequirementSet implementation conflates requirements incorrectly in
a lot of places. This means the (new) resolver would get incomplete
requirements.

The removes all RequirementSet.add_requirement() calls outside of the
legacy resolver, so the new resolver can get the unmodified list of
requirements specified by the user, allowing for more sophisticated
requirement merging.
2020-05-04 01:24:19 +08:00
Tzu-ping Chung 6db0df928c Move wheel cache out of InstallRequirment 2020-03-30 17:36:03 +08:00
Tzu-ping Chung fc810d7353 Add --unstable-feature=resolver
This introduces a new general option --unstable-feature that can be used
to opt into "preview" features in pip not enabled by default. Currently
the only available feature is "resolver".

A stub resolver interface (which would fail on invocation) is provided
to respond to the flag.

The --unstable-feature option is hidden from --help since the resolver
does not yet work. This suppression should be removed when we release
the resolver for general/public testing.
2020-03-11 18:51:01 +08:00
Jason R. Coombs 6282a307dc 👹 Feed the hobgoblins (delint). 2020-03-06 12:43:10 -05:00
Jason R. Coombs 3511d3d493 Convert the remaining '%' formatters to '.format'. Fixes #6973. 2020-03-06 12:43:03 -05:00
Chris Hunt fd74d0362c Move legacy_resolve to resolution.legacy.resolver
This gives us a concrete place to put the new resolver code and
resolver-specific modules (`resolution.resolver`).

The reason for another level of hierarchy compared to other modules
is to allow us to move other modules here as they
become implementation details of the legacy resolver. Examples I
have in mind are: `req.req_set`, `req.req_install`,
`req.constructors`, and `operations.prepare`.
2020-02-25 09:04:06 -05:00
Paul Moore aac5d821f9 Move make_requirement to pip._internal.req.constructors (and rename it) 2020-02-14 12:22:50 +00:00
Paul Moore 90e4eb3eed Make parse_requirements return a ParsedRequirement 2020-02-14 11:52:53 +00:00
Chris Hunt e7998a3617 Rename populate_requirement_set to get_requirements 2020-02-05 22:30:07 -05:00
Chris Hunt de5ec7e884 Remove unused requirement_set argument 2020-02-05 22:30:07 -05:00
Chris Hunt e872d2bfb6 Make new RequirementSet in populate_requirement_set
Concentrates use of RequirementSet in individual commands so we can
eventually break it up.
2020-02-05 22:30:07 -05:00
Chris Hunt 5dcc562616 Return a list of InstallRequirement from populate_requirement_set
Next we can hide RequirementSet from the setup phase of the individual
commands.
2020-02-05 22:30:07 -05:00
Chris Hunt a814dc9f1f Centralize logic for getting 'all requirements' 2020-02-05 22:29:48 -05:00
Chris Hunt 34df623016 Globally manage EphemWheelCache temp directory 2020-02-04 23:11:25 -05:00
Chris Hunt bdde27bfd8 Add BuildEnvironment._temp_dir to tempdir registry
Similar to the InstallRequirement temp build dir, now we'll be able to
refactor this to be globally managed.
2020-02-04 20:31:34 -05:00
Chris Hunt 2f4bfc3efc Add InstallRequirement._temp_build_dir to tempdir registry
Now we can refactor this to be globally managed, and it will have the
same behavior as it does currently (if there is any
PreviousBuildDirError it will not be cleaned up).
2020-02-04 20:29:26 -05:00
Chris Hunt 7068e58b6f Configure tempdir registry
This mirrors the current logic within the individual requirement-related
commands (install, wheel) for setting options.no_clean, which is used to
determine whether we need to delete directories.

Next, we'll add the actual directories to track and remove them from
being managed by other objects.
2020-02-04 20:22:39 -05:00
Chris Hunt 0b4ec28a39 Centralize addition of no_clean argument
We want to rely on --no-clean being a valid option for
RequirementCommand types, so move it to one place close to the code that
will depend on it.
2020-02-04 20:22:39 -05:00
Stéphane Bidoul (ACSONE) 6fa3a2ee58
Remove redundant cache dir normalization in _build_session
Now the cache is normalized eagerly, this is not necessary here anymore.
assert the path is absolute to prevent regression.
2020-01-08 08:02:29 +01:00
Maxim Kurnikov 58e2a99ccf remove disallow_untyped_defs=False for most of pip._internal.cli modules 2019-12-13 09:58:52 +03:00
Chris Hunt 24d2f1e719 Remove unused arguments 2019-12-05 20:29:43 -05:00
Chris Hunt 7db57478a2 Construct Downloader outside RequirementPreparer
Reduces RequirementPreparer responsibilities, and will let us get rid of
some constructor arguments.
2019-12-05 20:26:53 -05:00
Pradyun Gedam c9606b86e1
Add use_user_site to RequirementPreparer 2019-11-10 13:51:29 +05:30
Pradyun Gedam 0612685e7e
Stop passing require_hashes to Resolver directly 2019-11-10 01:52:03 +05:30
Pradyun Gedam c0afe5c81d
Add require_hashes to RequirementPreparer 2019-11-09 12:13:29 +05:30
Pradyun Gedam 4e7867d0a8
Compute require_hashes in populate_requirement_set 2019-11-09 12:05:28 +05:30
Chris Hunt deac2343dc Don't pass PackageFinder to Preparer from Resolver
Preparer's overall responsibilities align more with having its own
reference to finder, which will help us remove it from resolver later.
2019-11-05 20:57:14 -05:00
Chris Hunt f305f66eb2 Trace common finder info outside resolver
There's no reason for Resolver to trace this information about our
PackageFinder, we just need a common one-time function to trace useful
information.
2019-11-05 20:57:14 -05:00
Chris Hunt 3076c39f25 Remove unused Resolver.session 2019-11-03 14:31:38 -05:00
Chris Hunt 44cc3aeb0a Use session from RequirePreparer, not Resolver 2019-11-03 14:26:47 -05:00
Pradyun Gedam 9ab9040d75
Remove RequirementSet.require_hashes (#7068) 2019-10-20 13:23:40 +05:30
Pradyun Gedam 2db6f428bf
Update imports to {index -> index.package_finder} 2019-10-19 22:24:01 +05:30
Chris Hunt b8fb97a815 Remove unused RequirementSet.require_hashes 2019-10-13 13:19:49 -04:00
Chris Hunt bbc29f0c6c Pass require_hashes directly to Resolver
This removes some of the dependence of the Resolver on our specific
RequirementSet implementation.
2019-10-13 13:19:49 -04:00
John Paton 6b57c1f5df Move outdated outside utils and rename (pypa/pip#6532) 2019-09-30 09:56:44 +02:00
Maxim Kurnikov 3692097cca add per-file disallow_untyped_defs=False, and set it to True globally 2019-09-29 23:31:15 +02:00
Chris Hunt cf7ebdbbc2 Move PipSession to network.session 2019-09-27 01:02:52 -04:00