Skip to content

Commit e0116e8

Browse files
authored
Merge pull request #1277 from projectsyn/renovate/black-26.x
Update dependency black to v26
2 parents 8e3e558 + 6b3da69 commit e0116e8

18 files changed

+80
-150
lines changed

commodore/component/compile.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,15 +267,11 @@ def _prepare_kapitan_inventory(
267267
# We plug "fake" Argo CD library here because every component relies on it
268268
# and we don't want to provide it every time when compiling a single component.
269269
with open(inv.lib_dir / "argocd.libjsonnet", "w", encoding="utf-8") as argocd_libf:
270-
argocd_libf.write(
271-
dedent(
272-
"""
270+
argocd_libf.write(dedent("""
273271
local ArgoApp(component, namespace, project='', secrets=true, base=null) = {};
274272
local ArgoProject(name) = {};
275273
276274
{
277275
App: ArgoApp,
278276
Project: ArgoProject,
279-
}"""
280-
)
281-
)
277+
}"""))

commodore/package/compile.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,11 @@ def _setup_inventory(
188188
# We plug "fake" Argo CD library here because every component relies on it
189189
# and we don't want to provide it every time when compiling a single component.
190190
with open(inv.lib_dir / "argocd.libjsonnet", "w", encoding="utf-8") as argocd_libf:
191-
argocd_libf.write(
192-
dedent(
193-
"""
191+
argocd_libf.write(dedent("""
194192
local ArgoApp(component, namespace, project='', secrets=true) = {};
195193
local ArgoProject(name) = {};
196194
197195
{
198196
App: ArgoApp,
199197
Project: ArgoProject,
200-
}"""
201-
)
202-
)
198+
}"""))

poetry.lock

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pytest = "9.0.2"
5151
pytest-xdist = "3.8.0"
5252
pytest-benchmark = "5.2.3"
5353
responses = "0.25.8"
54-
black = "25.12.0"
54+
black = "26.1.0"
5555
pyfakefs = "6.0.0"
5656
pytest-cov = "7.0.0"
5757
pylint = "4.0.4"

tests/test_catalog.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -444,18 +444,14 @@ def test_kapitan_029_030_difffunc_suppresses_noise():
444444

445445

446446
def test_ignore_yaml_formatting_difffunc_keep_semantic_whitespace():
447-
before_text = textwrap.dedent(
448-
"""
447+
before_text = textwrap.dedent("""
449448
a:
450449
b: b
451-
"""
452-
)
453-
after_text = textwrap.dedent(
454-
"""
450+
""")
451+
after_text = textwrap.dedent("""
455452
a:
456453
b: b
457-
"""
458-
)
454+
""")
459455

460456
diffs, suppressed = catalog._ignore_yaml_formatting_difffunc(
461457
before_text, after_text, fromfile="test", tofile="test"
@@ -477,22 +473,18 @@ def test_ignore_yaml_formatting_difffunc_keep_semantic_whitespace():
477473

478474

479475
def test_ignore_yaml_formatting_difffunc_suppresses_noise():
480-
before_text = textwrap.dedent(
481-
"""
476+
before_text = textwrap.dedent("""
482477
a:
483478
- a
484479
- b
485480
b: b
486-
"""
487-
)
488-
after_text = textwrap.dedent(
489-
"""
481+
""")
482+
after_text = textwrap.dedent("""
490483
a:
491484
- a
492485
- b
493486
b: b
494-
"""
495-
)
487+
""")
496488

497489
diffs, suppressed = catalog._ignore_yaml_formatting_difffunc(
498490
before_text, after_text, fromfile="test", tofile="test"

tests/test_commodore_libjsonnet.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import pytest
1313
import yaml
1414

15-
1615
TESTS_DIR = Path(__file__).parent / "jsonnet"
1716

1817

tests/test_component.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,7 @@ def _setup_render_jsonnetfile_json(tmp_path: P) -> Component:
271271
ur = cr.clone(upath)
272272
jsonnetfile = upath / "jsonnetfile.jsonnet"
273273
with open(jsonnetfile, "w") as jf:
274-
jf.write(
275-
dedent(
276-
"""
274+
jf.write(dedent("""
277275
{
278276
version: 1,
279277
dependencies: [
@@ -288,9 +286,7 @@ def _setup_render_jsonnetfile_json(tmp_path: P) -> Component:
288286
},
289287
],
290288
legacyImports: true,
291-
}"""
292-
)
293-
)
289+
}"""))
294290
ur.index.add("*")
295291
ur.index.commit("initial commit")
296292
ur.remote().push()

tests/test_component_compile.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ def _prepare_component(
4242
shutil.move(str(component_root / ".git"), str(tmp_path / component_name))
4343

4444
with open(component_root / "component/main.jsonnet", "a") as file:
45-
file.write(
46-
dedent(
47-
"""
45+
file.write(dedent("""
4846
{
4947
"test_service_account": kube.ServiceAccount('test') {
5048
metadata+: {
@@ -60,9 +58,7 @@ def _prepare_component(
6058
},
6159
},
6260
},
63-
}"""
64-
)
65-
)
61+
}"""))
6662
return component_root
6763

6864

@@ -343,8 +339,7 @@ def test_component_compile_kustomize(tmp_path: P, cli_runner: RunnerFunc):
343339
with open(
344340
component_path / "component" / "kustomization.jsonnet", "w", encoding="utf-8"
345341
) as f:
346-
f.write(
347-
"""
342+
f.write("""
348343
local com = import 'lib/commodore.libjsonnet';
349344
350345
com.Kustomization(
@@ -359,8 +354,7 @@ def test_component_compile_kustomize(tmp_path: P, cli_runner: RunnerFunc):
359354
{
360355
namespace: 'foo',
361356
}
362-
)"""
363-
)
357+
)""")
364358
with open(
365359
component_path / "class" / f"{component_name}.yml", "r", encoding="utf-8"
366360
) as cyaml:

tests/test_component_template.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,14 +1729,12 @@ def test_component_update_raises_on_merge_conflict(
17291729
with open(
17301730
component_path / "lib" / "test-component.libsonnet", "w", encoding="utf-8"
17311731
) as f:
1732-
f.write(
1733-
"""// Test contents
1732+
f.write("""// Test contents
17341733
17351734
{
17361735
Foo: {bar: 1, baz: false},
17371736
}
1738-
"""
1739-
)
1737+
""")
17401738

17411739
r = Repo(component_path)
17421740
r.index.add([".cruft.json", "lib/test-component.libsonnet"])

tests/test_config.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,16 +327,11 @@ def test_print_deprecation_notices(config, capsys):
327327

328328
config.print_deprecation_notices()
329329
captured = capsys.readouterr()
330-
assert (
331-
textwrap.dedent(
332-
"""
330+
assert textwrap.dedent("""
333331
Commodore notices:
334332
> test 1
335333
> test 2
336-
"""
337-
)
338-
== captured.out
339-
)
334+
""") == captured.out
340335

341336

342337
def mock_get_token(url: str) -> Optional[str]:

0 commit comments

Comments
 (0)