Merge pull request #3771 from pre-commit/all-repos_autofix_py311-plus · pre-commit/pre-commit@59cb792 · GitHub
Skip to content

Commit 59cb792

Browse files
authored
Merge pull request #3771 from pre-commit/all-repos_autofix_py311-plus
py311+
2 parents c429238 + 2be1701 commit 59cb792

10 files changed

Lines changed: 54 additions & 42 deletions

File tree

‎.github/actions/pre-test/action.yml‎

Lines changed: 1 addition & 1 deletion

‎.github/workflows/languages.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fetch-depth: 0
2222
- uses: actions/setup-python@v4
2323
with:
24-
python-version: '3.10'
24+
python-version: '3.11'
2525
- name: install deps
2626
run: python -mpip install -e . -r requirements-dev.txt
2727
- name: vars
@@ -39,7 +39,7 @@ jobs:
3939
- uses: asottile/workflows/.github/actions/fast-checkout@v1.8.1
4040
- uses: actions/setup-python@v4
4141
with:
42-
python-version: '3.10'
42+
python-version: '3.11'
4343

4444
- run: echo "$CONDA\Scripts" >> "$GITHUB_PATH"
4545
shell: bash

‎.github/workflows/main.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ concurrency:
1212

1313
jobs:
1414
main-windows:
15-
uses: asottile/workflows/.github/workflows/tox.yml@v1.8.1
15+
uses: asottile/workflows/.github/workflows/tox.yml@v1.11.1
1616
with:
17-
env: '["py310"]'
17+
env: '["py311"]'
1818
os: windows-latest
1919
main-linux:
20-
uses: asottile/workflows/.github/workflows/tox.yml@v1.8.1
20+
uses: asottile/workflows/.github/workflows/tox.yml@v1.11.1
2121
with:
22-
env: '["py310", "py311", "py312", "py313"]'
22+
env: '["py311", "py312", "py313", "py314"]'
2323
os: ubuntu-latest

‎.pre-commit-config.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
hooks:
1919
- id: reorder-python-imports
2020
exclude: ^pre_commit/resources/
21-
args: [--py310-plus, --add-import, 'from __future__ import annotations']
21+
args: [--py311-plus, --add-import, 'from __future__ import annotations']
2222
- repo: https://github.com/asottile/add-trailing-comma
2323
rev: v4.0.0
2424
hooks:
@@ -27,7 +27,7 @@ repos:
2727
rev: v3.21.2
2828
hooks:
2929
- id: pyupgrade
30-
args: [--py310-plus]
30+
args: [--py311-plus]
3131
- repo: https://github.com/hhatto/autopep8
3232
rev: v2.3.2
3333
hooks:

‎setup.cfg‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ install_requires =
2323
nodeenv>=0.11.1
2424
pyyaml>=5.1
2525
virtualenv>=20.10.0
26-
python_requires = >=3.10
26+
python_requires = >=3.11
2727

2828
[options.packages.find]
2929
exclude =

‎testing/zipapp/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:jammy
1+
FROM ubuntu:noble
22
RUN : \
33
&& apt-get update \
44
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \

‎testing/zipapp/make‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _add_shim(dest: str) -> None:
4444
with tempfile.TemporaryDirectory() as tmpdir:
4545
_exit_if_retv(
4646
'podman', 'run', '--rm', '--volume', f'{tmpdir}:/out:rw', IMG,
47-
'cp', '/venv/lib/python3.10/site-packages/distlib/t32.exe', '/out',
47+
'cp', '/venv/lib/python3.12/site-packages/distlib/t32.exe', '/out',
4848
)
4949

5050
with open(os.path.join(dest, 'python.exe'), 'wb') as f:

‎tests/color_test.py‎

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,30 @@ def test_use_color_no_tty():
3636

3737

