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

8814 commits

Author SHA1 Message Date
Hugo 0c65a9e2a3 The next pip will be released after Python 2.7's EOL 2019-12-07 11:20:17 +02:00
Preet Thakkar 4abe2f708f added newline at end of news file 2019-12-06 15:29:36 +05:30
Preet Thakkar 682eafe546 added news file 2019-12-06 15:23:39 +05:30
Preet Thakkar cc96315273 Added note about # noqa in getting-started.rst 2019-12-06 15:10:33 +05:30
Xavier Fernandez 5e46429bfb
Merge pull request #7441 from chrahunt/refactor/operations-prepare-3
Move Downloader construction out of RequirementPreparer
2019-12-06 10:25:02 +01: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
Xavier Fernandez 58435d1efe
Merge pull request #7434 from chrahunt/refactor/remove-conflicts-with-1
Replace InstallRequirement.conflicts_with with InstallRequirement.should_reinstall
2019-12-05 12:56:41 +01:00
Pradyun Gedam 7ed66b2c94
Merge pull request #7431 from chrahunt/refactor/operations-prepare-2
Move operations.prepare.Downloader (and friends) to network.download.Downloader
2019-12-05 11:11:19 +00:00
Xavier Fernandez 9ccbfcefcc
Merge pull request #7433 from chrahunt/refactor/extract-editable-legacy
Extract InstallRequirement.install_editable into operations.install
2019-12-05 11:17:01 +01:00
Chris Hunt 65ac79571b Justify lack of encoding when reading record file 2019-12-05 10:32:37 +01:00
Chris Hunt 48ddd0b111 Inline InstallRequirement.move_wheel_files
This makes InstallRequirement simpler and will make it easier to
refactor InstallRequirement.install.
2019-12-05 10:17:49 +01:00
Chris Hunt ce42b132ba Remove unused member InstallRequirement.conflicts_with 2019-12-04 22:57:05 -05:00
Chris Hunt d098f27d3f Use should_reinstall flag instead of conflicts_with
A boolean flag is simpler to reason about than a complex type like
`conflicts_with`.

In all of these situations `conflicts_with` was being assigned a
non-None value and only being checked for truthyness, so a bool is
sufficient to capture the required usages.
2019-12-04 22:53:58 -05:00
Chris Hunt 331716a439 Don't use conflicts_with in logging
InstallRequirement.uninstall doesn't actually use conflicts_with, so
don't log it. Instead we output the requirement name so we still have
something that looks like a heading before indenting the log, and log
what we actually uninstall inside the function.

This will also enable us to get rid of conflicts_with.
2019-12-04 22:43:33 -05:00
Chris Hunt 27fee83065 Add docstrings 2019-12-04 22:23:37 -05:00
Chris Hunt 83b2acf032 Move InstallRequirement.install_editable into operations.install
This makes InstallRequirement simpler and overall makes it easier to
track how the parts of InstallRequirement are being used for the phases
of package processing.
2019-12-04 22:23:33 -05:00
Chris Hunt a4fc8d0e7e Parameterize InstallRequirement.install_editable
This makes it easier to extract the function without keeping references
to InstallRequirement.
2019-12-04 22:03:10 -05:00
Chris Hunt 78a221cf71 Move Downloader to network.download
This will help us move Downloader construction out of
RequirementPreparer, reducing its concerns and making it easier to test
in isolation.
2019-12-04 18:31:53 -05:00
Chris Hunt 3a2ff979de Move _http_get_download to network.download 2019-12-04 18:31:53 -05:00
Chris Hunt e354b728dc Move _get_http_response_filename to network.download 2019-12-04 18:31:53 -05:00
Chris Hunt 762e4a0817 Move parse_content_disposition to network.download 2019-12-04 18:31:53 -05:00
Chris Hunt 32b0fc23ab Move sanitize_content_filename to network.download 2019-12-04 18:31:53 -05:00
Chris Hunt 3fbc991f0c Move _prepare_download to network.download 2019-12-04 18:31:53 -05:00
Chris Hunt 05b327ca2f Remove Optional from Link.show_url
Since we're moving functions to a file with stricter typing, this
prevents mypy from complaining that our string is possibly None.
2019-12-04 18:31:46 -05:00
Chris Hunt 864f78bd96 Add network.download module
This will be home to Dowloader, Download, and associated helper
functions. Since this is an abstraction over PipSession, it makes
sense to keep these functions in a separate module.

