Skip to content

Commit

Permalink
Bump embedded pip and setuptools (#2489)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat authored Feb 6, 2023
1 parent a98c3f5 commit 9b4b17f
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 140 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ assignees: ""

**Alternative Solutions**

<!-- Have you tried to workaround the problem using virtualenv or other tools? Or a different approach to solving this issue? Please elaborate here. -->
<!-- Have you tried to workaround the problem using virtualenv or other tools? Or a different approach to solving this
issue? Please elaborate here. -->

**Additional context**

Expand Down
44 changes: 1 addition & 43 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,48 +93,6 @@ jobs:
PYTEST_ADDOPTS: "-vv --durations=20"
CI_RUN: "yes"
DIFF_AGAINST: HEAD
- name: Rename coverage report file
run: |
import os; import sys
os.rename(f".tox/.coverage.{os.environ['TOXENV']}", f".tox/.coverage.{os.environ['TOXENV']}-{sys.platform}")
shell: python
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: ".tox/.coverage.*"

coverage:
name: Combine coverage
runs-on: ubuntu-22.04
needs: test
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install tox
run: python -m pip install tox
- name: Setup coverage tool
run: tox -e coverage --notest
- name: Install package builder
run: python -m pip install build
- name: Build package
run: pyproject-build --wheel .
- name: Download coverage data
uses: actions/download-artifact@v3
with:
name: coverage-data
path: .tox
- name: Combine and report coverage
run: tox -e coverage
- name: Upload HTML report
uses: actions/upload-artifact@v3
with:
name: html-report
path: .tox/htmlcov

check:
name: ${{ matrix.tox_env }} - ${{ matrix.os }}
Expand Down Expand Up @@ -171,7 +129,7 @@ jobs:
UPGRADE_ADVISORY: "yes"

publish:
needs: [check, coverage]
needs: [check]
runs-on: ubuntu-22.04
steps:
- name: Setup python to build package
Expand Down
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.1
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py37-plus"]
Expand All @@ -28,25 +28,25 @@ repos:
- id: pyupgrade
files: "^(src/virtualenv/create/via_global_ref/_virtualenv.py|src/virtualenv/create/via_global_ref/builtin/python2/site.py|src/virtualenv/discovery/py_info.py|tasks/__main__zipapp.py)$"
- repo: https://github.com/PyCQA/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
args: [--safe]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
rev: 1.13.0
hooks:
- id: blacken-docs
additional_dependencies: [black==22.12]
additional_dependencies: [black==23.1]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
rev: v1.10.0
hooks:
- id: rst-backticks
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "0.5.2"
rev: "0.6.1"
hooks:
- id: tox-ini-fmt
args: ["-p", "fix"]
Expand All @@ -55,11 +55,11 @@ repos:
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==22.12.6
- flake8-bugbear==23.1.20
- flake8-comprehensions==3.10.1
- flake8-pytest-style==1.6
- flake8-spellcheck==0.28
- flake8-unused-arguments==0.0.12
- flake8-unused-arguments==0.0.13
- flake8-noqa==1.3
- pep8-naming==0.13.3
- flake8-pyproject==1.2.2
Expand All @@ -68,11 +68,11 @@ repos:
hooks:
- id: prettier
additional_dependencies:
- prettier@3.0.0-alpha.4
- prettier@2.7.1
- "@prettier/plugin-xml@2.2"
args: ["--print-width=120", "--prose-wrap=always"]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.2
rev: v0.33.0
hooks:
- id: markdownlint
- repo: meta
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/2489.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bump embedded pip to ``23.0`` and setuptools to ``67.1`` - by :user:`gaborbernat`.
77 changes: 43 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,62 +1,71 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatch-vcs>=0.3", "hatchling>=1.11.1"]
requires = [
"hatch-vcs>=0.3",
"hatchling>=1.12.2",
]

[project]
name = "virtualenv"
description = "Virtual Python Environment builder"
readme = "README.md"
keywords = [
"environments",
"isolated",
"virtual",
]
license = "MIT"
maintainers = [{ name = "Bernat Gabor", email = "gaborjbernat@gmail.com" }]
urls.Documentation = "https://virtualenv.pypa.io"
urls.Homepage = "https://github.com/pypa/virtualenv"
urls.Source = "https://github.com/pypa/virtualenv"
urls.Tracker = "https://github.com/pypa/virtualenv/issues"
scripts.virtualenv = "virtualenv.__main__:run_with_catch"
requires-python = ">=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
]
dynamic = [
"version",
]
dependencies = [
"distlib<1,>=0.3.6",
"filelock<4,>=3.4.1",
'importlib-metadata>=4.8.3; python_version < "3.8"',
"platformdirs<3,>=2.4",
]
optional-dependencies.docs = [
"proselint>=0.13",
"sphinx>=5.3",
"sphinx-argparse>=0.4",
"sphinx-rtd-theme>=1.1.1",
"towncrier>=22.12",
]
optional-dependencies.test = [
"covdefaults>=2.2.2",
"coverage>=7.0.2",
"coverage>=7.1",
"coverage-enable-subprocess>=1",
"flaky>=3.7",
"packaging>=22",
"pytest>=7.2",
"packaging>=23",
"pytest>=7.2.1",
"pytest-env>=0.8.1",
"pytest-freezegun>=0.4.2",
"pytest-mock>=3.10",
"pytest-randomly>=3.12",
"pytest-timeout>=2.1",
]
optional-dependencies.docs = [
"proselint>=0.13",
"sphinx>=5.3",
"sphinx-argparse>=0.4",
"sphinx-rtd-theme>=1.1.1",
"towncrier>=22.12",
]
keywords = ["environments", "isolated", "virtual"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
]
dynamic = ["version"]
urls.Documentation = "https://virtualenv.pypa.io"
urls.Homepage = "https://github.com/pypa/virtualenv"
urls.Source = "https://github.com/pypa/virtualenv"
urls.Tracker = "https://github.com/pypa/virtualenv/issues"
scripts.virtualenv = "virtualenv.__main__:run_with_catch"