3838
def test_use_color_tty_with_color_support():
39-
with mock.patch.object(sys.stderr, 'isatty', return_value=True):
40-
with mock.patch('pre_commit.color.terminal_supports_color', True):
41-
with envcontext.envcontext((('TERM', envcontext.UNSET),)):
42-
assert use_color('auto') is True
39+
with (
40+
mock.patch.object(sys.stderr, 'isatty', return_value=True),
41+
mock.patch('pre_commit.color.terminal_supports_color', True),
42+
envcontext.envcontext((('TERM', envcontext.UNSET),)),
43+
):
44+
assert use_color('auto') is True
4345

4446

4547
def test_use_color_tty_without_color_support():
46-
with mock.patch.object(sys.stderr, 'isatty', return_value=True):
47-
with mock.patch('pre_commit.color.terminal_supports_color', False):
48-
with envcontext.envcontext((('TERM', envcontext.UNSET),)):
49-
assert use_color('auto') is False
48+
with (
49+
mock.patch.object(sys.stderr, 'isatty', return_value=True),
50+
mock.patch('pre_commit.color.terminal_supports_color', False),
51+
envcontext.envcontext((('TERM', envcontext.UNSET),)),
52+
):
53+
assert use_color('auto') is False
5054

5155

5256
def test_use_color_dumb_term():
53-
with mock.patch.object(sys.stderr, 'isatty', return_value=True):
54-
with mock.patch('pre_commit.color.terminal_supports_color', True):
55-
with envcontext.envcontext((('TERM', 'dumb'),)):
56-
assert use_color('auto') is False
57+
with (
58+
mock.patch.object(sys.stderr, 'isatty', return_value=True),
59+
mock.patch('pre_commit.color.terminal_supports_color', True),
60+
envcontext.envcontext((('TERM', 'dumb'),)),
61+
):
62+
assert use_color('auto') is False
5763

5864

5965
def test_use_color_raises_if_given_shenanigans():

‎tests/commands/run_test.py‎

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,20 +1123,24 @@ def test_classifier_removes_dne():
11231123

11241124

11251125
def test_classifier_normalizes_filenames_on_windows_to_forward_slashes(tmpdir):
1126-
with tmpdir.as_cwd():
1127-
tmpdir.join('a/b/c').ensure()
1128-
with mock.patch.object(os, 'altsep', '/'):
1129-
with mock.patch.object(os, 'sep', '\\'):
1130-
classifier = Classifier.from_config((r'a\b\c',), '', '^$')
1131-
assert classifier.filenames == ['a/b/c']
1126+
tmpdir.join('a/b/c').ensure()
1127+
with (
1128+
tmpdir.as_cwd(),
1129+
mock.patch.object(os, 'altsep', '/'),
1130+
mock.patch.object(os, 'sep', '\\'),
1131+
):
1132+
classifier = Classifier.from_config((r'a\b\c',), '', '^$')
1133+
assert classifier.filenames == ['a/b/c']
11321134

11331135

11341136
def test_classifier_does_not_normalize_backslashes_non_windows(tmpdir):
1135-
with mock.patch.object(os.path, 'lexists', return_value=True):
1136-
with mock.patch.object(os, 'altsep', None):
1137-
with mock.patch.object(os, 'sep', '/'):
1138-
classifier = Classifier.from_config((r'a/b\c',), '', '^$')
1139-
assert classifier.filenames == [r'a/b\c']
1137+
with (
1138+
mock.patch.object(os.path, 'lexists', return_value=True),
1139+
mock.patch.object(os, 'altsep', None),
1140+
mock.patch.object(os, 'sep', '/'),
1141+
):
1142+
classifier = Classifier.from_config((r'a/b\c',), '', '^$')
1143+
assert classifier.filenames == [r'a/b\c']
11401144

11411145

11421146
def test_classifier_empty_types_or(tmpdir):

‎tests/repository_test.py‎

Lines changed: 9 additions & 7 deletions

0 commit comments

Comments
 (0)