diff options
| author | Bernát Gábor <bgabor8@bloomberg.net> | 2021-01-12 10:04:54 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-12 10:04:54 +0000 |
| commit | 39fdf9580bbc25963113761fb7ad8973d6d35a48 (patch) | |
| tree | 80b83173b3a143d53800de104821457b4106e670 /src | |
| parent | 26943f6b5baea29818612ef10a66c8843259f919 (diff) | |
| download | virtualenv-39fdf9580bbc25963113761fb7ad8973d6d35a48.tar.gz | |
Bump pip to 20.3.3 and wheel to 0.36.2 (#2036)
Diffstat (limited to 'src')
| -rw-r--r-- | src/virtualenv/seed/embed/via_app_data/pip_install/base.py | 15 | ||||
| -rw-r--r-- | src/virtualenv/seed/wheels/embed/__init__.py | 38 | ||||
| -rw-r--r-- | src/virtualenv/seed/wheels/embed/pip-20.3.3-py2.py3-none-any.whl (renamed from src/virtualenv/seed/wheels/embed/pip-20.3.1-py2.py3-none-any.whl) | bin | 1518513 -> 1520905 bytes | |||
| -rw-r--r-- | src/virtualenv/seed/wheels/embed/setuptools-51.1.2-py3-none-any.whl (renamed from src/virtualenv/seed/wheels/embed/setuptools-51.0.0-py3-none-any.whl) | bin | 785164 -> 784863 bytes | |||
| -rw-r--r-- | src/virtualenv/seed/wheels/embed/wheel-0.36.2-py2.py3-none-any.whl (renamed from src/virtualenv/seed/wheels/embed/wheel-0.36.1-py2.py3-none-any.whl) | bin | 34788 -> 35046 bytes | |||
| -rw-r--r-- | src/virtualenv/util/path/__init__.py | 2 | ||||
| -rw-r--r-- | src/virtualenv/util/path/_win.py | 19 |
7 files changed, 55 insertions, 19 deletions
diff --git a/src/virtualenv/seed/embed/via_app_data/pip_install/base.py b/src/virtualenv/seed/embed/via_app_data/pip_install/base.py index a1d946d..017b7ef 100644 --- a/src/virtualenv/seed/embed/via_app_data/pip_install/base.py +++ b/src/virtualenv/seed/embed/via_app_data/pip_install/base.py @@ -51,6 +51,7 @@ class PipInstall(object): # 1. first extract the wheel logging.debug("build install image for %s to %s", self._wheel.name, self._image_dir) with zipfile.ZipFile(str(self._wheel)) as zip_ref: + self._shorten_path_if_needed(zip_ref) zip_ref.extractall(str(self._image_dir)) self._extracted = True # 2. now add additional files not present in the distribution @@ -58,6 +59,20 @@ class PipInstall(object): # 3. finally fix the records file self._fix_records(new_files) + def _shorten_path_if_needed(self, zip_ref): + if os.name == "nt": + to_folder = str(self._image_dir) + # https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation + zip_max_len = max(len(i) for i in zip_ref.namelist()) + path_len = zip_max_len + len(to_folder) + if path_len > 260: + self._image_dir.mkdir(exist_ok=True) # to get a short path must exist + + from virtualenv.util.path import get_short_path_name + + to_folder = get_short_path_name(to_folder) + self._image_dir = Path(to_folder) + def _records_text(self, files): record_data = "\n".join( "{},,".format(os.path.relpath(ensure_text(str(rec)), ensure_text(str(self._image_dir)))) for rec in files diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py index 5233e48..43ca638 100644 --- a/src/virtualenv/seed/wheels/embed/__init__.py +++ b/src/virtualenv/seed/wheels/embed/__init__.py @@ -6,34 +6,34 @@ from virtualenv.util.path import Path BUNDLE_FOLDER = Path(__file__).absolute().parent BUNDLE_SUPPORT = { "3.10": { - "pip": "pip-20.3.1-py2.py3-none-any.whl", - "setuptools": "setuptools-51.0.0-py3-none-any.whl", - "wheel": "wheel-0.36.1-py2.py3-none-any.whl", + "pip": "pip-20.3.3-py2.py3-none-any.whl", + "setuptools": "setuptools-51.1.2-py3-none-any.whl", + "wheel": "wheel-0.36.2-py2.py3-none-any.whl", }, "3.9": { - "pip": "pip-20.3.1-py2.py3-none-any.whl", - "setuptools": "setuptools-51.0.0-py3-none-any.whl", - "wheel": "wheel-0.36.1-py2.py3-none-any.whl", + "pip": "pip-20.3.3-py2.py3-none-any.whl", + "setuptools": "setuptools-51.1.2-py3-none-any.whl", + "wheel": "wheel-0.36.2-py2.py3-none-any.whl", }, "3.8": { - "pip": "pip-20.3.1-py2.py3-none-any.whl", - "setuptools": "setuptools-51.0.0-py3-none-any.whl", - "wheel": "wheel-0.36.1-py2.py3-none-any.whl", + "pip": "pip-20.3.3-py2.py3-none-any.whl", + "setuptools": "setuptools-51.1.2-py3-none-any.whl", + "wheel": "wheel-0.36.2-py2.py3-none-any.whl", }, "3.7": { - "pip": "pip-20.3.1-py2.py3-none-any.whl", - "setuptools": "setuptools-51.0.0-py3-none-any.whl", - "wheel": "wheel-0.36.1-py2.py3-none-any.whl", + "pip": "pip-20.3.3-py2.py3-none-any.whl", + "setuptools": "setuptools-51.1.2-py3-none-any.whl", + "wheel": "wheel-0.36.2-py2.py3-none-any.whl", }, "3.6": { - "pip": "pip-20.3.1-py2.py3-none-any.whl", - "setuptools": "setuptools-51.0.0-py3-none-any.whl", - "wheel": "wheel-0.36.1-py2.py3-none-any.whl", + "pip": "pip-20.3.3-py2.py3-none-any.whl", + "setuptools": "setuptools-51.1.2-py3-none-any.whl", + "wheel": "wheel-0.36.2-py2.py3-none-any.whl", }, "3.5": { - "pip": "pip-20.3.1-py2.py3-none-any.whl", + "pip": "pip-20.3.3-py2.py3-none-any.whl", "setuptools": "setuptools-50.3.2-py3-none-any.whl", - "wheel": "wheel-0.36.1-py2.py3-none-any.whl", + "wheel": "wheel-0.36.2-py2.py3-none-any.whl", }, "3.4": { "pip": "pip-19.1.1-py2.py3-none-any.whl", @@ -41,9 +41,9 @@ BUNDLE_SUPPORT = { "wheel": "wheel-0.33.6-py2.py3-none-any.whl", }, "2.7": { - "pip": "pip-20.3.1-py2.py3-none-any.whl", + "pip": "pip-20.3.3-py2.py3-none-any.whl", "setuptools": "setuptools-44.1.1-py2.py3-none-any.whl", - "wheel": "wheel-0.36.1-py2.py3-none-any.whl", + "wheel": "wheel-0.36.2-py2.py3-none-any.whl", }, } MAX = "3.10" diff --git a/src/virtualenv/seed/wheels/embed/pip-20.3.1-py2.py3-none-any.whl b/src/virtualenv/seed/wheels/embed/pip-20.3.3-py2.py3-none-any.whl Binary files differindex fbac5d3..b753b72 100644 --- a/src/virtualenv/seed/wheels/embed/pip-20.3.1-py2.py3-none-any.whl +++ b/src/virtualenv/seed/wheels/embed/pip-20.3.3-py2.py3-none-any.whl diff --git a/src/virtualenv/seed/wheels/embed/setuptools-51.0.0-py3-none-any.whl b/src/virtualenv/seed/wheels/embed/setuptools-51.1.2-py3-none-any.whl Binary files differindex 7e60e11..9e6d457 100644 --- a/src/virtualenv/seed/wheels/embed/setuptools-51.0.0-py3-none-any.whl +++ b/src/virtualenv/seed/wheels/embed/setuptools-51.1.2-py3-none-any.whl diff --git a/src/virtualenv/seed/wheels/embed/wheel-0.36.1-py2.py3-none-any.whl b/src/virtualenv/seed/wheels/embed/wheel-0.36.2-py2.py3-none-any.whl Binary files differindex 1f17303..ead39b0 100644 --- a/src/virtualenv/seed/wheels/embed/wheel-0.36.1-py2.py3-none-any.whl +++ b/src/virtualenv/seed/wheels/embed/wheel-0.36.2-py2.py3-none-any.whl diff --git a/src/virtualenv/util/path/__init__.py b/src/virtualenv/util/path/__init__.py index a7f7163..dc628de 100644 --- a/src/virtualenv/util/path/__init__.py +++ b/src/virtualenv/util/path/__init__.py @@ -3,6 +3,7 @@ from __future__ import absolute_import, unicode_literals from ._pathlib import Path from ._permission import make_exe, set_tree from ._sync import copy, copytree, ensure_dir, safe_delete, symlink +from ._win import get_short_path_name __all__ = ( "ensure_dir", @@ -13,4 +14,5 @@ __all__ = ( "make_exe", "set_tree", "safe_delete", + "get_short_path_name", ) diff --git a/src/virtualenv/util/path/_win.py b/src/virtualenv/util/path/_win.py new file mode 100644 index 0000000..02e16d0 --- /dev/null +++ b/src/virtualenv/util/path/_win.py @@ -0,0 +1,19 @@ +def get_short_path_name(long_name): + """ + Gets the short path name of a given long path. + http://stackoverflow.com/a/23598461/200291 + """ + import ctypes + from ctypes import wintypes + + _GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW + _GetShortPathNameW.argtypes = [wintypes.LPCWSTR, wintypes.LPWSTR, wintypes.DWORD] + _GetShortPathNameW.restype = wintypes.DWORD + output_buf_size = 0 + while True: + output_buf = ctypes.create_unicode_buffer(output_buf_size) + needed = _GetShortPathNameW(long_name, output_buf, output_buf_size) + if output_buf_size >= needed: + return output_buf.value + else: + output_buf_size = needed |
