diff options
| author | Bernát Gábor <bgabor8@bloomberg.net> | 2020-04-29 19:15:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-29 19:15:37 +0100 |
| commit | 18de796ec5bd032aa27cfe6e5efb68ccfff54a31 (patch) | |
| tree | aeb26a22cfc1c9304fe78a26f081b51a31d3a1db | |
| parent | 43e4b1e06f55af55b213fc4a23b19aca84afb01a (diff) | |
| download | virtualenv-18de796ec5bd032aa27cfe6e5efb68ccfff54a31.tar.gz | |
Bump pip to 20.1 (#1795)
| -rw-r--r-- | .pre-commit-config.yaml | 12 | ||||
| -rw-r--r-- | docs/changelog/1793.bugfix.rst | 1 | ||||
| -rw-r--r-- | src/virtualenv/seed/embed/wheels/__init__.py | 12 | ||||
| -rw-r--r-- | src/virtualenv/seed/embed/wheels/pip-20.1-py2.py3-none-any.whl (renamed from src/virtualenv/seed/embed/wheels/pip-20.0.2-py2.py3-none-any.whl) | bin | 1440952 -> 1489786 bytes | |||
| -rw-r--r-- | tasks/make_zipapp.py | 24 | ||||
| -rw-r--r-- | tests/integration/test_zipapp.py | 10 | ||||
| -rw-r--r-- | tests/unit/create/console_app/setup.cfg | 1 |
7 files changed, 43 insertions, 17 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a59adab..79bbc2f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,13 +6,13 @@ repos: args: [--safe] language_version: python3.8 - repo: https://github.com/asottile/blacken-docs - rev: v1.5.0-1 + rev: v1.6.0 hooks: - id: blacken-docs additional_dependencies: [black==19.10b0] language_version: python3.8 - repo: https://github.com/asottile/seed-isort-config - rev: v1.9.4 + rev: v2.1.1 hooks: - id: seed-isort-config args: [--application-directories, '.:src'] @@ -21,7 +21,7 @@ repos: hooks: - id: isort - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 + rev: v2.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -38,15 +38,15 @@ repos: additional_dependencies: ["flake8-bugbear == 20.1.2"] language_version: python3.8 - repo: https://github.com/asottile/pyupgrade - rev: v1.26.2 + rev: v2.3.0 hooks: - id: pyupgrade - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.4.4 + rev: v1.5.1 hooks: - id: rst-backticks - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.6.0 + rev: v1.9.0 hooks: - id: setup-cfg-fmt args: [--min-py3-version, "3.4"] diff --git a/docs/changelog/1793.bugfix.rst b/docs/changelog/1793.bugfix.rst new file mode 100644 index 0000000..9c7dfbc --- /dev/null +++ b/docs/changelog/1793.bugfix.rst @@ -0,0 +1 @@ +Upgrade pip for Python ``2.7`` and ``3.5+`` from ``20.0.2`` to ``20.1`` - by :user:`gaborbernat`. diff --git a/src/virtualenv/seed/embed/wheels/__init__.py b/src/virtualenv/seed/embed/wheels/__init__.py index c619e35..826272b 100644 --- a/src/virtualenv/seed/embed/wheels/__init__.py +++ b/src/virtualenv/seed/embed/wheels/__init__.py @@ -2,27 +2,27 @@ from __future__ import absolute_import, unicode_literals BUNDLE_SUPPORT = { "3.9": { - "pip": "pip-20.0.2-py2.py3-none-any.whl", + "pip": "pip-20.1-py2.py3-none-any.whl", "setuptools": "setuptools-46.1.3-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, "3.8": { - "pip": "pip-20.0.2-py2.py3-none-any.whl", + "pip": "pip-20.1-py2.py3-none-any.whl", "setuptools": "setuptools-46.1.3-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, "3.7": { - "pip": "pip-20.0.2-py2.py3-none-any.whl", + "pip": "pip-20.1-py2.py3-none-any.whl", "setuptools": "setuptools-46.1.3-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, "3.6": { - "pip": "pip-20.0.2-py2.py3-none-any.whl", + "pip": "pip-20.1-py2.py3-none-any.whl", "setuptools": "setuptools-46.1.3-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, "3.5": { - "pip": "pip-20.0.2-py2.py3-none-any.whl", + "pip": "pip-20.1-py2.py3-none-any.whl", "setuptools": "setuptools-46.1.3-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, @@ -32,7 +32,7 @@ BUNDLE_SUPPORT = { "wheel": "wheel-0.33.6-py2.py3-none-any.whl", }, "2.7": { - "pip": "pip-20.0.2-py2.py3-none-any.whl", + "pip": "pip-20.1-py2.py3-none-any.whl", "setuptools": "setuptools-44.1.0-py2.py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, diff --git a/src/virtualenv/seed/embed/wheels/pip-20.0.2-py2.py3-none-any.whl b/src/virtualenv/seed/embed/wheels/pip-20.1-py2.py3-none-any.whl Binary files differindex 318c448..925a59f 100644 --- a/src/virtualenv/seed/embed/wheels/pip-20.0.2-py2.py3-none-any.whl +++ b/src/virtualenv/seed/embed/wheels/pip-20.1-py2.py3-none-any.whl diff --git a/tasks/make_zipapp.py b/tasks/make_zipapp.py index dae6336..764b98c 100644 --- a/tasks/make_zipapp.py +++ b/tasks/make_zipapp.py @@ -12,12 +12,13 @@ import zipfile from collections import defaultdict, deque from email import message_from_string from pathlib import Path, PurePosixPath +from stat import S_IWUSR from tempfile import TemporaryDirectory from packaging.markers import Marker from packaging.requirements import Requirement -HERE = Path(__file__).parent +HERE = Path(__file__).parent.absolute() VERSIONS = ["3.{}".format(i) for i in range(9, 3, -1)] + ["2.7"] @@ -194,9 +195,26 @@ class WheelDownloader(object): def build_sdist(self, target): if target.is_dir(): - folder = self.into + # pip 20.1 no longer guarantees this to be parallel safe, need to copy/lock + with TemporaryDirectory() as temp_folder: + folder = Path(temp_folder) / target.name + shutil.copytree( + str(target), str(folder), ignore=shutil.ignore_patterns(".tox", "venv", "__pycache__", "*.pyz"), + ) + try: + return self._build_sdist(self.into, folder) + finally: + # permission error on Windows <3.7 https://bugs.python.org/issue26660 + def onerror(func, path, exc_info): + os.chmod(path, S_IWUSR) + func(path) + + shutil.rmtree(str(folder), onerror=onerror) + else: - folder = target.parent / target.stem + return self._build_sdist(target.parent / target.stem, target) + + def _build_sdist(self, folder, target): if not folder.exists() or not list(folder.iterdir()): cmd = self.pip_cmd + ["wheel", "-w", str(folder), "--no-deps", str(target), "-q"] run_suppress_output(cmd, stop_print_on_fail=True) diff --git a/tests/integration/test_zipapp.py b/tests/integration/test_zipapp.py index 191fd5a..71a85ec 100644 --- a/tests/integration/test_zipapp.py +++ b/tests/integration/test_zipapp.py @@ -29,7 +29,15 @@ def zipapp_build_env(tmp_path_factory): try: # create a virtual environment which is also guaranteed to contain a recent enough pip (bundled) session = cli_run( - ["-vvv", "-p", "{}3.{}".format(impl, version), "--activators", "", str(create_env_path)] + [ + "-vvv", + "-p", + "{}3.{}".format(impl, version), + "--activators", + "", + str(create_env_path), + "--no-download", + ] ) exe = str(session.creator.exe) found = True diff --git a/tests/unit/create/console_app/setup.cfg b/tests/unit/create/console_app/setup.cfg index abf82e0..eda12f2 100644 --- a/tests/unit/create/console_app/setup.cfg +++ b/tests/unit/create/console_app/setup.cfg @@ -5,7 +5,6 @@ description = magic package [options] packages = find: -install_requires = [options.entry_points] console_scripts = |
