Skip to content

Commit 81383b2

Browse files
[pre-commit.ci] pre-commit autoupdate (#2625)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 496506d commit 81383b2

File tree

7 files changed

+34
-15
lines changed

7 files changed

+34
-15
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ repos:
1414
- id: tox-ini-fmt
1515
args: ["-p", "fix"]
1616
- repo: https://github.com/tox-dev/pyproject-fmt
17-
rev: "0.13.0"
17+
rev: "0.13.1"
1818
hooks:
1919
- id: pyproject-fmt
20-
additional_dependencies: ["tox>=4.6.4"]
20+
additional_dependencies: ["tox>=4.8"]
2121
- repo: https://github.com/pre-commit/mirrors-prettier
2222
rev: "v3.0.1"
2323
hooks:
2424
- id: prettier
2525
args: ["--print-width=120", "--prose-wrap=always"]
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: "v0.0.282"
27+
rev: "v0.0.284"
2828
hooks:
2929
- id: ruff
3030
args: [--fix, --exit-non-zero-on-fix]

docs/render_cli.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from __future__ import annotations
22

33
from argparse import SUPPRESS
4-
from collections import namedtuple
54
from contextlib import contextmanager
6-
from typing import Any, ClassVar
5+
from typing import Any, ClassVar, NamedTuple
76

87
from docutils import nodes as n
98
from docutils.parsers.rst.directives import unchanged_required
@@ -12,9 +11,17 @@
1211

1312
from virtualenv.run.plugin.base import ComponentBuilder
1413

15-
TableRow = namedtuple("TableRow", ["names", "default", "choices", "help"])
1614

17-
TextAsDefault = namedtuple("TextAsDefault", ["text"])
15+
class TableRow(NamedTuple):
16+
names: list[str]
17+
default: str
18+
choices: set[str]
19+
help: str # noqa: A003
20+
21+
22+
class TextAsDefault(NamedTuple):
23+
text: str
24+
1825

1926
CUSTOM = {
2027
"discovery": ComponentBuilder.entry_points_for("virtualenv.discovery"),

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ dependencies = [
4747
"platformdirs<4,>=3.9.1",
4848
]
4949
optional-dependencies.docs = [
50-
"furo>=2023.5.20",
50+
"furo>=2023.7.26",
5151
"proselint>=0.13",
52-
"sphinx>=7.0.1",
52+
"sphinx>=7.1.2",
5353
"sphinx-argparse>=0.4",
5454
"sphinxcontrib-towncrier>=0.2.1a0",
5555
"towncrier>=23.6",

src/virtualenv/discovery/py_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from collections import OrderedDict, namedtuple
1818
from string import digits
1919

20-
VersionInfo = namedtuple("VersionInfo", ["major", "minor", "micro", "releaselevel", "serial"])
20+
VersionInfo = namedtuple("VersionInfo", ["major", "minor", "micro", "releaselevel", "serial"]) # noqa: PYI024
2121

2222

2323
def _get_path_extensions():

src/virtualenv/discovery/windows/pep514.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def parse_version(version_str):
139139

140140

141141
def msg(path, what):
142-
LOGGER.warning(f"PEP-514 violation in Windows Registry at {path} error: {what}")
142+
LOGGER.warning("PEP-514 violation in Windows Registry at %s error: %s", path, what)
143143

144144

145145
def _run():

src/virtualenv/run/plugin/creators.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
from __future__ import annotations
22

3-
from collections import OrderedDict, defaultdict, namedtuple
3+
from collections import OrderedDict, defaultdict
4+
from typing import TYPE_CHECKING, NamedTuple
45

56
from virtualenv.create.describe import Describe
67
from virtualenv.create.via_global_ref.builtin.builtin_way import VirtualenvBuiltin
78

89
from .base import ComponentBuilder
910

10-
CreatorInfo = namedtuple("CreatorInfo", ["key_to_class", "key_to_meta", "describe", "builtin_key"])
11+
if TYPE_CHECKING:
12+
from virtualenv.create.creator import Creator, CreatorMeta
13+
14+
15+
class CreatorInfo(NamedTuple):
16+
key_to_class: dict[str, type[Creator]]
17+
key_to_meta: dict[str, CreatorMeta]
18+
describe: type[Describe] | None
19+
builtin_key: str
1120

1221

1322
class CreatorSelector(ComponentBuilder):

tests/unit/discovery/py_info/test_py_info.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import os
99
import sys
1010
import sysconfig
11-
from collections import namedtuple
1211
from pathlib import Path
1312
from textwrap import dedent
13+
from typing import NamedTuple
1414

1515
import pytest
1616

@@ -166,7 +166,10 @@ def test_py_info_cached_symlink(mocker, tmp_path, session_app_data):
166166
assert spy.call_count == count + 1 # no longer needed the host invocation, but the new symlink is must
167167

168168

169-
PyInfoMock = namedtuple("PyInfoMock", ["implementation", "architecture", "version_info"])
169+
class PyInfoMock(NamedTuple):
170+
implementation: str
171+
architecture: int
172+
version_info: VersionInfo
170173

171174

172175
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)