Commit Graph

352 Commits

Author SHA1 Message Date
Pradyun Gedam e648e00dc0
pip is spelt all-lowercase 2020-02-18 10:55:16 +05:30
Pradyun Gedam cdae7277ef
Merge pull request #7596 from uranusjr/6446-link-url-quoting
Fix incorrect quoting Link.url
2020-02-14 16:00:43 +05:30
Tzu-ping Chung 6104060580 Swap venv and virtualenv checks
Environments created by pypa/virtualenv >=20 can pass both real_prefix
and base_prefix checks, but are only able to use the pyvenv.cfg values,
not the legacy `no-global-site-packages.txt`. So we need to check for
venv (PEP 405) first.
2020-02-11 17:56:40 +08:00
Chris Hunt efe663d476 Remove unused utils.marker_files 2020-02-05 20:14:44 -05:00
Chris Hunt 63743fcc30 Make ephem-wheel-cache tempdir name globally accessible 2020-02-04 23:01:24 -05:00
Chris Hunt bdde27bfd8 Add BuildEnvironment._temp_dir to tempdir registry
Similar to the InstallRequirement temp build dir, now we'll be able to
refactor this to be globally managed.
2020-02-04 20:31:34 -05:00
Chris Hunt 2f4bfc3efc Add InstallRequirement._temp_build_dir to tempdir registry
Now we can refactor this to be globally managed, and it will have the
same behavior as it does currently (if there is any
PreviousBuildDirError it will not be cleaned up).
2020-02-04 20:29:26 -05:00
Pradyun Gedam e060970d51
Merge pull request #7675 from deepak1725/string-format2
Updated string_formatting to .format
2020-02-02 02:05:34 +05:30
Deepak Sharma d31cf696e8 string_formatting 2020-01-30 20:33:00 +05:30
Chris Hunt 45991bcc1e Use explicit default value for TempDirectory delete flag
Now we can opt-in to globally-managed + globally-configured file
deletion for pre-existing directories by passing an explicit `None`.
2020-01-29 23:04:14 -05:00
Christopher Hunt f1cd4cb48e
Merge pull request #7608 from uranusjr/global-cleanup
Delay TempDirectory.delete resolution to cleanup
2020-01-22 18:25:05 +08:00
Pradyun Gedam f1cf84e2f8
Merge pull request #7542 from sbidoul/normalize-cache-dir-sbi
Eagerly normalize cache directory
2020-01-18 22:38:59 +05:30
Tzu-ping Chung ffa6d9d3d0 Delay TempDirectory.delete resolution to cleanup 2020-01-17 21:06:13 +08:00
Tzu-ping Chung cdd7821d92 Fix incorrect quoting Link.url
Cherry-picked manually from atugushev:fix-issue-6446.

