Skip to content

Commit 83c7e8f

Browse files
committed
Merge branch 'topic/default/format' into 'branch/default'
Format with black See merge request fluiddyn/transonic!158
2 parents 1f46d11 + 0f17052 commit 83c7e8f

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ lock:
1212
pdm lock -G :all
1313

1414
black:
15-
black -l 82 src _transonic_testing data_tests tests
15+
.venv/bin/black src _transonic_testing data_tests tests
1616

1717
format: black
1818

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ addopts = "--pdbcls=IPython.terminal.debugger:TerminalPdb"
100100

101101
[tool.black]
102102
line-length = 82
103-
target-version = ['py38']
103+
target-version = ['py311']
104104

105105
[tool.isort]
106106
profile = "black"

src/transonic/analyses/capturex.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ def visit_ClassDef(self, node_class):
120120
def visit_AnnAssign(self, node):
121121

122122
try:
123-
keep_local_annotations = self.func._transonic_keywords["keep_local_annotations"]
123+
keep_local_annotations = self.func._transonic_keywords[
124+
"keep_local_annotations"
125+
]
124126
except (AttributeError, KeyError):
125127
keep_local_annotations = False
126128

src/transonic/backends/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@ def __init__(self):
5757

5858
def _make_code_from_fdef_node(self, fdef):
5959
try:
60-
keep_local_annotations = fdef._transonic_keywords["keep_local_annotations"]
60+
keep_local_annotations = fdef._transonic_keywords[
61+
"keep_local_annotations"
62+
]
6163
except (AttributeError, KeyError):
6264
keep_local_annotations = False
63-
transformed = TypeHintRemover(keep_local_annotations=keep_local_annotations).visit(fdef)
65+
transformed = TypeHintRemover(
66+
keep_local_annotations=keep_local_annotations
67+
).visit(fdef)
6468
# convert the AST back to source code
6569
code = extast.unparse(transformed)
6670
return format_str(code)

src/transonic/backends/pythran.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def _make_header_from_fdef_signatures(
5252
return signatures_func
5353

5454
def make_meson_code(self, file_names, subdir):
55-
meson_parts = ["""
55+
meson_parts = [
56+
"""
5657
kwargs_extension_module = {
5758
'cpp_args': cpp_args_pythran,
5859
'dependencies': [pythran_dep, np_dep],
@@ -62,7 +63,8 @@ def make_meson_code(self, file_names, subdir):
6263
if is_variable('py_limited_api')
6364
kwargs_extension_module += {'limited_api': py_limited_api}
6465
endif
65-
"""]
66+
"""
67+
]
6668

6769
stems = [name[:-3] for name in file_names]
6870
for name in stems:

0 commit comments

Comments
 (0)