From 6d4d45e62c206028177cad766b10ad2e85674ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Wed, 19 Apr 2023 12:57:33 -0700 Subject: [PATCH] Bump deps and tools (#2545) --- .pre-commit-config.yaml | 14 +++---- pyproject.toml | 12 +++--- src/virtualenv/discovery/cached_py_info.py | 2 +- src/virtualenv/discovery/py_info.py | 6 +-- tox.ini | 46 +++++++++++----------- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 85597a710..84a704887 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.3.0 hooks: - id: black args: [--safe] @@ -40,13 +40,13 @@ repos: rev: 1.13.0 hooks: - id: blacken-docs - additional_dependencies: [black==23.1] + additional_dependencies: [black==23.3] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: - id: rst-backticks - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "0.6.1" + rev: "1.3.0" hooks: - id: tox-ini-fmt args: ["-p", "fix"] @@ -55,14 +55,14 @@ repos: hooks: - id: flake8 additional_dependencies: - - flake8-bugbear==23.2.13 - - flake8-comprehensions==3.10.1 + - flake8-bugbear==23.3.23 + - flake8-comprehensions==3.12 - flake8-pytest-style==1.7.2 - flake8-spellcheck==0.28 - flake8-unused-arguments==0.0.13 - - flake8-noqa==1.3 + - flake8-noqa==1.3.1 - pep8-naming==0.13.3 - - flake8-pyproject==1.2.2 + - flake8-pyproject==1.2.3 - repo: https://github.com/pre-commit/mirrors-prettier rev: "v2.7.1" hooks: diff --git a/pyproject.toml b/pyproject.toml index 6d5b0ab2c..8833f6c04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ build-backend = "hatchling.build" requires = [ "hatch-vcs>=0.3", - "hatchling>=1.12.2", + "hatchling>=1.14", ] [project] @@ -42,7 +42,7 @@ dependencies = [ "platformdirs<4,>=2.4", ] optional-dependencies.docs = [ - "furo>=2022.12.7", + "furo>=2023.3.27", "proselint>=0.13", "sphinx>=6.1.3", "sphinx-argparse>=0.4", @@ -50,12 +50,12 @@ optional-dependencies.docs = [ "towncrier>=22.12", ] optional-dependencies.test = [ - "covdefaults>=2.2.2", - "coverage>=7.1", + "covdefaults>=2.3", + "coverage>=7.2.3", "coverage-enable-subprocess>=1", "flaky>=3.7", - "packaging>=23", - "pytest>=7.2.1", + "packaging>=23.1", + "pytest>=7.3.1", "pytest-env>=0.8.1", "pytest-freezegun>=0.4.2", "pytest-mock>=3.10", diff --git a/src/virtualenv/discovery/cached_py_info.py b/src/virtualenv/discovery/cached_py_info.py index a1a5aecdd..3edaca9eb 100644 --- a/src/virtualenv/discovery/cached_py_info.py +++ b/src/virtualenv/discovery/cached_py_info.py @@ -64,7 +64,7 @@ def _get_via_file_cache(cls, app_data, path, exe, env): data = py_info_store.read() of_path, of_st_mtime, of_content = data["path"], data["st_mtime"], data["content"] if of_path == path_text and of_st_mtime == path_modified: - py_info = cls._from_dict({k: v for k, v in of_content.items()}) + py_info = cls._from_dict(of_content.copy()) sys_exe = py_info.system_executable if sys_exe is not None and not os.path.exists(sys_exe): py_info_store.remove() diff --git a/src/virtualenv/discovery/py_info.py b/src/virtualenv/discovery/py_info.py index 2a39e506d..ffff7aa93 100644 --- a/src/virtualenv/discovery/py_info.py +++ b/src/virtualenv/discovery/py_info.py @@ -222,7 +222,7 @@ def sysconfig_path(self, key, config_var=None, sep=os.sep): if config_var is None: config_var = self.sysconfig_vars else: - base = {k: v for k, v in self.sysconfig_vars.items()} + base = self.sysconfig_vars.copy() base.update(config_var) config_var = base return pattern.format(**config_var).replace("/", sep) @@ -395,13 +395,13 @@ def from_exe(cls, exe, app_data=None, raise_on_error=True, ignore_cache=False, r def _from_json(cls, payload): # the dictionary unroll here is to protect against pypy bug of interpreter crashing raw = json.loads(payload) - return cls._from_dict({k: v for k, v in raw.items()}) + return cls._from_dict(raw.copy()) @classmethod def _from_dict(cls, data): data["version_info"] = VersionInfo(**data["version_info"]) # restore this to a named tuple structure result = cls() - result.__dict__ = {k: v for k, v in data.items()} + result.__dict__ = data.copy() return result @classmethod diff --git a/tox.ini b/tox.ini index 474b3e40b..6a9fb2736 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,7 @@ [tox] -envlist = +requires = + tox>=4.2 +env_list = fix py311 py310 @@ -10,38 +12,36 @@ envlist = coverage readme docs -isolated_build = true skip_missing_interpreters = true -requires = tox>=4 [testenv] description = run tests with {basepython} +package = wheel +wheel_build_env = .pkg extras = test -commands = - coverage erase - coverage run -m pytest {posargs:--junitxml {toxworkdir}/junit.{envname}.xml tests --int} - coverage combine - coverage report --skip-covered --show-missing - coverage xml -o {toxworkdir}/coverage.{envname}.xml - coverage html -d {envtmpdir}/htmlcov --show-contexts --title virtualenv-{envname}-coverage -package = wheel pass_env = CI_RUN PYTEST_* TERM set_env = - _COVERAGE_SRC = {envsitepackagesdir}/virtualenv COVERAGE_FILE = {toxworkdir}/.coverage.{envname} COVERAGE_PROCESS_START = {toxinidir}/pyproject.toml PYTHONWARNDEFAULTENCODING = 1 -wheel_build_env = .pkg + _COVERAGE_SRC = {envsitepackagesdir}/virtualenv +commands = + coverage erase + coverage run -m pytest {posargs:--junitxml {toxworkdir}/junit.{envname}.xml tests --int} + coverage combine + coverage report --skip-covered --show-missing + coverage xml -o {toxworkdir}/coverage.{envname}.xml + coverage html -d {envtmpdir}/htmlcov --show-contexts --title virtualenv-{envname}-coverage [testenv:fix] 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.0.4 + pre-commit>=3.2.2 commands = pre-commit run --all-files --show-diff-on-failure @@ -68,37 +68,37 @@ commands = description = upgrade pip/wheels/setuptools to latest skip_install = true deps = - black>=23.1 -commands = - python upgrade_wheels.py -change_dir = {toxinidir}/tasks + black>=23.3 pass_env = UPGRADE_ADVISORY +change_dir = {toxinidir}/tasks +commands = + python upgrade_wheels.py [testenv:release] description = do a release, required posarg of the version number deps = - gitpython>=3.1.30 - packaging>=23 + gitpython>=3.1.31 + packaging>=23.1 towncrier>=22.12 +change_dir = {toxinidir}/tasks commands = python release.py --version {posargs} -change_dir = {toxinidir}/tasks [testenv:dev] description = generate a DEV environment +package = editable extras = docs test commands = python -m pip list --format=columns python -c 'import sys; print(sys.executable)' -package = editable [testenv:zipapp] description = generate a zipapp skip_install = true deps = - packaging>=23 + packaging>=23.1 commands = python tasks/make_zipapp.py