Skip to content

Commit d68dbb0

Browse files
authored
Merge pull request #7533 from nilsvu/upgrade_black
Upgrade black Python formatting
2 parents 206bd74 + 3e14588 commit d68dbb0

44 files changed

Lines changed: 117 additions & 309 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.skills/scripts/FetchPrComments.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,8 @@ def fetch_review_threads(pr_number, repo=None):
9292

9393
if threads_data.get("pageInfo", {}).get("hasNextPage"):
9494
print(
95-
(
96-
"WARNING: PR has more than 100 review threads. "
97-
"Only the first 100 are shown."
98-
),
95+
"WARNING: PR has more than 100 review threads. "
96+
"Only the first 100 are shown.",
9997
file=sys.stderr,
10098
)
10199

pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ build-backend = "setuptools.build_meta"
77

88
[tool.black]
99
line-length = 80
10-
target-version = ["py37", "py38", "py39", "py310", "py311"]
11-
required-version = "23.3.0"
10+
target-version = ["py310", "py311", "py312", "py313", "py314"]
11+
required-version = "26.5.1"
1212
# Enable experimental string processing so long strings are wrapped
13-
# automatically. This is very convenient but not quite stable yet. Stability of
14-
# this feature is tracked in this issue:
13+
# automatically. This is very convenient but not quite stable yet, so black
14+
# keeps it in its "unstable" tier that has to be enabled explicitly on top of
15+
# the "preview" style. Stability of this feature is tracked in this issue:
1516
# https://github.com/psf/black/issues/2188
1617
preview = true
18+
enable-unstable-feature = ["string_processing"]
1719
# Skip external code since modifying it can be an issue with GPL-licensed code.
1820
extend-exclude = '''
1921
(

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ license = MIT
1212
[options]
1313
packages = find:
1414
install_requires = @SPECTRE_PY_DEPS_OUTPUT@
15-
python_requires = >=3.8
15+
python_requires = >=3.10
1616

1717
[options.extras_require]
1818
dev = @SPECTRE_PY_DEV_DEPS_OUTPUT@

src/IO/H5/Python/CombineH5.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ def combine_h5_vol_command(
106106
if not subfile_name:
107107
spectre_file = spectre_h5.H5File(h5files[0], "r")
108108
raise RequiredChoiceError(
109-
(
110-
"Specify '--subfile-name' / '-d' to select a"
111-
" subfile containing volume data."
112-
),
109+
"Specify '--subfile-name' / '-d' to select a"
110+
" subfile containing volume data.",
113111
choices=spectre_file.all_vol_files(),
114112
)
115113

src/IO/H5/Python/IterElements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def det_jacobian(self):
113113

114114

115115
def stripped_element_name(
116-
element_id: Union[str, ElementId[1], ElementId[2], ElementId[3]]
116+
element_id: Union[str, ElementId[1], ElementId[2], ElementId[3]],
117117
) -> bool:
118118
"""The element name without the leading and trailing square bracket
119119

src/IO/H5/Python/OpenVolfiles.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,8 @@ def command(
192192
)
193193
else:
194194
raise RequiredChoiceError(
195-
(
196-
"Specify '--subfile-name' / '-d' to select a"
197-
" subfile containing volume data."
198-
),
195+
"Specify '--subfile-name' / '-d' to select a"
196+
" subfile containing volume data.",
199197
choices=available_subfiles,
200198
)
201199

src/IO/H5/Python/TransformVolumeData.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,10 +915,8 @@ def shift_magnitude(
915915
)
916916
else:
917917
raise RequiredChoiceError(
918-
(
919-
"Specify '--subfile-name' / '-d' to select a"
920-
" subfile containing volume data."
921-
),
918+
"Specify '--subfile-name' / '-d' to select a"
919+
" subfile containing volume data.",
922920
choices=available_subfile_names,
923921
)
924922

src/Visualization/Python/GenerateTetrahedralConnectivity.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,8 @@ def generate_tetrahedral_connectivity(
8888
)
8989
else:
9090
raise RequiredChoiceError(
91-
(
92-
"Specify '--subfile-name' / '-d' to select a"
93-
" subfile containing volume data."
94-
),
91+
"Specify '--subfile-name' / '-d' to select a"
92+
" subfile containing volume data.",
9593
choices=subfiles,
9694
)
9795

src/Visualization/Python/GenerateXdmf.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,10 +560,8 @@ def generate_xdmf(
560560
)
561561
else:
562562
raise RequiredChoiceError(
563-
(
564-
"Specify '--subfile-name' / '-d' to select a"
565-
" subfile containing volume data."
566-
),
563+
"Specify '--subfile-name' / '-d' to select a"
564+
" subfile containing volume data.",
567565
choices=subfiles,
568566
)
569567

src/Visualization/Python/PlotCce.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,8 @@ def plot_cce(
128128
cce_subfile = h5file.get(cce_subfile_name)
129129
if cce_subfile is None:
130130
raise RequiredChoiceError(
131-
(
132-
f"Could not find Cce subfile {cce_subfile} in H5 file"
133-
f" {h5_filename}."
134-
),
131+
f"Could not find Cce subfile {cce_subfile} in H5 file"
132+
f" {h5_filename}.",
135133
choices=cce_subfiles,
136134
)
137135

0 commit comments

Comments
 (0)