Commit Graph

295 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
Pradyun Gedam 25ab172b55
Update linter: isort 2020-09-23 19:52:28 +05:30
Pradyun Gedam 0b18e21cbe
Merge pull request #8752 from sbidoul/imp-8369-deprecation-sbi 2020-08-25 20:40:27 +05:30
Stéphane Bidoul 4c348cf3a0
Consider success flag instead of absence of exception 2020-08-13 09:38:56 +02:00
Stéphane Bidoul 9c4a88b0a0
Improve deprecation message for issue 8368 2020-08-12 11:07:36 +02:00
Nguyễn Gia Phong 4f210f3608 [2020-resolver] List downloaded distributions before exiting
This unifies the behavior of pip download for both legacy and new
resolvers.  InstallRequirement.successfully_download is no longer needed
for this task and is thus retired.
2020-08-06 16:52:31 +07:00
Chris Hunt 8b838ebb89 Prepare lazy wheels more so they are downloaded
This keeps all knowledge about preparation and types of requirements in
`RequirementPreparer`, so there's one place to look when we're ready to
start breaking it apart later.
2020-08-02 19:36:29 -04:00
Tzu-ping Chung 1fd5098b24 Canonicalize name in check_if_exists
The previous implementation uses pkg_resources.get_distribution(), which
does not canonicalize the package name correctly, and fails when
combined with pip's own get_distribution(), which does canonicalize
names. This makes InstallRequirement.check_if_exists() only use pip's
own canonicalization logic so different package name forms are matched
as expected.
2020-07-30 22:04:51 +08:00
Devesh Kumar Singh ac624f1e4f Reword news entry 2020-07-06 13:42:09 +05:30
Devesh Kumar Singh 04fedfe53c Create custom get_distribution function 2020-07-06 13:42:05 +05:30
Devesh Kumar Singh 782913725f Canonicalize req name while doing pre-install package search 2020-07-06 13:32:09 +05:30
Pradyun Gedam 20431888cb
Move check_invalid_constraint_type to req_install.py 2020-07-04 18:01:28 +05:30
Pradyun Gedam fb68794188
Merge pull request #8026 from sbidoul/requested-sbi 2020-06-24 18:24:30 +05:30
Tzu-ping Chung 09a7f271c7 Only attach UUID to build dir for spec candidates
These are the only cases where backtracking can happen. This approach
also accounts for VCS requirements relying on the same ensure function
to do cloning :/
2020-06-04 23:26:19 +08:00
Tzu-ping Chung 4ca684f3b8 Fix for source directory reuse 2020-06-04 00:32:57 +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 c9a445762c
Mark top level requirements as REQUESTED 2020-05-31 18:33:51 +02:00
Stéphane Bidoul 58295d0df7
Remove InstallRequirement source_dir parameter
source_dir is only passed to the InstallRequirement constructor
in the case of editable requirements, and it is built from link,
which is also passed to the same constructor. So we let
InstallRequirement compute source_dir, to remove that burden
from call sites.
2020-04-12 11:39:09 +02:00
Pradyun Gedam 9cbe8fbdd0
Merge pull request #7978 from sbidoul/remove-pip-egg-info-sbi
Generate legacy metadata in temporary directory
2020-04-10 18:57:13 +05:30
Tzu-ping Chung d5e45bb59a Remove the version part from the dist-info stem 2020-04-09 20:28:28 +08:00
Stéphane Bidoul 030578ef04
Remove unused argument from generate_metadata 2020-04-07 17:01:08 +02:00
Stéphane Bidoul bf8e6bc785
Generate legacy metadata in temporary directory
Before it was generated in a pip-egg-info
subdirectory of the source dir. This will avoid
polluting source dir when we build in place.
2020-04-05 11:23:57 +02:00
Stéphane Bidoul a0ed759fb3
Add direct_url support to InstallRequirement
pass it to install_wheel via install
2020-04-01 22:57:00 +02:00
Tzu-ping Chung 6db0df928c Move wheel cache out of InstallRequirment 2020-03-30 17:36:03 +08:00
Pradyun Gedam 4f6bef6eb4
Merge pull request #7792 from pradyunsg/misc/utils-tags
Rename pep425tags -> utils.compatibility_tags
2020-03-12 14:46:52 +05:30
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
Pradyun Gedam 3fa356a772
Update references to pep425tags 2020-02-26 10:24:43 -08:00
Paul Moore 73d472bb87 Merge branch 'master' into refactor_legacy_install 2020-02-11 16:53:01 +00:00
Paul Moore 9f87f46ac3 Tidy up exception block 2020-02-10 18:50:58 +00:00
Paul Moore 89bf3b02db Record on the requirement whether it has been successfully downloaded 2020-02-07 16:40:27 +00:00
Paul Moore 1aa27c4595 Merge branch 'master' into refactor_legacy_install 2020-02-07 14:49:28 +00:00
Paul Moore a9f1d8562b Pass individual options to InstallRequirement rather than an options object 2020-02-06 16:05:11 +00:00
Paul Moore 98da0a680d Correctly preserve exception type 2020-02-06 13:48:36 +00:00
Paul Moore 0dd1c72715 Fix handling of rollback on failure 2020-02-06 11:40:37 +00:00
Chris Hunt 5cca8f10b3 Remove InstallRequirement.remove_temporary_source
Since all directories are now globally-managed, we don't need to be
concerned with resetting the member values.