Co-Authored-By: Albert Tugushev <albert@tugushev.ru>
2020-01-14 16:12:11 +08:00
Chris Hunt 0a57e4e9f2 Manage temp directory deletion centrally
This gives us a global toggle that we can use to control whether
temporary directories get deleted from one place (ideally, in the
commands taking --no-clean).
2020-01-10 11:08:05 +01:00
Chris Hunt 3fac3d74ac Inline _make_build_dir in InstallRequirement
This untested function was only used in one place. Inlining it makes it
easier to see the symmetry between the writing of the delete marker file
in `ensure_build_location` and checking for it in
`remove_temporary_source`.
2020-01-08 20:34:28 -05:00
Stéphane Bidoul (ACSONE) 4d79037527
Eagerly normalize the cache directory
Fixes #7541
2020-01-08 08:01:09 +01:00
Chris Hunt 7aaa705c15 Remove unused glibc functions
The remaining glibc-related functions are required to allow us to put
the libc version in the pip user agent (for stats).
2020-01-07 19:01:00 -05:00
Pradyun Gedam 6c515125c2
Merge pradyunsg:revert/6864 into master (#7557)
Revert addition of un-suffixed pip CLI entry points for invocation check on Windows
2020-01-07 08:16:38 +00:00
Pradyun Gedam d9d801f818
Drop no-suffix checks for pip-from-PATH 2020-01-06 19:29:56 +05:30
Stéphane Bidoul (ACSONE) 3ae13f7d28
Move is_wheel_installed to utils 2020-01-05 23:52:40 +01:00
Chris Hunt 33043ba22f Use pkg_resources.Distribution derived from wheel directly
We now extract all metadata files from the wheel directly into memory
and make them available to the wrapping pkg_resources.Distribution via
the DictMetadata introduced earlier.
2020-01-05 10:57:14 -05:00
Chris Hunt ed65393840 Extract reading wheel file from wheel_metadata into separate function 2020-01-04 20:50:17 -05:00
Chris Hunt ae34781826 Parameterize wheel file path for metadata extraction 2020-01-04 20:50:17 -05:00
Chris Hunt 20706eb93f Add DictMetadata for adapting zip data to Distribution
pkg_resources.Distribution classes delegate to the IMetadataProvider
implementation provided at construction. This is the one we'll use for
adapting a ZipFile to pkg_resources.DistInfoDistribution.
2020-01-04 20:49:41 -05:00
Chris Hunt b263fcc105 Move parse_wheel and supporting functions to utils.wheel
In order to parse metadata from wheel files directly we want to reuse
parse_wheel. Moving it out helps avoid creating an unnecessary
dependence on operations.install.wheel.
2020-01-04 23:11:51 +01:00
Chris Hunt 8dc6919875 Fix mypy checks on Windows
Previously we were making unguarded calls to non-Windows-only APIs. Mypy
only automatically excludes these from platform-specific checks when
inside conditions.
2019-12-29 00:33:28 -05:00
Christopher Hunt 0292938f89
Merge pull request #7501 from uranusjr/appdirs-patch 2019-12-24 23:30:55 +08:00
Chris Hunt 38585adaec Add warning when using old console script wrappers
We use sys.stderr instead of our `deprecated` helper because logging is
not set up at the time this is executed.
2019-12-20 22:01:25 -05: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
Chris Hunt 241679e6c2 Setup old entrypoints in pip module
This should make everything "just work" with respect to combinations of
PATH, sys.path, and multiple Python installs. Later we can add a warning
here to help guide users to better understanding.
2019-12-19 21:20:51 -05: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
Maxim Kurnikov 3cb30385d8 remove disallow_untyped_defs=False for more modules 2019-12-13 10:22:21 +03:00
Pradyun Gedam ce5edd4841
Better workaround for cache poisoning (#3025, #7319) 2019-12-12 11:28:57 +00:00
Maxim Kurnikov 38fd95aa6a update to mypy==0.750 2019-12-12 11:08:36 +01: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 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
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) e0165e7b30
Remove unused wheel_builder python_tag argument 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 55a943e556 Add distutils args helpers
The utils.distutils_args.parse_args function can recognize distutils
arguments so we can deprecate their usage.
2019-11-30 17:39:56 -05:00
BorisZZZ 4659fe16bd #6426 Cannot install packages on Docker in Ubuntu in WSL (Windows). (#6427) 2019-11-28 12:05:17 +08:00
Xavier Fernandez 95576102c5
Tweak format_size utility function to include a space (#7399) 2019-11-25 22:09:10 +01:00
Christopher Hunt 9ae2e6440d
Merge pull request #7365 from chrahunt/refactor/cleanup-prepare-2
Cleanup operations.prepare download functions
2019-11-20 06:05:25 +08:00
Christopher Hunt b802331fd2
Simplify abi3 usage in pep425tags (#7367)
abi3 refers to the CPython stable ABI, so we should only ensure it
applies in that particular case.

This simplifies the logic in get_platforms() and makes us more
compatible with the behavior of packaging.tags, which only includes abi3
for cpython_tags() and only the literal "abi3".
2019-11-19 08:24:04 +08:00
Chris Hunt a9997127b9 Don't pass explicit step size to progress indicator
Now the place we construct the progress indicator doesn't need to know
about our strategy for consuming the response, freeing us to extract the
chunk iterator construction into the caller.
2019-11-16 12:37:47 -05:00
Maxim Kurnikov d1452ffabd add global disallow_any_generics=True 2019-11-12 21:08:48 +03:00
Chris Hunt 0a6305a398 Remove unused compat.native_str 2019-11-10 18:06:24 -05:00