Commit Graph

173 Commits

Author SHA1 Message Date
Chris Hunt a0b75cc460 Remove intermediate pip-wheel-metadata dir
Previously this was located in the source directory itself, but now
that we're using a temporary directory, there's no need for
pip-wheel-metadata.
2019-10-13 22:20:58 +02:00
Pradyun Gedam e600aebe7d
Move find_egg_info to operations.generate_metadata 2019-09-30 16:13:29 +05:30
Pradyun Gedam 1ad0495fdd
Rename {run -> runner}_with_spinner_message 2019-09-30 12:17:07 +05:30
Pradyun Gedam 65621002fc
Use run_with_spinner_message() for "setup.py install" 2019-09-30 12:16:50 +05:30
Pradyun Gedam 489312e4d9
Stop monkeypatching InstallRequirement.pep517_backend 2019-09-30 12:16:50 +05:30
Pradyun Gedam 46bd454e3e
Use pep517.Pep517HookCaller.subprocess_runner
Also, create a new utility function for showing a spinner when running
a subprocess.

Why: The subprocess_runner API was specifically added to make it
possible for pip to stop monkey-patching Pep517HookCaller, while still
maintaining its output style. The relevant monkeypatch will be removed
in a follow up commit.
2019-09-30 12:16:45 +05:30
Pradyun Gedam 2eafb0218b
Update all the imports as needed 2019-09-30 11:15:24 +05:30
Maxim Kurnikov 3692097cca add per-file disallow_untyped_defs=False, and set it to True globally 2019-09-29 23:31:15 +02:00
Pradyun Gedam 03392873ec
Refactor metadata directory handling (#7087) 2019-09-28 17:34:43 +05:30
Pradyun Gedam f916fbe333
Simplify handling of PEP 517 metadata temp dir 2019-09-28 12:17:41 +05:30
Pradyun Gedam ec5e9d30d3
Improve move_to_correct_build_directory
Why: Changes made are IMO much clearer, with a step by step flow to this
method that is easier to reason about.
2019-09-27 10:32:25 +05:30
Pradyun Gedam b01f301c75
Update get_dist to directly use metadata_directory 2019-09-27 10:32:25 +05:30
Pradyun Gedam 26fd8f24b0
Always set InstallRequirement.metadata_directory
Why: expecting metadata_directory to exist, once metadata is generated,
is easier to reason about, than considering that some kinds of
distributions set it while others do not.
2019-09-27 10:32:24 +05:30
Pradyun Gedam e7bd10115e
Start returning metadata directory from metadata generators
Why: Since the result is a single directory and it's better for the
resposibility of computing the exact location of the metadata directory
should be with the generator, that generates it.
2019-09-27 10:32:21 +05:30
Pradyun Gedam c6a2f0aac7
Rename {setup_py_dir -> unpacked_source_directory}
Why: Because PEP 517 means you won't have a setup.py in your unpacked sources.
2019-09-27 00:53:24 +05:30
Pradyun Gedam 108f9b6786
Cleanup InstallRequirement.egg_info_path (#7081) 2019-09-25 09:34:09 +05:30
Pradyun Gedam 618714b1bf
Factor out logic for locating egg-info directories
Why: A named function brings clarity to expressing what is happening.
2019-09-25 08:04:15 +05:30
Pradyun Gedam 72d5d140be
Define a function to use as sorting key
Why: It makes it clearer what the funky expression means.
2019-09-25 08:04:14 +05:30
Pradyun Gedam 14cbc5f8a4
Return early from the function
Why: Allows reducing indentation of the function body.
2019-09-25 08:03:57 +05:30
Christopher Hunt 928f86a162
Merge pull request #7048 from chrahunt/refactor/always-create-tempdirectory
Always create TempDirectory.path at __init__
2019-09-24 08:27:44 -04:00
Pradyun Gedam 15154079d2
Move run_egg_info into operations.generate_metadata (#7063)
Merge pull request #7063 from pradyunsg/refactor/metadata-generator-legacy
2019-09-22 20:01:57 +05:30
Pradyun Gedam c787fcb3e1
Merge pull request #7064 from pradyunsg/rename-correct-build-location
Better name for _correct_build_directory
2019-09-22 19:37:11 +05:30
Pradyun Gedam 359a670ba8
Use `ZipFile` as context manager in `InstallRequirement.archive` (#6988) 2019-09-22 12:51:42 +05:30
Pradyun Gedam 596b77c149
Better name for _correct_build_directory
Why: the older name doesn't clearly signal what is happening.
2019-09-22 12:49:20 +05:30
Chris Hunt 85dcaa74bb Unconditionally create TempDirectory.path 2019-09-22 00:02:46 -04:00
Pradyun Gedam 7fabb1621d
Merge pull request #7051 from pradyunsg/refactor/metadata-generator
Call into operations.generate_metadata to generate metadata
2019-09-21 22:34:49 +05:30
Pradyun Gedam 8a144447d7
Move run_egg_info logic into generate_metadata 2019-09-21 11:27:47 +05:30
Pradyun Gedam 6d8c3fdd29
Pass self to the metadata generation function 2019-09-20 19:43:14 +05:30
Pradyun Gedam b5495b4d1e
Introduce an operations.generate_metadata module
As things stand, it'll completely delegate all the metadata generation
to InstallRequirement's methods.

Follow ups will move related code into this module.
2019-09-20 19:43:13 +05:30
Chris Hunt fbdd02e2fd Manage InstallRequirement._temp_build_dir itself instead of its path 2019-09-19 22:09:01 -04:00
Chris Hunt 5e785993b8 Normalize style. 2019-09-17 19:14:39 -04:00
Pradyun Gedam ad68984ec6
Rename {build_location -> ensure_build_location} 2019-09-15 22:09:34 +05:30
Pradyun Gedam 56b6fcc83b
Merge pull request #6999 from chrahunt/refactor/refactor-2
Keep `InstallRequirement.archive` in-place
2019-09-10 21:48:51 +05:30
Chris Hunt 96a53d49ec Move archive description from TODO to docstring.
This whole class will be refactored, so the TODO is implicit.
2019-09-09 19:45:33 -04:00
Chris Hunt c46496fba6 Remove `InstallRequirement.uninstalled_pathset`
Last actual usages of this were removed in #4642.
2019-09-09 15:53:58 +02:00
Pradyun Gedam a7d8d56914
Remove unactionable FIXME in `InstallRequirement` (#7001)
Merge pull request #7001 from chrahunt/refactor/refactor-5
2019-09-09 10:09:32 +05:30
Chris Hunt 8f684d9eab Remove unactionable FIXME in `InstallRequirement`
`setup.py develop` doesn't accept `--install-headers`, so there's no
need for this comment.
2019-09-08 21:21:08 -04:00
Chris Hunt 94b34c3e54 Remove FIXME tracked in issue tracker. 2019-09-08 20:44:11 -04:00
Chris Hunt 4686e48e0f Remove unused `update` parameter from `InstallRequirement`. 2019-09-06 21:18:10 -04:00
Chris Hunt 2963e4e217 Use ZipFile as context manager (Python 2.7+). 2019-09-06 21:05:15 -04:00
Chris Hunt 0c5721fe84 Simplify directory delete marker file check. 2019-09-05 11:25:19 +02:00
Pradyun Gedam c23c52da4f
Merge pull request #6325 from hugovk/pip-wheel-metadata-in-tempdir
Use a temp dir for pip-wheel-metadata
2019-09-05 13:28:46 +05:30
Chris Hunt 7ce0eafe53 Combine separate editable conditions into one. 2019-09-04 21:26:45 -04:00
Pradyun Gedam 365fee27ec
Merge pull request #6963 from chrahunt/refactor/clean-egg-info-path-1
Clean up venv check in `InstallRequirement.egg_info_path`.
2019-09-04 07:46:18 +05:30
Chris Hunt 9dd7e0d58a Clean up venv check in `InstallRequirement.egg_info_path`. 2019-09-02 15:17:35 -04:00
Chris Hunt bdd3781858 Remove unused return value from `InstallRequirement.ensure_source_dir` 2019-09-02 14:36:14 -04:00
Pradyun Gedam 22e12d28af
Merge pull request #6932 from pradyunsg/misc/nicer-set-use-pep517
Improve flow of setting InstallRequirement.use_pep517
2019-09-01 21:37:43 +05:30
Pradyun Gedam 0fc90d5d1f
Improve flow of setting InstallRequirement.use_pep517 2019-08-27 13:37:51 +05:30
Albert Tugushev 3c9770d9b2 Redact single-part login credentials from URLs (#6921) 2019-08-26 15:50:07 -07:00
Chris Jerdonek 7783c47131
Hide security-sensitive strings in VCS command log messages (#6890) 2019-08-21 03:22:57 -07:00