Skip to content

Commit 11e2418

Browse files
authored
Add support for Python 3.14, fix ast.Str error (#242)
* Add Python 3.14 to build * Replace usage of ast.Str with ast.Constant * Update CHANGELOG
1 parent 122bee3 commit 11e2418

File tree

5 files changed

+30
-15
lines changed

5 files changed

+30
-15
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1515

1616
steps:
1717

CHANGELOG.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ Unreleased_
2525
See also `latest documentation
2626
<https://flake8-aaa.readthedocs.io/en/latest/#__unreleased_marker__>`_.
2727

28+
Added
29+
.....
30+
31+
* 🎈 Explicit support added for Python 3.14. `PR 242
32+
<https://github.com/jamescooke/flake8-aaa/pull/242>`_.
33+
34+
Changed
35+
.......
36+
37+
* ⛏️ Fixes usage of ``ast.Str``, replaced with ``ast.Constant``. This was
38+
deprecated in Python 3.8. `Issue 239
39+
<https://github.com/jamescooke/flake8-aaa/issues/239>`_.
40+
2841
0.17.1_ - 2025/10/24
2942
--------------------
3043

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def readme():
5151
'Programming Language :: Python :: 3.11',
5252
'Programming Language :: Python :: 3.12',
5353
'Programming Language :: Python :: 3.13',
54+
'Programming Language :: Python :: 3.14',
5455
'Programming Language :: Python',
5556
],
5657
zip_safe=False,

src/flake8_aaa/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def node_is_noop(node: ast.AST) -> bool:
115115
"""
116116
Node does nothing.
117117
"""
118-
return isinstance(node.value, ast.Str) if isinstance(node, ast.Expr) else isinstance(node, ast.Pass)
118+
return isinstance(node.value, ast.Constant) if isinstance(node, ast.Expr) else isinstance(node, ast.Pass)
119119

120120

121121
def function_is_noop(function_node: ast.FunctionDef) -> bool:
@@ -155,7 +155,7 @@ def filter_arrange_nodes(nodes: List[ast.stmt], act_block_first_line_number: int
155155
"""
156156
return [
157157
node for node in nodes if node.lineno < act_block_first_line_number and not isinstance(node, ast.Pass)
158-
and not (isinstance(node, ast.Expr) and isinstance(node.value, ast.Str))
158+
and not (isinstance(node, ast.Expr) and isinstance(node.value, ast.Constant))
159159
]
160160

161161

tox.ini

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929

3030
[tox]
3131
envlist =
32-
py3{8,9,10,11,12,13}-lint_{code,examples}
33-
py3{8,9,10,11,12,13}-test_{code,examples}
34-
py3{8,9,10,11,12,13}-meta_plugin_{dogfood,default,option,config,black}
32+
py3{8,9,10,11,12,13,14}-lint_{code,examples}
33+
py3{8,9,10,11,12,13,14}-test_{code,examples}
34+
py3{8,9,10,11,12,13,14}-meta_plugin_{dogfood,default,option,config,black}
3535
py310-docs
3636

3737
[testenv]
@@ -44,7 +44,7 @@ wheel_build_env = .pkg
4444

4545
# --- LINT: code ---
4646
# Regular linting of code: flake8, yapf, mypy, etc.
47-
[testenv:py3{8,9,10,11,12,13}-lint_code]
47+
[testenv:py3{8,9,10,11,12,13,14}-lint_code]
4848
description = ⛏️ Regular linting of code: Flake8, yapf, mypy, etc.
4949
labels =
5050
lint
@@ -59,7 +59,7 @@ allowlist_externals =
5959
# --- LINT: examples ---
6060
# Lint all good and bad examples. Includes linting with vanilla Flake8 and
6161
# assert tests formatted with Black pass.
62-
[testenv:py3{8,9,10,11,12,13}-lint_examples]
62+
[testenv:py3{8,9,10,11,12,13,14}-lint_examples]
6363
description = ⛏️ Lint examples, run stdlib examples on Pytest
6464
labels =
6565
lint
@@ -74,7 +74,7 @@ allowlist_externals =
7474

7575
# --- TEST: code ---
7676
# Run Pytest on all code
77-
[testenv:py3{8,9,10,11,12,13}-test_code]
77+
[testenv:py3{8,9,10,11,12,13,14}-test_code]
7878
description = 🧰 Test all code
7979
labels =
8080
test
@@ -86,7 +86,7 @@ commands =
8686

8787
# --- TEST: Examples ---
8888
# All stdlib examples executed with vanilla Pytest.
89-
[testenv:py3{8,9,10,11,12,13}-test_examples]
89+
[testenv:py3{8,9,10,11,12,13,14}-test_examples]
9090
description = 🧰 Test stdlib examples
9191
labels =
9292
test
@@ -130,7 +130,7 @@ allowlist_externals =
130130
bash
131131
diff
132132

133-
[testenv:py3{8,9,10,11,12,13}-meta_plugin_dogfood]
133+
[testenv:py3{8,9,10,11,12,13,14}-meta_plugin_dogfood]
134134
# No FLAKE8FLAGS set, so default behaviour
135135
description = 🐕 Run -m flake_aaa against its own tests
136136
labels =
@@ -140,7 +140,7 @@ deps = {[base_meta_plugin]deps}
140140
commands =
141141
flake8 tests
142142

143-
[testenv:py3{8,9,10,11,12,13}-meta_plugin_default]
143+
[testenv:py3{8,9,10,11,12,13,14}-meta_plugin_default]
144144
# No FLAKE8FLAGS set, so default behaviour
145145
description = 🎈 Run -m flake_aaa against examples and tests
146146
labels =
@@ -150,7 +150,7 @@ deps = {[base_meta_plugin]deps}
150150
commands = {[base_meta_plugin]commands}
151151
allowlist_externals = {[base_meta_plugin]allowlist_externals}
152152

153-
[testenv:py3{8,9,10,11,12,13}-meta_plugin_option]
153+
[testenv:py3{8,9,10,11,12,13,14}-meta_plugin_option]
154154
# FLAKE8FLAGS set to command line options --aaa-* to their default values,
155155
# ensure that defaults can be specified explicitly
156156
description = 🎈 Run -m flake_aaa against examples and tests (pass default options)
@@ -163,7 +163,7 @@ deps = {[base_meta_plugin]deps}
163163
commands = {[base_meta_plugin]commands}
164164
allowlist_externals = {[base_meta_plugin]allowlist_externals}
165165

166-
[testenv:py3{8,9,10,11,12,13}-meta_plugin_config]
166+
[testenv:py3{8,9,10,11,12,13,14}-meta_plugin_config]
167167
# FLAKE8FLAGS pass command line --config reference to config file with explicit
168168
# defaults set to ensure defaults can be passed through explicitly
169169
description = 🎈 Run -m flake_aaa against examples and tests (pass default config)
@@ -176,7 +176,7 @@ deps = {[base_meta_plugin]deps}
176176
commands = {[base_meta_plugin]commands}
177177
allowlist_externals = {[base_meta_plugin]allowlist_externals}
178178

179-
[testenv:py3{8,9,10,11,12,13}-meta_plugin_black]
179+
[testenv:py3{8,9,10,11,12,13,14}-meta_plugin_black]
180180
# Run Black examples passing Act block style 'large' as command line option and
181181
# passing as config.
182182
description = 🎈 Run -m flake_aaa against Black formatted examples
@@ -234,3 +234,4 @@ python =
234234
3.11: py311
235235
3.12: py312
236236
3.13: py313
237+
3.14: py314

0 commit comments

Comments
 (0)