Commit Graph

82 Commits

Author SHA1 Message Date
Nguyễn Gia Phong b28e2c4928 New resolver: Avoid polluting dest dir
Previously, during dependency resolution for `pip download -d <dir>`
or `pip wheel -w <dir>`, distributions downloaded are always saved
to <dir>, even for those are only used in backtracking and are not
part of the returned requirement set.
2020-10-07 13:42:21 +07:00
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
gutsytechster b82516c9ca fix(_internal/commands): Define a default add_option to child commands 2020-05-23 14:55:37 +05:30
gutsytechster 72a42197a4 refactor(commands): Add method add_options and remove __init__
This removes the __init__ method of child classes and defines
explicit method for adding command options.
2020-05-23 14:50:57 +05:30
Devesh Kumar Singh 3b35b416e9 Changed type of variadic args to Any and removed unneeded type ignore 2020-04-20 03:25:22 +05:30
Devesh Kumar Singh 0e8093ec5c Type annotations for hash, show and wheel in commands 2020-04-14 01:18:09 +05:30
Tzu-ping Chung 6db0df928c Move wheel cache out of InstallRequirment 2020-03-30 17:36:03 +08:00
Chris Hunt 60a2fa4dce Inline unconditionally-executed blocks 2020-02-23 18:05:09 -05:00
Chris Hunt 45911713db Globally manage temp build dir
This will let us remove the indentation associated with the `with`
statement and eventually refactor these functions more easily.
2020-02-23 18:04:46 -05:00
Christopher Hunt ea47be571e
Merge pull request #7772 from chrahunt/refactor/command-level-scoped-tracker
Use Command context helper to cleanup requirement tracker
2020-02-24 06:51:06 +08:00
Chris Hunt eb91e8ca39 Use Command context helper to cleanup requirement tracker
The lifetime of the requirement tracker will be essentially the same,
but now we have more flexibility on where in the code we create it.

In a followup we can do the same thing with build_dir and remove the
`with` statement (and its indentation) entirely from these commands.
2020-02-23 14:37:01 -05:00
Chris Hunt 83b0295be9 Dedent block 2020-02-23 14:29:01 -05:00
Chris Hunt ccc6d77a73 Do not update `no_clean` option value on PreviousBuildDirError
Since a recent refactoring of our temporary directory handling,
`no_clean` is only read prior to these `except` blocks. Since it's not
needed, remove it!
2020-02-23 14:28:59 -05:00
Chris Hunt e7998a3617 Rename populate_requirement_set to get_requirements 2020-02-05 22:30:07 -05:00
Chris Hunt 543c84402d Remove unused requirement_set in commands 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 779d8df5e6 Inline check_supported_wheels
Reduces our dependency on RequirementSet in individual commands.

The default value for this is True, used everywhere except
InstallCommand.
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 fd815bc1fa Pass in a plain list of InstallRequirement to Resolver.resolve
Further simplifies the Resolver interface, and will give us the
opportunity to remove any knowledge of RequirementSet from the
individual commands.
2020-02-05 22:30:05 -05:00
Chris Hunt 550ae907bd Parameterize check_supported_wheels to Resolver.resolve
This reduces our dependence on the input RequirementSet.
2020-02-05 22:29:46 -05:00
Chris Hunt 58c06299db Return a different RequirementSet from Resolver.resolve
This makes the resolver interface simpler by returning a brand new
RequirementSet vs mutating the one that was input to the function, and
will let us specialize RequirementSet for the different use cases.
2020-02-05 22:29:30 -05:00
Chris Hunt 4a93045be1 Remove no-op RequirementSet.cleanup_files 2020-02-05 20:16:05 -05:00
Chris Hunt 77e9b79d0e Remove no-op calls to WheelCache.cleanup 2020-02-04 23:11:27 -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) 5aa3b3d2f0
Remove unused build() argument 2020-01-05 23:52:42 +01:00
Stéphane Bidoul (ACSONE) 66e010980a
Remove WheelBuilder
build is now a function
2020-01-05 23:52:42 +01:00
Stéphane Bidoul (ACSONE) e45005f4bb
Filter requirements to build beforehand in wheel command
One more step so build() becomes only concerned with building.
2020-01-05 23:52:40 +01:00
Xavier Fernandez 6896dfcd83
Merge pull request #7524 from sbidoul/wheel-download-dir-sbi
Ensure wheel download dir is present at the beginning of wheel command
2020-01-01 16:13:38 +01:00
Stéphane Bidoul (ACSONE) f55819787d
Normalize wheel dir at the beginning of wheel command
Similar to what is done in the download command.
2019-12-30 09:53:08 +01:00
Stéphane Bidoul (ACSONE) d8374b86f9
wheel: ensure wheel dir is present earlier
Similar to what is done for download_dir
in the download command
2019-12-30 09:53:08 +01:00
Stéphane Bidoul (ACSONE) 261c286de9
Make wheel_cache an argument of build() 2019-12-29 18:51:45 +01:00
Stéphane Bidoul (ACSONE) 3828699ddc
Move build options from WheelBuilder to build function 2019-12-29 18:49:54 +01:00
Stéphane Bidoul (ACSONE) 9909b4069a
Move final copy operation from wheel_builder to wheel command 2019-12-26 21:43:57 +01:00
Stéphane Bidoul (ACSONE) cf21401fd7
Make wheelbuilder.build return successes too
Also, pluralize variable names for readability and consistency with
similar variables in callers.
2019-12-26 21:43:57 +01:00
Pradyun Gedam 8e7a87bf4b
Factor out pep517 wheel build function (#7473) 2019-12-13 04:26:44 +00:00
Christopher Hunt d7eaede434
Revert "Add new option: pip wheel --save-wheel-names (#6377)" (#7420)
This reverts commit bcad1b1cb5, reversing
changes made to f86490317a.

As discussed, we should rethink the interface of this command output as
part of larger CLI usability review. In the interim, the same
functionality can be achieved using straightforward shell commands.
2019-12-13 07:57:05 +08:00
Stéphane Bidoul (ACSONE) 2eff06e7cc
Make WheelBuilder should_unpack argument explicit 2019-12-12 23:46:05 +01:00
Chris Hunt fe320a3da0 Remove redundant build_dir normalization 2019-12-12 21:46:04 +08:00
Chris Hunt b6e007c6a8 Remove redundant src_dir normalization 2019-12-12 21:46:04 +08:00
Pradyun Gedam 1405a403fe
Merge branch 'master' into add-use-user-site-to-preparer 2019-11-11 08:40:20 +05:30
Pradyun Gedam c9606b86e1
Add use_user_site to RequirementPreparer 2019-11-10 13:51:29 +05:30
Pradyun Gedam c40a9d332d
Update callsites for RequirementTracker 2019-11-10 12:33:25 +05:30
Christopher Hunt d3129f227a
Merge pull request #7301 from chrahunt/refactor/reduce-resolver-finder-dependence
Reduce Resolver dependence on PackageFinder
2019-11-06 14:17:55 +08:00
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
Stéphane Bidoul (ACSONE) 92a9183f47 Remove unused WheelBuilder.no_clean 2019-11-04 22:56:55 -05:00
Pradyun Gedam da9a432576
Move WheelBuilder and friends to a dedicated module 2019-11-04 11:49:02 +05:30
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