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

101 commits

Author SHA1 Message Date
Chris Hunt 3c8be92c32 Move Downloader out of unpack_url
This simplifies the work done in the operations.prepare helper functions
and also opens up the door to remove session and progress_bar from
RequirementPreparer itself.
2019-11-21 19:11:46 -05:00
Chris Hunt 19806574e5 Move Downloader out of unpack_http_url
Reduces scope of session and progress_bar.
2019-11-21 19:11:46 -05:00
Chris Hunt 4be0a5445a Move Downloader up out of _download_http_url
Reduces exposure of session and progress_bar.
2019-11-21 19:11:46 -05:00
Chris Hunt 3ce317890e Introduce Downloader for progress-showing downloads 2019-11-21 19:05:42 -05:00
Chris Hunt e4d2d34fe1 Represent download as its own type
This abstraction will let us hide details about the actual downloading
and display of progress from most of operations.prepare.
2019-11-21 19:04:28 -05:00
Chris Hunt e706af20fe Simplify writing file chunks
A plain loop is easier to follow than chained generators consumed by
a helper function, and reduces the number of objects being passed around
just to download a file.
2019-11-19 17:06:18 -05:00
Chris Hunt dca556fdaa Check hashes after download is complete
Instead of computing hashes on-the-fly we do it after fully downloading
the file. This step will let us move hash checking to a higher-level
function without introducing a lot of complexity.
2019-11-19 17:06:18 -05:00
Christopher Hunt 9ae2e6440d
Merge pull request #7365 from chrahunt/refactor/cleanup-prepare-2
Cleanup operations.prepare download functions
2019-11-20 06:05:25 +08:00
Ahilya 5051c74d5e Redact passwords from index-url during download
Made changes in _download_url so that it relies on
redact_auth_from_url from misc to redact passwords.

Closes https://github.com/pypa/pip/issues/6783
2019-11-17 20:54:32 +05:30
Chris Hunt 09b19dbbb8 Move actual session.get call into separate function
By moving this call (and its long explanation) to a separate function,
diffs for later refactoring will be easier to review.
2019-11-16 12:37:47 -05:00
Chris Hunt a9997127b9 Don't pass explicit step size to progress indicator
Now the place we construct the progress indicator doesn't need to know
about our strategy for consuming the response, freeing us to extract the
chunk iterator construction into the caller.
2019-11-16 12:37:47 -05:00
Chris Hunt 6e68c8d9ba Retrieve HTTP response size in separate function
Also use `None` as the "no size available" indicator value, which is
already compatible with all of its current uses.
2019-11-16 12:37:44 -05:00
Chris Hunt dd08330ac3 Construct download name in separate function
Later, we will use this to make a dedicated object that represents
our download.
2019-11-16 12:26:54 -05:00
Chris Hunt f5f1761aba Inline content-type retrieval
This makes it easier to factor out the filename calculation.
2019-11-16 12:26:14 -05:00
Pradyun Gedam ccd2ced9bc
Add disallow_any_generics = True to mypy configuration (#7110) 2019-11-14 20:46:21 +05:30
Maxim Kurnikov d1452ffabd add global disallow_any_generics=True 2019-11-12 21:08:48 +03:00
Chris Hunt 16ffd1a9c4 Normalize style 2019-11-11 22:36:46 -05:00
Chris Hunt 95375a5213 Make session a required parameter in operations.prepare 2019-11-11 22:34:52 -05:00
Pradyun Gedam 11b3fc2265
Drop use_user_site argument from prepare_editable_requirement 2019-11-10 13:51:36 +05:30
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
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
Christopher Hunt a0ff620240
Merge pull request #7291 from chrahunt/refactor/cleanup-prepare-1
Cleanup operations.prepare
2019-11-04 19:39:24 +08:00
Chris Hunt 54efa9dbdb Reorder operations.prepare._download_url 2019-11-03 16:26:37 -05:00
Chris Hunt b873df49b0 Factor from_cache check into separate function 2019-11-03 15:29:19 -05:00
Chris Hunt e8976af4e1 Show download size if available
This simplifies the logic for displaying output.
2019-11-03 15:25:59 -05:00
Chris Hunt 5da6abf60d Move resp_chunks to network.utils
This generic piece of code only clutters operations.prepare, making it
harder to refactor.
2019-11-03 15:16:42 -05:00
Chris Hunt 44cc3aeb0a Use session from RequirePreparer, not Resolver 2019-11-03 14:26:47 -05:00
Christopher Hunt de736c661e
Merge pull request #7178 from Desetude/fix/use-str-format
Replace %-format with str#format
2019-11-03 01:34:14 +08:00
Stéphane Bidoul (ACSONE) 18a58815a1
Refactor _get_used_vcs_backend 2019-11-01 12:53:54 +01:00
Pradyun Gedam 2db6f428bf
Update imports to {index -> index.package_finder} 2019-10-19 22:24:01 +05:30
Chris Hunt 6eb83c6d3a Move remaining functions in download to operations.prepare
The only user of this module is operations.prepare.RequirementPreparer.
Moving the functionality to the single using module means that
refactoring will be easier (since all the mess is in one place). This
also removes a mis-named module from the top-level of the repository.
2019-10-16 21:29:06 -04:00
Desetude 7e4e8eea40 Replace %-format with str#format 2019-10-12 17:08:10 +01: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
Chris Hunt 892b58f244 Move helper functions into Link 2019-09-22 00:08:10 -04:00
Pradyun Gedam ab6d550592
Remove link.is_artifact 2019-09-21 14:30:14 +05:30
Chris Hunt ee8cc0e648 Use unpack_file instead of unpack_file_url in wheel 2019-09-19 20:19:24 -04:00
Chris Hunt 59b0a79bde Add Link.file_path property 2019-09-19 20:14:10 -04:00
Chris Jerdonek 3303c11828 Remove index.py and req/constructors.py's dependence on download.py. 2019-09-13 09:57:04 -07:00
Chris Hunt 997c9b71b3 Move non-throwing code outside try/except. 2019-09-06 19:55:57 -04:00
Chris Hunt b72d9f1477 Move autodelete_unpacked to more logical place. 2019-09-06 19:55:57 -04:00
Chris Hunt a20a06cd34 Move unpack_url above irrelevant checks. 2019-09-06 19:55:57 -04:00
Chris Hunt aef01d25cc Remove unused argument from unpack_url. 2019-09-06 19:55:57 -04:00
Chris Hunt 45283a332f Move delete marker file creation from unpack_url to caller. 2019-09-06 19:55:38 -04:00
Pradyun Gedam a217f550e1
Remove duplicate line in comment. (#6965) 2019-09-05 13:03:24 +05:30
Christopher Hunt 0a246b98a9
Update src/pip/_internal/operations/prepare.py
Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
2019-09-04 02:54:23 -04:00
Chris Hunt efd43fd0fe Minor comment typo. 2019-09-02 19:37:33 -04:00
Chris Hunt b719cc0033 Fix indentation: fix indentation 2019-09-02 19:36:57 -04:00