Commit Graph

8944 Commits

Author SHA1 Message Date
Xavier Fernandez c3ae86e85f
Merge pull request #7553 from chrahunt/refactor/cleanup-git-tests
Make _git_commit test helper args explicit
2020-01-04 23:06:13 +01:00
Stéphane Bidoul (ACSONE) 9cbe7f90d6
Reference the git+git@ removal issue
in the deprecation message
2020-01-04 12:50:38 +01:00
Stéphane Bidoul (ACSONE) 8415011774
Clarify git+git@ replacements 2020-01-04 12:50:06 +01:00
Chris Hunt b65bd4c31a Remove unused args parameter from _git_commit 2020-01-03 19:24:22 -05:00
Chris Hunt 5665b94a5b Make explicit argument for git commit -a 2020-01-03 19:21:36 -05:00
Chris Hunt f9bf1a7004 Make explicit argument for git commit --allow-empty 2020-01-03 19:19:18 -05:00
Chris Hunt 79eaf132fc Remove unnecessary expect_stderr from _git_commit
This simplifies our interface to git, which will make it easier to trade
out our subprocess-based invocations in the future.
2020-01-03 19:13:08 -05:00
Chris Hunt f5684ed7ae Use shared_data fixture in wheel install tests
shared_data avoids copying the entire data directory, so use it in cases
where we know pip won't have any opportunity to edit the data files
(where we're passing tmpdir for --find-links).
2020-01-03 18:25:02 -05:00
Chris Hunt d468da2796 Explicitly copy required packages to tmpdir for wheel install tests
Any test using --find-links data.packages is potentially using several
packages. By copying specifically the packages we need, we can more
easily see the packages that each test depends on and avoid using the
`data` fixture.
2020-01-03 18:23:48 -05:00
Chris Hunt 4e5d854456 Normalize --find-links argument format in wheel install tests 2020-01-03 17:58:40 -05:00
Chris Hunt 7af9371176 Remove redundant expect_error=False in tests
This is the default, so there is no need to specify it explicitly.
2020-01-03 14:25:36 +01:00
Stéphane Bidoul (ACSONE) cf071dee55
Deprecate git+git@ form of VCS url 2020-01-02 19:20:29 +01:00
Tzu-ping Chung 9c04298d5b Revert expanduser on options that accept URL 2020-01-02 20:46:14 +08:00
Pradyun Gedam 08f61a9b73
Do not attempt setup.py clean for failed pep517 builds (#7477) 2020-01-02 12:11:32 +00:00
Stéphane Bidoul (ACSONE) 8d1d20de8c
Do not attempt setup.py clean for failed pep517 builds
Fixes #6642
2020-01-02 12:14:03 +01:00
Stéphane Bidoul (ACSONE) c93acfb20b
Test legacy clean not attempt after PEP 517 build failure 2020-01-02 12:14:03 +01:00
Tzu-ping Chung 192e895c3f News 2020-01-02 19:00:46 +08:00
Tzu-ping Chung 5ffc6bd468 Add tests for global path options 2020-01-02 18:58:42 +08:00
Xavier Fernandez a71086eb9c
Merge pull request #7538 from chrahunt/refactor/get-metadata-from-zip
Read wheel metadata from wheel directly
2020-01-02 10:35:45 +01:00
Tzu-ping Chung 2e24041ca5 Custom optparse.Option type that calls expanduser 2020-01-02 15:30:54 +08:00
Chris Hunt 2f92826081 Extract basic wheel parsing into separate function
This functions as a guard for the rest of our wheel-handling code,
ensuring that we will only get past this point if we have a wheel that
we should be able to handle version-wise.

We return a tuple instead of bundling up the result in a dedicated type
because it's the simplest option. The interface will be easy to update
later if the need arises.
2020-01-01 17:51:25 -05:00
Chris Hunt d5b4c15105 Remove dead code from wheel_metadata
Since we don't pass the source directory anymore, remove the tests
and implementation.
2020-01-01 17:51:24 -05:00
Chris Hunt a2af0f9468 Get WHEEL metadata from wheel file directly 2020-01-01 17:26:20 -05:00
Chris Hunt 2519e9740c Split try block in wheel_metadata
Makes it simpler to substitute in zip-derived WHEEL extraction.
2020-01-01 17:26:20 -05:00
Chris Hunt 62721eb5da Remove dead code
Since we don't pass the source dir anymore, we can simplify the tests
and implementation for wheel_dist_info_dir.
2020-01-01 17:26:20 -05:00
Chris Hunt cd5400ceb9 Determine .dist-info directory from wheel file directly
First example of transitioning a directory-aware function to using a
zipfile directly. Since we will not need to maintain the unpacked dir
going forward, we don't need to worry about making wheel_dist_info_dir
"generic", just that the same tests pass for both cases at each commit.

To do this neatly we use pytest.fixture(params=[...]), which
generates a test for each param. Once we've transitioned the
necessary functions we only need to replace the fixture name and remove
the dead code.
2020-01-01 17:26:20 -05:00
Chris Hunt 452acd5e76 Add files in .dist-info directory tests
Since zips don't typically contain directory entries, we want to
only operate on files. Adding files to the .dist-info tests means we
will be able to reuse them for both cases, while they coexist.
2020-01-01 17:26:20 -05:00
Chris Hunt 513a3162de Pass open zip file for wheel into install_unpacked_wheel
With this parameter we can incrementally update code to rely on the zip
file instead of the unpacked source directory.
2020-01-01 17:26:20 -05:00
Christopher Hunt b2f596ba2b
Merge pull request #7536 from chrahunt/refactor/extract-wheel-info-functions
Refactor wheel info extraction during install
2020-01-02 06:25:33 +08:00
Stéphane Bidoul (ACSONE) 68e49b9613 Remove redundant expanduser for download_dir in preparer
Since
- download_dir is only set by the download command
- download_dir is
normalized at the beginning of the download command
- path normalization includes expanduser
Therefore expanduser in the preparer is redundant
2020-01-01 18:54:08 +01:00
Chris Hunt 010c24d64c Take .dist-info dir directly in wheel_metadata
Since retrieval of the .dist-info dir already ensures that a
distribution is found, this reduces responsibility on wheel_metadata and
lets us remove a few tests already covered by the tests for
test_wheel_dist_info_dir_*.
2020-01-01 12:25:01 -05:00
Chris Hunt fc48a17206 Simplify positive wheel_version unit test 2020-01-01 12:25:01 -05:00
Chris Hunt 6c56557fbe Remove unused req_description from wheel_dist_info_dir 2020-01-01 12:25:01 -05:00
Chris Hunt e1c7de8861 Raise UnsupportedWheel instead of AssertionError, and let caller add name 2020-01-01 12:25:01 -05:00
Chris Hunt a539c8dfe0 Normalize exception message for dist_info_dir check 2020-01-01 12:25:01 -05:00
Chris Hunt 32115b55af Extract getting wheel .dist-info directory into a separate function 2020-01-01 12:10:22 -05:00
Chris Hunt c51f020b98 Read WHEEL from .dist-info instead of using has_metadata
This will make it easier to transition to the already-determined
dist-info directory and reduces some of our dependence on pkg_resources.

Despite the name, the `egg_info` member is also populated for
.dist-info dirs.

ensure_str uses encoding='utf-8' and errors='strict' for Python 3
by default, which matches the behavior in
`pkg_resources.NullProvider.get_metadata`.
2020-01-01 12:10:20 -05:00
Tzu-ping Chung 6c2ffcd0ce
Update src/pip/_internal/self_outdated_check.py
Co-Authored-By: Christopher Hunt <chrahunt@gmail.com>
2020-01-02 00:00:59 +08:00
Christopher Hunt ab7e4769db
Merge pull request #7520 from chrahunt/maint/cross-platform-lints
Run linters/docs on Windows and macOS
2020-01-01 23:48:56 +08:00
Xavier Fernandez 6896dfcd83
Merge pull request #7524 from sbidoul/wheel-download-dir-sbi
Ensure wheel download dir is present at the beginning of wheel command
2020-01-01 16:13:38 +01:00
Tzu-ping Chung ed40706534 Use sys.executable to format upgrade message 2020-01-01 22:12:12 +08:00
Chris Hunt c9b0742508 Remove old root_is_purelib
The _invalidversion_ tests are not applicable to the new function since
we do not use a regex to find the applicable folder.
2019-12-31 12:49:08 -05:00
Chris Hunt 42c6dd78b9 Use WHEEL metadata to determine Root-Is-Purelib 2019-12-31 12:47:01 -05:00
Chris Hunt ca729c89de Simplify wheel_version tests 2019-12-31 12:35:53 -05:00
Chris Hunt d66bc398be Split wheel_metadata from wheel_version
This will let us re-use the wheel_metadata for other parts of
processing, and by parameterizing checks in terms of metadata we will be
able to substitute in metadata derived directly from the zip.
2019-12-31 12:35:52 -05:00
Chris Hunt 918b154518 Move info_dir calculation up
This will let us use the value for later processing.
2019-12-31 12:12:17 -05:00
Christopher Hunt 69143848b0
Make WHEEL file errors more explicit (#7529)
* Raise exception on exception in finding wheel dist

We plan to replace this code with direct extraction from a zip, so no
point catching anything more precise.

* Raise exception if no dist is found in wheel_version
* Catch file read errors when reading WHEEL

get_metadata delegates to the underlying implementation which tries
to locate and read the file, throwing an IOError (Python 2) or OSError
subclass on any errors.

Since the new explicit test checks the same case as brokenwheel in
test_wheel_version we remove the redundant test.

* Check for WHEEL decoding errors explicitly

This was the last error that could be thrown by get_metadata, so we can
also remove the catch-all except block.

* Move WHEEL parsing outside try...except

This API does not raise an exception, but returns any errors on the
message object itself. We are preserving the original behavior, and can
decide later whether to start warning or raising our own exception.

* Raise explicit error if Wheel-Version is missing

`email.message.Message.__getitem__` returns None on missing values, so
we have to check for ourselves explicitly.

* Raise explicit exception on failure to parse Wheel-Version

This is also the last exception that can be raised, so we remove
`except Exception`.

* Remove dead code

Since wheel_version never returns None, this exception will never be
raised.
2019-12-31 23:17:41 +08:00
Stéphane Bidoul (ACSONE) a6d212383b
Remove redundant path normalization in preparer
wheel_download_dir is normalized at the
beginning of the wheel command
2019-12-31 05:32:42 +01:00
Christopher Hunt ea7bbff713
Merge pull request #7496 from pradyunsg/refactor/move-legacy-install-process
Move logic for legacy installs to dedicated module
2019-12-31 12:00:23 +08:00
Christopher Hunt e8ded43035
Merge pull request #7523 from sbidoul/wheel-builder-disentangle-7-sbi
Further reduce responsibility of WheelBuilder
2019-12-31 08:32:29 +08:00