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

8616 commits

Author SHA1 Message Date
Remi Rampin 04d8841ace Update links in docs 2019-12-11 22:23:34 +01:00
toonarmycaptain 17075cc17f Update README.rst correcting grammar.
`there is several` should be `there are several`
2019-12-11 09:26:54 +08:00
Chris Hunt 355c303e12 Lazy evaluate has_tls result
This avoids an unnecessary unconditional import of ssl and urllib3 in
compat.
2019-12-09 20:48:58 +08:00
Chris Hunt f4e40d7a09 Wrap HAS_TLS in a function
Next we'll refactor the value to be computed lazily.
2019-12-09 20:48:58 +08:00
Chris Hunt 6343e8093f Replace atexit with globally-managed tempdir 2019-12-09 06:06:37 +08:00
Chris Hunt d6b509d7c6 Set up global tempdir manager in BaseCommand
This ensures that the resource is available for the lifetime of the
program.
2019-12-09 06:06:37 +08:00
Chris Hunt 0457826bd0 Add global TempDirectory manager
In cases where there is not a clear scope, or where enforcing a scope
and passing a temp directory to callees creates unnecessary coupling
between components, this will let us tie the lifetime of temporary
directories to the lifetime of the application without using e.g.
atexit or finalizers.

This has the benefit of being easier to test and reason about.
2019-12-09 06:06:37 +08:00
Chris Hunt cf743dd245 Remove unnecessary unlink in unpack_http_url
The file is downloaded into a TempDirectory which will get cleaned up at
the end of the `with` block, so no need to explicitly unlink the file.
2019-12-08 22:33:51 +01:00
Christopher Hunt 2013753525
Read record file once during legacy install (#7452) 2019-12-09 04:55:51 +08:00
Pradyun Gedam a1b0b9274f
Update warning tense: the next pip will be released after Pytho… (#7448) 2019-12-07 17:33:24 +00:00
Pradyun Gedam edb59e12e9
Added a note about # noqa comments in the Getting Started Guide (#7446) 2019-12-07 17:29:53 +00:00
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
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