Also move a helper function here from operations.prepare.
2019-12-04 18:30:27 -05:00
Chris Hunt db766f3c95 Move helper mock classes to dedicated module
When we factor out tests these will be needed in both sets, and it's
easier to refactor tests later if we avoid creating a dependency between
test files.
2019-12-04 18:30:21 -05:00
Pradyun Gedam 128a8b3b5a
Merge pull request #7425 from chrahunt/refactor/cleanup-check-if-exists
Remove unused return value from check_if_exists
2019-12-04 14:29:32 +00:00
Pradyun Gedam 72e7e24f21
Merge pull request #7412 from chrahunt/refactor/operations-prepare
Cleanup operations.prepare._prepare_download
2019-12-04 14:28:44 +00:00
Pradyun Gedam f85569a6c3
Merge pull request #7426 from chrahunt/refactor/cleanup-install
Move install_succeeded for editable installs
2019-12-04 14:27:57 +00:00
Christopher Hunt b714904285
Update src/pip/_internal/req/req_install.py 2019-12-04 21:31:24 +08:00
Chris Hunt c718994c5d Move install_succeeded for editable installs
This aligns it with wheel installation and reinforces that it is the
very last thing that happens before we return (so we can potentially
refactor it out later).
2019-12-03 19:45:55 -05:00
Chris Hunt e3cd8922f2 Remove unused return value from check_if_exists
After refactoring InstallRequirement.uninstall to not call this
function, none of the remaining callers require the return value.
2019-12-03 18:54:22 -05:00
Christopher Hunt d3419a4b7e
Don't use check_if_exists in InstallRequirement.uninstall (#7422)
Previously InstallRequirement.uninstall was using
InstallRequirement.check_if_exists, which is a very overloaded
function with several callers that operate at different phases in
pip processing, not to mention that it mutates InstallRequirement itself.

Now we don't use that function for InstallRequirement.uninstall.

There should be no behavior change here.
2019-12-04 07:20:00 +08:00
Christopher Hunt 830e29e189
Move wheel to operations.install.wheel (#7421)
* Update documentation

For now just fixing the paths and adding a sub-package docstring.
2019-12-04 06:02:39 +08:00
Chris Hunt ca43dac401 Move wheel version check to install_unpacked_wheel
This helps in several ways:

1. makes it easier to test the correct behavior of wheel installation via
   `install_unpacked_wheel` independent of `InstallRequirement`
2. is easier to understand, since `install_unpacked_wheel` itself should
   know which Wheel version(s) it supports
3. reduces the scope of `check_compatibility` and `wheel_version`, which
   will make it easier to move `wheel` to `operations.install.wheel`
2019-12-03 06:53:02 +08:00
Stéphane Bidoul (ACSONE) e3c1ca137f
Update news/7296.removal
Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
2019-12-02 12:10:12 +01:00
Stéphane Bidoul (ACSONE) ab0593659d
Use interpreter_name and _version in cache keys 2019-12-02 12:10:12 +01:00
Stéphane Bidoul (ACSONE) 824dca1060
Better support for unicode cache entries 2019-12-02 12:07:19 +01:00
Stéphane Bidoul (ACSONE) bfb7db2f68
Advertise the new cache structure in a news file 2019-12-02 12:07:19 +01:00
Stéphane Bidoul (ACSONE) 66ba51ca7d
Use legacy cache entries when they exist.
Pip 20 changes the cache key format to include the
interpreter name. To avoid invalidating all existing caches,
we continue using existing cache entries that were computed
with the legacy algorithm. This should not regress issue #3025
because wheel cached in such legacy entries should have
the python implementation tag set.
2019-12-02 12:07:19 +01:00
Stéphane Bidoul (ACSONE) c4ef6163e5
New cache key generation algorithm
Instead of building an URL-ish string that could be
complex to describe and reproduce, generate a dictionary that is
hashed with a simple algorithm.
2019-12-02 12:07:19 +01:00
Stéphane Bidoul (ACSONE) e0165e7b30
Remove unused wheel_builder python_tag argument 2019-12-02 12:07:18 +01:00
Stéphane Bidoul (ACSONE) b14b37545a
Remove unused pep425tags.implementation_tag 2019-12-02 12:07:18 +01:00
Stéphane Bidoul (ACSONE) 178cd3f244
Better workaround for cache poisoning #3025
Make sure ``pip wheel`` never outputs pure python wheels with a
python implementation tag. Better fix/workaround for
`#3025 <https://github.com/pypa/pip/issues/3025>`_ by
using a per-implementation wheel cache instead of caching pure python
wheels with an implementation tag in their name.

Fixes #7296
2019-12-02 12:07:18 +01:00
Chris Hunt b8c16a0dc8 Move Wheel tests 2019-12-02 11:52:51 +08:00
Chris Hunt 60f6ed9387 Move wheel.Wheel to models.wheel.Wheel
This aligns more closely with how the class is used and makes it easier
to move the rest of the wheel module to a dedicated module for
installation.
2019-12-02 11:52:51 +08:00
Chris Hunt bf26185d55 Import Wheel in tests directly 2019-12-02 11:52:51 +08:00
Chris Hunt 1abf978e88 Move format_tag to pep425tags
This is a more appropriate place for the function, since it is more
related to tags than wheels, and will make it easier to refactor Wheel
into its own module.
2019-12-02 11:52:51 +08:00
Chris Hunt ccc231e4de Remove old TODO in wheel.Wheel
Moving installation into this class would add complexity but only to
service a single caller (InstallRequirement). Better to keep the Wheel
representation, which is used in several places, small and focused and
installation can be moved to its own module.
2019-12-02 11:52:51 +08:00