This will also let us remove several responsibilities from
RequirementSet, which will make integrating the new resolver easier.
2020-02-05 20:14:44 -05:00
Chris Hunt efe663d476 Remove unused utils.marker_files 2020-02-05 20:14:44 -05:00
Chris Hunt e6cc9e9351 Do not remove source directory in cleanup_temporary_source
Since nothing in our code writes the delete marker file, this block will
never execute.
2020-02-05 20:14:44 -05:00
Chris Hunt 8197a4bbc5 Do not write delete marker file to track source_dir delete preference
Previously we were writing a delete marker file which is checked in
InstallRequirement.remove_temporary_source which is only invoked if the
user did not pass --no-clean (and a PreviousBuildDirError was not
raised). Since our TempDirectory machinery now respects these conditions
we can just wrap our source directory in that instead of using this
ad-hoc mechanism for tracking our delete preference.

This will let us clean up a lot of dead code that only existed for this
use case.
2020-02-05 20:14:44 -05:00
Chris Hunt 470c39990e Wrap InstallRequirement.ensure_build_location in TempDirectory
Since we explicitly disable deletion this is a no-op, but we'll
parameterize the deletion soon.
2020-02-05 20:14:44 -05:00
Paul Moore 87217fbf2e Refactor legacy_install to not take an install_req 2020-02-05 16:07:45 +00:00
Chris Hunt 39d1c51fdb Globally-manage BuildEnvironment._temp_dir 2020-02-04 20:32:27 -05:00
Chris Hunt c35cb7819b Globally-manage InstallRequirement._temp_build_dir
InstallRequirement.remove_temporary_source was already being called at
the end of processing (as part of RequirementSet.cleanup()), so this
doesn't change behavior - cleanup still happens right after the command
finishes.
2020-02-04 20:29:57 -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
Deepak Sharma d31cf696e8 string_formatting 2020-01-30 20:33:00 +05:30
Chris Hunt d028af98e3 Remove unnecessary write_delete_marker_file
InstallRequirement only checks for a delete marker file in source_dir.
Since the result of ensure_build_location is set to source_dir (in
ensure_has_source_dir), and ensure_build_location returns a subdirectory
of the build_directory to which we write the delete marker file, then
this delete marker file is never used.
2020-01-25 18:09:24 -05:00
Chris Hunt 3fac3d74ac Inline _make_build_dir in InstallRequirement
This untested function was only used in one place. Inlining it makes it
easier to see the symmetry between the writing of the delete marker file
in `ensure_build_location` and checking for it in
`remove_temporary_source`.
2020-01-08 20:34:28 -05:00
Stéphane Bidoul (ACSONE) 9cbe7f90d6
Reference the git+git@ removal issue
in the deprecation message
2020-01-04 12:50:38 +01:00