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

1859 commits

Author SHA1 Message Date
Tzu-ping Chung
f6afa1a154 Make appdirs detect IronPython Windows 2019-12-20 15:42:44 +08:00
Tzu-ping Chung
2ccc5c055d Match site_config_dirs for empty XDG_CONFIG_DIRS 2019-12-20 14:36:30 +08:00
Tzu-ping Chung
368c811467 Treat Windows an macOS as special case in appdirs 2019-12-20 14:16:30 +08:00
Tzu-ping Chung
82b456e043
Fix typo in docstring
Co-Authored-By: Christopher Hunt <chrahunt@gmail.com>
2019-12-20 14:15:52 +08:00
Tzu-ping Chung
204887da03 Apply changes from bundled appdirs to vendored
* Convert Windows app data directory values to bytes on Python 2, so the
  output type is consistent across platforms (pypa/pip#4000)
* Also look in ~/.config for user config on macOS (pypa/pip#4100)
* Remove pywin32 dependency, only use ctypes and winreg for directory
  lookup on Windows (pypa/pip#2467)
* Always use os.path.join() instead of os.sep.join() so cross-platform
  tests work as expected (pypa/pip#3275)
2019-12-19 17:15:03 +08:00
Tzu-ping Chung
2472a6e51d Fix path in _vendor/README.rst to match reality 2019-12-18 13:23:15 +01:00
Pradyun Gedam
d613433ad8
Merge pull request #7492 from pradyunsg/refactor/expand-metadata-generation-arguments
Expand arguments to metadata generation functions
2019-12-18 09:40:14 +00:00
Pradyun Gedam
75f7f06ca7
Move assertions to calling functions 2019-12-18 11:53:34 +05:30
Christopher Hunt
2a48286178
Merge pull request #7484 from sbidoul/wheel-builder-disentangle-3-sbi
Add missing error logging in WheelBuilder
2019-12-18 13:12:54 +08:00
Christopher Hunt
ab12706aaa
Merge pull request #7478 from chrahunt/refactor/make-functional-download-tests
Make unpack_* unit tests into functional tests
2019-12-17 07:55:29 +08:00
Stéphane Bidoul (ACSONE)
2a1fb915e2
Remove useless pass statement
Co-Authored-By: Christopher Hunt <chrahunt@gmail.com>
2019-12-16 17:44:34 +01:00
Pradyun Gedam
350a5986c9
Expand the arguments for modern metadata generation 2019-12-16 17:26:17 +05:30
Pradyun Gedam
00bc7d1727
Expand the arguments for legacy metadata generation 2019-12-16 17:26:17 +05:30
Pradyun Gedam
17428d9eab
Add an InstallRequirement._generate_metadata method 2019-12-16 17:26:12 +05:30
Stéphane Bidoul (ACSONE)
45222a2b36
ensure cache dir is present before building 2019-12-15 23:56:20 +01:00
Christopher Hunt
d6491fe666
Merge pull request #7483 from chrahunt/refactor/install-packed-wheel
Add downloaded/local archive path to InstallRequirement
2019-12-15 23:50:36 +08:00
victorvpaulo
81805a5776 Add option to silence warnings related to deprecation of Python versions (#6739)
* Add option to silence warnings related to deprecation of Python versions

* Move skip_if_python2 and skip_if_not_python2 decorator declaratios to test/lib/__init__.py and use them in test_warning.py

* Add tests to ensure that python version deprecation warning is shown correctly and can be silenced by a flag.

* Add new test to ensure that --no-python-version-warning flag does nothing if python version is not 2
2019-12-15 09:59:34 +08:00
Stéphane Bidoul (ACSONE)
2f125342e0
Remove now redundant ensure_dir
Since _build_one ensure the output dir is
present and does proper error logging,
we can remove ensure_dir from build(), further
simplifying that method.
2019-12-14 23:01:58 +01:00
Stéphane Bidoul (ACSONE)
5de1d51610
Ensure output directory is present inside _build_one 2019-12-14 23:01:58 +01:00
Stéphane Bidoul (ACSONE)
f60d15ca87
Add missing error report
Use the same error message as in WheelBuilder.build(),
include the exception in the message.
2019-12-14 23:01:58 +01:00
Christopher Hunt
9573c2b6c6
Merge pull request #7476 from sbidoul/wheel-builder-disentangle-2-sbi
Some more trivial refactorings in WheelBuilder
2019-12-15 05:28:47 +08:00
Chris Hunt
11472e1b12 Switch to install_wheel in InstallRequirement
This removes one of usages of the overloaded `source_dir` member.

We know the local_file_path must be set at this point because it is set
in the only 3 places that wheels are added to InstallRequirement.
2019-12-14 12:15:33 -05:00
Chris Hunt
327c295554 Keep path to downloaded archive on InstallRequirement
Now we'll be able to transition other parts of the code to use
pre-existing archives directly instead of relying on unpacked sources.
2019-12-14 11:59:42 -05:00
Chris Hunt
c565d7a1b2 Switch to install_wheel in unit tests
Since it tests install_unpacked_wheel, the coverage should be the same.
2019-12-14 11:38:31 -05:00
Chris Hunt
3f912ad48e Add function to install directly from wheel files
This will help us avoid some complicated directory-changing logic in
WheelBuilder.
2019-12-14 11:38:31 -05:00
Christopher Hunt
fedde5fa2c
Do not cleanup archive download tempdir immediately (#7479)
* Do not cleanup download tempdir immediately

The previous logic forced us to handle populating the download directory
in this function right next to the download and hash checking. By
extending the lifetime of the directory we can more easily separate the
code.

This also allows for additional optimizations later: by using metadata
from wheels directly instead of unpacking them, we can avoid extracting
wheels unnecessarily. Unpacked files can be easily 3x larger than the
archives themselves, so this should reduce disk utilization and general
IO significantly.
2019-12-14 23:19:25 +08:00
Stéphane Bidoul (ACSONE)
510970968f
Remove unused WheelBuilder attribute
Remnant of a reverted feature.
2019-12-14 12:47:23 +01:00
Stéphane Bidoul (ACSONE)
c0d05dc6a3
Make _collect_buildset a standalone function 2019-12-14 12:47:23 +01:00
Stéphane Bidoul (ACSONE)
b9faa61c8f
Remove incorrect os.path.join in WheelBuilder
The join is done in _build_one_inside_env.
The bug as undetected because the cache directory is absolute most of
the time.
2019-12-14 12:47:23 +01:00
Chris Hunt
d30f406c37 Check file actually used against hashes
This makes the behavior of this function easier to test, since we can
use a different file to distinguish the already-downloaded case from the
existing-file-hash-failed case.
2019-12-13 20:30:45 -05:00
Stéphane Bidoul (ACSONE)
98f6ff8661
Rename output_dir to cache_dir in WheelBuilder for clarity 2019-12-13 22:01:54 +01:00
Stéphane Bidoul (ACSONE)
9e737fe511
Extract buildset collection from WheelBuilder.build
Towards splitting the build method in two
for pip wheel and pip install cases.
2019-12-13 21:42:06 +01:00
Pradyun Gedam
b9bdad23bc
Do not depend on cached download for copying downloaded file (#7474) 2019-12-13 10:19:56 +00:00
Maxim Kurnikov
3cb30385d8 remove disallow_untyped_defs=False for more modules 2019-12-13 10:22:21 +03:00
Maxim Kurnikov
58e2a99ccf remove disallow_untyped_defs=False for most of pip._internal.cli modules 2019-12-13 09:58:52 +03:00
Chris Hunt
7dea92e5b3 Replace already_downloaded_path with existence check
These statements are equivalent, so we exchange them. This will make it
easier to factor the download_dir concerns out of these functions.
2019-12-13 00:46:44 -05:00
Pradyun Gedam
8e7a87bf4b
Factor out pep517 wheel build function (#7473) 2019-12-13 04:26:44 +00:00
Chris Hunt
6b0a79501c Assert that target file does not exist
_check_download_dir will only return a falsy value if either:

* the provided path does not exist
* the hash does not match - in which case the file is unlinked

so the file cannot exist at either of these points.
2019-12-12 21:18:03 -05:00
Christopher Hunt
d7eaede434
Revert "Add new option: pip wheel --save-wheel-names (#6377)" (#7420)
This reverts commit bcad1b1cb5, reversing
changes made to f86490317a.

As discussed, we should rethink the interface of this command output as
part of larger CLI usability review. In the interim, the same
functionality can be achieved using straightforward shell commands.
2019-12-13 07:57:05 +08:00
Stéphane Bidoul (ACSONE)
339e061e6b
Don't pass req to _build_wheel_pep517 2019-12-12 23:46:05 +01:00
Stéphane Bidoul (ACSONE)
2eff06e7cc
Make WheelBuilder should_unpack argument explicit 2019-12-12 23:46:05 +01:00
Stéphane Bidoul (ACSONE)
deb322d7b7
Move pep517 wheel build method to standalone function 2019-12-12 23:45:45 +01:00
Maxim Kurnikov
b69560661b remove disallow_untyped_defs=False for pip._internal.distributions, pip._internal.operations.prepare 2019-12-12 21:35:37 +01:00
Chris Hunt
fe320a3da0 Remove redundant build_dir normalization 2019-12-12 21:46:04 +08:00
Chris Hunt
95c3f632e3 Handle build dir normalization in cmdoptions
Technically this changes behavior in DownloadCommand, which does not
make build_dir absolute, but given that it is used the same way as in
InstallCommand and WheelCommand (which do make it absolute), it should
not have any visible impact.
2019-12-12 21:46:04 +08:00
Chris Hunt
b6e007c6a8 Remove redundant src_dir normalization 2019-12-12 21:46:04 +08:00
Chris Hunt
a046c4f0c3 Handle making --src-dir absolute at option declaration
This will let us reduce duplication of this option normalization in a
few of our commands.
2019-12-12 21:46:04 +08:00
Pradyun Gedam
ce5edd4841
Better workaround for cache poisoning (#3025, #7319) 2019-12-12 11:28:57 +00:00
Paul Moore
8eb3bdbd69
Merge pull request #7471 from pfmoore/runpy_comment
Add a comment showing how to call main using runpy
2019-12-12 11:22:27 +00:00
Paul Moore
241a3cb6f2 Update wording based on review comments 2019-12-12 10:50:58 +00:00