* 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)
* 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
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.
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.
* 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.
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.
_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.
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.
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.