[project.entry-points."virtualenv.activate"]
bash = "virtualenv.activation.bash:BashActivator"
Expand Down Expand Up @@ -137,4 +146,4 @@ ignore = [
markers = ["slow"]
timeout = 600
addopts = "--tb=auto -ra --showlocals --no-success-flaky-report"
env = ["PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command", "PYTHONIOENCODING=utf-8"]
env = ["PYTHONIOENCODING=utf-8"]
1 change: 0 additions & 1 deletion src/virtualenv/config/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def __init__(self, prog):
super().__init__(prog, max_help_position=32, width=240)

def _get_help_string(self, action):

text = super()._get_help_string(action)
if hasattr(action, "default_source"):
default = " (default: %(default)s)"
Expand Down
24 changes: 12 additions & 12 deletions src/virtualenv/seed/wheels/embed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@
BUNDLE_FOLDER = Path(__file__).absolute().parent
BUNDLE_SUPPORT = {
"3.12": {
"pip": "pip-22.3.1-py3-none-any.whl",
"setuptools": "setuptools-65.6.3-py3-none-any.whl",
"pip": "pip-23.0-py3-none-any.whl",
"setuptools": "setuptools-67.1.0-py3-none-any.whl",
"wheel": "wheel-0.38.4-py3-none-any.whl",
},
"3.11": {
"pip": "pip-22.3.1-py3-none-any.whl",
"setuptools": "setuptools-65.6.3-py3-none-any.whl",
"pip": "pip-23.0-py3-none-any.whl",
"setuptools": "setuptools-67.1.0-py3-none-any.whl",
"wheel": "wheel-0.38.4-py3-none-any.whl",
},
"3.10": {
"pip": "pip-22.3.1-py3-none-any.whl",
"setuptools": "setuptools-65.6.3-py3-none-any.whl",
"pip": "pip-23.0-py3-none-any.whl",
"setuptools": "setuptools-67.1.0-py3-none-any.whl",
"wheel": "wheel-0.38.4-py3-none-any.whl",
},
"3.9": {
"pip": "pip-22.3.1-py3-none-any.whl",
"setuptools": "setuptools-65.6.3-py3-none-any.whl",
"pip": "pip-23.0-py3-none-any.whl",
"setuptools": "setuptools-67.1.0-py3-none-any.whl",
"wheel": "wheel-0.38.4-py3-none-any.whl",
},
"3.8": {
"pip": "pip-22.3.1-py3-none-any.whl",
"setuptools": "setuptools-65.6.3-py3-none-any.whl",
"pip": "pip-23.0-py3-none-any.whl",
"setuptools": "setuptools-67.1.0-py3-none-any.whl",
"wheel": "wheel-0.38.4-py3-none-any.whl",
},
"3.7": {
"pip": "pip-22.3.1-py3-none-any.whl",
"setuptools": "setuptools-65.6.3-py3-none-any.whl",
"pip": "pip-23.0-py3-none-any.whl",
"setuptools": "setuptools-67.1.0-py3-none-any.whl",
"wheel": "wheel-0.38.4-py3-none-any.whl",
},
"3.6": {
Expand Down
Binary file not shown.
Binary file not shown.
7 changes: 3 additions & 4 deletions tests/integration/test_zipapp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import shutil
import subprocess
import sys
from pathlib import Path

import pytest
Expand All @@ -16,14 +15,14 @@
@pytest.fixture(scope="session")
def zipapp_build_env(tmp_path_factory):
create_env_path = None
if sys.version_info[0:2] >= (3, 5) and CURRENT.implementation != "PyPy":
if CURRENT.implementation != "PyPy":
exe = CURRENT.executable # guaranteed to contain a recent enough pip (tox.ini)
else:
create_env_path = tmp_path_factory.mktemp("zipapp-create-env")
exe, found = None, False
# prefer CPython as builder as pypy is slow
for impl in ["cpython", ""]:
for version in range(8, 4, -1):
for version in range(11, 6, -1):
try:
# create a virtual environment which is also guaranteed to contain a recent enough pip (bundled)
session = cli_run(
Expand All @@ -47,7 +46,7 @@ def zipapp_build_env(tmp_path_factory):
break
else:
raise RuntimeError("could not find a python to build zipapp")
cmd = [str(Path(exe).parent / "pip"), "install", "pip>=19.3", "packaging>=20"]
cmd = [str(Path(exe).parent / "pip"), "install", "pip>=23", "packaging>=23"]
subprocess.check_call(cmd)
yield exe
if create_env_path is not None:
Expand Down
Loading

0 comments on commit 9b4b17f

Please sign in to comment.