Skip to content

Commit f95f2d1

Browse files
committed
1 parent 3c9b40d commit f95f2d1

File tree

6 files changed

+11
-25
lines changed

6 files changed

+11
-25
lines changed

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ on:
88

99
jobs:
1010
main:
11-
uses: asottile/workflows/.github/workflows/tox.yml@v1.6.0
11+
uses: asottile/workflows/.github/workflows/tox.yml@v1.7.0
1212
with:
13-
env: '["py38", "py39", "py310", "py311", "py312"]'
13+
env: '["py39", "py310", "py311", "py312", "py313"]'

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
rev: v3.13.0
1818
hooks:
1919
- id: reorder-python-imports
20-
args: [--py38-plus, --add-import, 'from __future__ import annotations']
20+
args: [--py39-plus, --add-import, 'from __future__ import annotations']
2121
- repo: https://github.com/asottile/add-trailing-comma
2222
rev: v3.1.0
2323
hooks:
@@ -26,7 +26,7 @@ repos:
2626
rev: v3.17.0
2727
hooks:
2828
- id: pyupgrade
29-
args: [--py38-plus]
29+
args: [--py39-plus]
3030
- repo: https://github.com/hhatto/autopep8
3131
rev: v2.3.1
3232
hooks:

astpretty.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import argparse
44
import ast
55
import contextlib
6+
from collections.abc import Generator
7+
from collections.abc import Sequence
68
from typing import Any
7-
from typing import Generator
8-
from typing import Sequence
99

1010
AST: tuple[type[Any], ...] = (ast.AST,)
1111
expr_context: tuple[type[Any], ...] = (ast.expr_context,)

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ classifiers =
1818

1919
[options]
2020
py_modules = astpretty
21-
python_requires = >=3.8
21+
python_requires = >=3.9
2222

2323
[options.entry_points]
2424
console_scripts =

tests/astpretty_test.py

+3-17
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def test_pformat_integer_indent():
136136

137137

138138
def test_pformat_nested_node_without_line_information():
139-
expected_39 = (
139+
expected = (
140140
'Subscript(\n'
141141
' lineno=1,\n'
142142
' col_offset=0,\n'
@@ -147,20 +147,6 @@ def test_pformat_nested_node_without_line_information():
147147
' ctx=Load(),\n'
148148
')'
149149
)
150-
expected_38 = (
151-
'Subscript(\n'
152-
' lineno=1,\n'
153-
' col_offset=0,\n'
154-
' end_lineno=1,\n'
155-
' end_col_offset=4,\n'
156-
" value=Name(lineno=1, col_offset=0, end_lineno=1, end_col_offset=1, id='a', ctx=Load()),\n" # noqa: E501
157-
' slice=Index(\n'
158-
' value=Constant(lineno=1, col_offset=2, end_lineno=1, end_col_offset=3, value=0, kind=None),\n' # noqa: E501
159-
' ),\n'
160-
' ctx=Load(),\n'
161-
')'
162-
)
163-
expected = expected_39 if sys.version_info >= (3, 9) else expected_38
164150
ret = astpretty.pformat(_to_expr_value('a[0]'))
165151
assert ret == expected
166152

@@ -302,7 +288,7 @@ def f(
302288

303289

304290
def test_pformat_py38_type_comments(tmpdir, capsys):
305-
expected_38 = '''\
291+
expected_311 = '''\
306292
Module(
307293
body=[
308294
FunctionDef(
@@ -341,7 +327,7 @@ def test_pformat_py38_type_comments(tmpdir, capsys):
341327
type_ignores=[TypeIgnore(lineno=2, tag='')],
342328
)
343329
''' # noqa: E501
344-
expected = expected_312 if sys.version_info >= (3, 12) else expected_38
330+
expected = expected_312 if sys.version_info >= (3, 12) else expected_311
345331
mod = (
346332
'def f(): # type: () -> None\n'
347333
' pass # type: ignore\n'

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py38,pypy3,pre-commit
2+
envlist = py3,pypy3,pre-commit
33

44
[testenv]
55
deps = -rrequirements-dev.txt

0 commit comments

Comments
 (0)