diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 0fb0e6ed3..e929054a2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -41,14 +41,11 @@ jobs: - { os: macos-latest, py: "brew@3.9" } - { os: macos-latest, py: "brew@3.8" } - { os: ubuntu-latest, py: "3.7" } - - { os: windows-latest, py: "3.7" } - { os: macos-13, py: "3.7" } - - { os: ubuntu-latest, py: "pypy-3.7" } - - { os: windows-latest, py: "pypy-3.7" } - - { os: macos-13, py: "pypy-3.7" } exclude: - { os: windows-latest, py: "pypy-3.10" } - { os: windows-latest, py: "pypy-3.9" } + - { os: windows-latest, py: "pypy-3.8" } steps: - uses: taiki-e/install-action@cargo-binstall - name: Install OS dependencies @@ -97,7 +94,9 @@ jobs: - name: Pick environment to run run: | import os; import platform; import sys; from pathlib import Path - env = f'TOXENV=py{"" if platform.python_implementation() == "CPython" else "py"}3{sys.version_info.minor}' + plat = platform.python_implementation() + e = f"3.{sys.version_info.minor}" if plat == "CPython" else f"pypy3{sys.version_info.minor}" + env = f"TOXENV={e}" print(f"Picked: {env} for {sys.version} based of {sys.executable}") with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler: file_handler.write(env) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e10149721..2dd03fd13 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,14 +8,14 @@ repos: rev: 0.29.2 hooks: - id: check-github-workflows - args: [ "--verbose" ] + args: ["--verbose"] - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: - id: codespell args: ["--write-changes"] - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "1.3.1" + rev: "1.3.2" hooks: - id: tox-ini-fmt args: ["-p", "fix"] @@ -24,11 +24,18 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.3" + rev: "v0.6.4" hooks: - id: ruff-format - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] + - repo: https://github.com/rbubley/mirrors-prettier + rev: "v3.3.3" + hooks: + - id: prettier + additional_dependencies: + - prettier@3.3.3 + - "@prettier/plugin-xml@3.4.1" - repo: meta hooks: - id: check-hooks-apply diff --git a/docs/changelog/2760.bugfix.rst b/docs/changelog/2760.bugfix.rst new file mode 100644 index 000000000..f79849d2c --- /dev/null +++ b/docs/changelog/2760.bugfix.rst @@ -0,0 +1,5 @@ +Upgrade embedded wheels: + +* wheel to ``0.44.0`` from ``0.43.0`` +* pip to ``24.2`` from ``24.1`` +* setuptools to ``74.1.2`` from ``70.1.0`` diff --git a/pyproject.toml b/pyproject.toml index 3fb40c3f8..de0e961fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries", @@ -121,6 +122,7 @@ lint.ignore = [ "D40", # no imperative mode for docstrings "D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible "D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible + "DOC", # no restructuredtext support "INP001", # ignore implicit namespace packages "ISC001", # conflict with formatter "PLR0914", # Too many local variables @@ -133,11 +135,11 @@ lint.ignore = [ ] lint.per-file-ignores."tests/**/*.py" = [ "D", # don't care about documentation in tests - "FBT", # don"t care about booleans as positional arguments in tests + "FBT", # don't care about booleans as positional arguments in tests "INP001", # no implicit namespace "PLC2701", # Private import "PLR2004", # Magic value used in comparison, consider replacing with a constant variable - "S101", # asserts allowed in tests... + "S101", # asserts allowed in tests "S603", # `subprocess` call: check for execution of untrusted input ] lint.isort = { known-first-party = [ @@ -151,6 +153,9 @@ lint.preview = true builtin = "clear,usage,en-GB_to_en-US" count = true +[tool.pyproject-fmt] +max_supported_python = "3.13" + [tool.pytest.ini_options] markers = [ "slow", diff --git a/src/virtualenv/config/cli/parser.py b/src/virtualenv/config/cli/parser.py index 9323d4e81..a1770f2ac 100644 --- a/src/virtualenv/config/cli/parser.py +++ b/src/virtualenv/config/cli/parser.py @@ -1,4 +1,4 @@ -from __future__ import annotations +from __future__ import annotations # noqa: A005 import os from argparse import SUPPRESS, ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace diff --git a/src/virtualenv/create/via_global_ref/venv.py b/src/virtualenv/create/via_global_ref/venv.py index 7220af12d..e1c9f64d0 100644 --- a/src/virtualenv/create/via_global_ref/venv.py +++ b/src/virtualenv/create/via_global_ref/venv.py @@ -1,4 +1,4 @@ -from __future__ import annotations +from __future__ import annotations # noqa: A005 import logging from copy import copy diff --git a/src/virtualenv/seed/embed/via_app_data/pip_install/copy.py b/src/virtualenv/seed/embed/via_app_data/pip_install/copy.py index b5f01aa91..af50e8d12 100644 --- a/src/virtualenv/seed/embed/via_app_data/pip_install/copy.py +++ b/src/virtualenv/seed/embed/via_app_data/pip_install/copy.py @@ -1,4 +1,4 @@ -from __future__ import annotations +from __future__ import annotations # noqa: A005 import os from pathlib import Path diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py index 102ed8e4c..0a3a3b86a 100644 --- a/src/virtualenv/seed/wheels/embed/__init__.py +++ b/src/virtualenv/seed/wheels/embed/__init__.py @@ -12,39 +12,39 @@ "wheel": "wheel-0.42.0-py3-none-any.whl", }, "3.8": { - "pip": "pip-24.1-py3-none-any.whl", - "setuptools": "setuptools-70.1.0-py3-none-any.whl", - "wheel": "wheel-0.43.0-py3-none-any.whl", + "pip": "pip-24.2-py3-none-any.whl", + "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.9": { - "pip": "pip-24.1-py3-none-any.whl", - "setuptools": "setuptools-70.1.0-py3-none-any.whl", - "wheel": "wheel-0.43.0-py3-none-any.whl", + "pip": "pip-24.2-py3-none-any.whl", + "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.10": { - "pip": "pip-24.1-py3-none-any.whl", - "setuptools": "setuptools-70.1.0-py3-none-any.whl", - "wheel": "wheel-0.43.0-py3-none-any.whl", + "pip": "pip-24.2-py3-none-any.whl", + "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.11": { - "pip": "pip-24.1-py3-none-any.whl", - "setuptools": "setuptools-70.1.0-py3-none-any.whl", - "wheel": "wheel-0.43.0-py3-none-any.whl", + "pip": "pip-24.2-py3-none-any.whl", + "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.12": { - "pip": "pip-24.1-py3-none-any.whl", - "setuptools": "setuptools-70.1.0-py3-none-any.whl", - "wheel": "wheel-0.43.0-py3-none-any.whl", + "pip": "pip-24.2-py3-none-any.whl", + "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.13": { - "pip": "pip-24.1-py3-none-any.whl", - "setuptools": "setuptools-70.1.0-py3-none-any.whl", - "wheel": "wheel-0.43.0-py3-none-any.whl", + "pip": "pip-24.2-py3-none-any.whl", + "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.14": { - "pip": "pip-24.1-py3-none-any.whl", - "setuptools": "setuptools-70.1.0-py3-none-any.whl", - "wheel": "wheel-0.43.0-py3-none-any.whl", + "pip": "pip-24.2-py3-none-any.whl", + "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "wheel": "wheel-0.44.0-py3-none-any.whl", }, } MAX = "3.7" diff --git a/src/virtualenv/seed/wheels/embed/pip-24.1-py3-none-any.whl b/src/virtualenv/seed/wheels/embed/pip-24.2-py3-none-any.whl similarity index 75% rename from src/virtualenv/seed/wheels/embed/pip-24.1-py3-none-any.whl rename to src/virtualenv/seed/wheels/embed/pip-24.2-py3-none-any.whl index 206575313..542cdd1e7 100644 Binary files a/src/virtualenv/seed/wheels/embed/pip-24.1-py3-none-any.whl and b/src/virtualenv/seed/wheels/embed/pip-24.2-py3-none-any.whl differ diff --git a/src/virtualenv/seed/wheels/embed/setuptools-70.1.0-py3-none-any.whl b/src/virtualenv/seed/wheels/embed/setuptools-70.1.0-py3-none-any.whl deleted file mode 100644 index db141dbaa..000000000 Binary files a/src/virtualenv/seed/wheels/embed/setuptools-70.1.0-py3-none-any.whl and /dev/null differ diff --git a/src/virtualenv/seed/wheels/embed/setuptools-74.1.2-py3-none-any.whl b/src/virtualenv/seed/wheels/embed/setuptools-74.1.2-py3-none-any.whl new file mode 100644 index 000000000..946da59ac Binary files /dev/null and b/src/virtualenv/seed/wheels/embed/setuptools-74.1.2-py3-none-any.whl differ diff --git a/src/virtualenv/seed/wheels/embed/wheel-0.43.0-py3-none-any.whl b/src/virtualenv/seed/wheels/embed/wheel-0.44.0-py3-none-any.whl similarity index 57% rename from src/virtualenv/seed/wheels/embed/wheel-0.43.0-py3-none-any.whl rename to src/virtualenv/seed/wheels/embed/wheel-0.44.0-py3-none-any.whl index 67e230871..96431aa48 100644 Binary files a/src/virtualenv/seed/wheels/embed/wheel-0.43.0-py3-none-any.whl and b/src/virtualenv/seed/wheels/embed/wheel-0.44.0-py3-none-any.whl differ diff --git a/src/virtualenv/seed/wheels/periodic_update.py b/src/virtualenv/seed/wheels/periodic_update.py index 3ef23ad1c..32ffad680 100644 --- a/src/virtualenv/seed/wheels/periodic_update.py +++ b/src/virtualenv/seed/wheels/periodic_update.py @@ -142,7 +142,7 @@ def __repr__(self) -> str: ) def __eq__(self, other): - return type(self) == type(other) and all( + return type(self) == type(other) and all( # noqa: E721 getattr(self, k) == getattr(other, k) for k in ["filename", "release_date", "found_date", "source"] ) diff --git a/src/virtualenv/util/zipapp.py b/src/virtualenv/util/zipapp.py index 958db1543..80776d010 100644 --- a/src/virtualenv/util/zipapp.py +++ b/src/virtualenv/util/zipapp.py @@ -1,4 +1,4 @@ -from __future__ import annotations +from __future__ import annotations # noqa: A005 import logging import os diff --git a/tests/unit/create/test_creator.py b/tests/unit/create/test_creator.py index 5930078f8..ff8f08577 100644 --- a/tests/unit/create/test_creator.py +++ b/tests/unit/create/test_creator.py @@ -437,6 +437,7 @@ def list_files(path): @pytest.mark.skipif(is_macos_brew(CURRENT), reason="no copy on brew") +@pytest.mark.skip(reason="https://github.com/pypa/setuptools/issues/4640") def test_zip_importer_can_import_setuptools(tmp_path): """We're patching the loaders so might fail on r/o loaders, such as zipimporter on CPython<3.8""" result = cli_run( diff --git a/tests/unit/create/via_global_ref/builtin/pypy/deb_pypy38.json b/tests/unit/create/via_global_ref/builtin/pypy/deb_pypy38.json index 478d79977..0d91a969d 100644 --- a/tests/unit/create/via_global_ref/builtin/pypy/deb_pypy38.json +++ b/tests/unit/create/via_global_ref/builtin/pypy/deb_pypy38.json @@ -21,7 +21,11 @@ "original_executable": "/usr/bin/pypy3", "system_executable": "/usr/bin/pypy3", "has_venv": true, - "path": ["/usr/lib/pypy3.8", "/usr/local/lib/pypy3.8/dist-packages", "/usr/lib/python3/dist-packages"], + "path": [ + "/usr/lib/pypy3.8", + "/usr/local/lib/pypy3.8/dist-packages", + "/usr/lib/python3/dist-packages" + ], "file_system_encoding": "utf-8", "stdout_encoding": "UTF-8", "sysconfig_scheme": null, diff --git a/tests/unit/create/via_global_ref/builtin/pypy/portable_pypy38.json b/tests/unit/create/via_global_ref/builtin/pypy/portable_pypy38.json index 2264fa432..0761455bb 100644 --- a/tests/unit/create/via_global_ref/builtin/pypy/portable_pypy38.json +++ b/tests/unit/create/via_global_ref/builtin/pypy/portable_pypy38.json @@ -21,7 +21,10 @@ "original_executable": "/tmp/pypy3.8-v7.3.8-linux64/bin/pypy", "system_executable": "/tmp/pypy3.8-v7.3.8-linux64/bin/pypy", "has_venv": true, - "path": ["/tmp/pypy3.8-v7.3.8-linux64/lib/pypy3.8", "/tmp/pypy3.8-v7.3.8-linux64/lib/pypy3.8/site-packages"], + "path": [ + "/tmp/pypy3.8-v7.3.8-linux64/lib/pypy3.8", + "/tmp/pypy3.8-v7.3.8-linux64/lib/pypy3.8/site-packages" + ], "file_system_encoding": "utf-8", "stdout_encoding": "UTF-8", "sysconfig_scheme": null, diff --git a/tox.ini b/tox.ini index cf52ae7c7..40c137e26 100644 --- a/tox.ini +++ b/tox.ini @@ -3,17 +3,17 @@ requires = tox>=4.2 env_list = fix - py313 - py312 - py311 - py310 - py39 - py38 - py37 pypy3 coverage readme docs + 3.13 + 3.12 + 3.11 + 3.10 + 3.9 + 3.8 + 3.7 skip_missing_interpreters = true [testenv] @@ -44,7 +44,7 @@ uv_seed = true description = format the code base to adhere to our styles, and complain about what we cannot do automatically skip_install = true deps = - pre-commit>=3.7 + pre-commit-uv>=4.1 commands = pre-commit run --all-files --show-diff-on-failure @@ -52,11 +52,11 @@ commands = description = check that the long description is valid (need for PyPI) skip_install = true deps = - build[virtualenv]>=1.2.1 - twine>=5 + build[uv]>=1.2.2 + twine>=5.1.1 extras = commands = - python -m build -o {envtmpdir} --wheel --sdist . + python -m build -o {envtmpdir} --installer uv --wheel --sdist . twine check {envtmpdir}/* [testenv:docs] @@ -71,7 +71,7 @@ commands = description = upgrade pip/wheels/setuptools to latest skip_install = true deps = - ruff>=0.3.7 + ruff>=0.6.4 pass_env = UPGRADE_ADVISORY change_dir = {toxinidir}/tasks @@ -83,8 +83,8 @@ uv_seed = true description = do a release, required posarg of the version number deps = gitpython>=3.1.43 - packaging>=24 - towncrier>=23.11 + packaging>=24.1 + towncrier>=24.8 change_dir = {toxinidir}/tasks commands = python release.py --version {posargs} @@ -96,15 +96,14 @@ extras = docs test commands = - python -m pip list --format=columns + uv pip tree python -c 'import sys; print(sys.executable)' -uv_seed = true [testenv:zipapp] description = generate a zipapp skip_install = true deps = - packaging>=24 + packaging>=24.1 commands = python tasks/make_zipapp.py uv_seed = true