Skip to content

Commit 3cad429

Browse files
[pre-commit.ci] pre-commit autoupdate (python-poetry#8922)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ed1dcdd commit 3cad429

File tree

12 files changed

+52
-34
lines changed

12 files changed

+52
-34
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
- id: check-docstring-first
2222

2323
- repo: https://github.com/psf/black-pre-commit-mirror
24-
rev: 23.12.1
24+
rev: 24.1.1
2525
hooks:
2626
- id: black
2727
exclude: tests/([^/]*/)*fixtures/

src/poetry/console/commands/about.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def handle(self) -> int:
2121
# that.
2222
version: Callable[[str], str] = metadata.version
2323

24-
self.line(f"""\
24+
self.line(
25+
f"""\
2526
<info>Poetry - Package Management for Python
2627
2728
Version: {version('poetry')}
@@ -30,6 +31,7 @@ def handle(self) -> int:
3031
<comment>Poetry is a dependency manager tracking local dependencies of your projects\
3132
and libraries.
3233
See <fg=blue>https://github.com/python-poetry/poetry</> for more information.</comment>\
33-
""")
34+
"""
35+
)
3436

3537
return 0

tests/console/commands/self/test_add_plugins.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ def test_add_existing_plugin_warns_about_no_operation(
195195
) -> None:
196196
pyproject = SelfCommand.get_default_system_pyproject_file()
197197
with open(pyproject, "w", encoding="utf-8", newline="") as f:
198-
f.write(f"""\
198+
f.write(
199+
f"""\
199200
[tool.poetry]
200201
name = "poetry-instance"
201202
version = "1.2.0"
@@ -207,7 +208,8 @@ def test_add_existing_plugin_warns_about_no_operation(
207208
208209
[tool.poetry.group.{SelfCommand.ADDITIONAL_PACKAGE_GROUP}.dependencies]
209210
poetry-plugin = "^1.2.3"
210-
""")
211+
"""
212+
)
211213

212214
installed.add_package(Package("poetry-plugin", "1.2.3"))
213215

@@ -235,7 +237,8 @@ def test_add_existing_plugin_updates_if_requested(
235237
) -> None:
236238
pyproject = SelfCommand.get_default_system_pyproject_file()
237239
with open(pyproject, "w", encoding="utf-8", newline="") as f:
238-
f.write(f"""\
240+
f.write(
241+
f"""\
239242
[tool.poetry]
240243
name = "poetry-instance"
241244
version = "1.2.0"
@@ -247,7 +250,8 @@ def test_add_existing_plugin_updates_if_requested(
247250
248251
[tool.poetry.group.{SelfCommand.ADDITIONAL_PACKAGE_GROUP}.dependencies]
249252
poetry-plugin = "^1.2.3"
250-
""")
253+
"""
254+
)
251255

252256
installed.add_package(Package("poetry-plugin", "1.2.3"))
253257

tests/console/commands/test_config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ def test_set_malformed_repositories_setting(
264264
tester.execute("repositories.foo bar baz")
265265

266266
assert (
267-
str(e.value)
268-
== "You must pass the url. Example: poetry config repositories.foo"
267+
str(e.value) == "You must pass the url. Example: poetry config repositories.foo"
269268
" https://bar.com"
270269
)
271270

tests/console/commands/test_init.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,9 @@ def test_init_existing_pyproject_consistent_linesep(
901901
existing_section = """
902902
[tool.black]
903903
line-length = 88
904-
""".replace("\n", linesep)
904+
""".replace(
905+
"\n", linesep
906+
)
905907
with open(pyproject_file, "w", newline="") as f:
906908
f.write(existing_section)
907909
tester.execute(inputs=init_basic_inputs)

tests/console/commands/test_install.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ def test_remove_untracked_outputs_deprecation_warning(
348348
assert tester.status_code == 0
349349
assert (
350350
"The `--remove-untracked` option is deprecated, use the `--sync` option"
351-
" instead.\n"
352-
in tester.io.fetch_error()
351+
" instead.\n" in tester.io.fetch_error()
353352
)
354353

355354

tests/console/commands/test_remove.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ def test_remove_without_specific_group_removes_from_all_groups(
6565

6666
pyproject: dict[str, Any] = app.poetry.file.read()
6767

68-
groups_content: dict[str, Any] = tomlkit.parse("""\
68+
groups_content: dict[str, Any] = tomlkit.parse(
69+
"""\
6970
[tool.poetry.group.bar.dependencies]
7071
foo = "^2.0.0"
7172
baz = "^1.0.0"
7273
73-
""")
74+
"""
75+
)
7476
pyproject["tool"]["poetry"]["dependencies"]["foo"] = "^2.0.0"
7577
pyproject["tool"]["poetry"]["group"] = groups_content["tool"]["poetry"]["group"]
7678
pyproject = cast("TOMLDocument", pyproject)
@@ -123,12 +125,14 @@ def test_remove_without_specific_group_removes_from_specific_groups(
123125

124126
pyproject: dict[str, Any] = app.poetry.file.read()
125127

126-
groups_content: dict[str, Any] = tomlkit.parse("""\
128+
groups_content: dict[str, Any] = tomlkit.parse(
129+
"""\
127130
[tool.poetry.group.bar.dependencies]
128131
foo = "^2.0.0"
129132
baz = "^1.0.0"
130133
131-
""")
134+
"""
135+
)
132136
pyproject["tool"]["poetry"]["dependencies"]["foo"] = "^2.0.0"
133137
pyproject["tool"]["poetry"]["group"] = groups_content["tool"]["poetry"]["group"]
134138
pyproject = cast("TOMLDocument", pyproject)
@@ -180,12 +184,14 @@ def test_remove_does_not_live_empty_groups(
180184

181185
content: dict[str, Any] = app.poetry.file.read()
182186

183-
groups_content: dict[str, Any] = tomlkit.parse("""\
187+
groups_content: dict[str, Any] = tomlkit.parse(
188+
"""\
184189
[tool.poetry.group.bar.dependencies]
185190
foo = "^2.0.0"
186191
baz = "^1.0.0"
187192
188-
""")
193+
"""
194+
)
189195
content["tool"]["poetry"]["dependencies"]["foo"] = "^2.0.0"
190196
content["tool"]["poetry"]["group"] = groups_content["tool"]["poetry"]["group"]
191197
content = cast("TOMLDocument", content)
@@ -226,12 +232,14 @@ def test_remove_canonicalized_named_removes_dependency_correctly(
226232

227233
pyproject: dict[str, Any] = app.poetry.file.read()
228234

229-
groups_content: dict[str, Any] = tomlkit.parse("""\
235+
groups_content: dict[str, Any] = tomlkit.parse(
236+
"""\
230237
[tool.poetry.group.bar.dependencies]
231238
foo-bar = "^2.0.0"
232239
baz = "^1.0.0"
233240
234-
""")
241+
"""
242+
)
235243
pyproject["tool"]["poetry"]["dependencies"]["foo-bar"] = "^2.0.0"
236244
pyproject["tool"]["poetry"].value._insert_after(
237245
"dependencies", "group", groups_content["tool"]["poetry"]["group"]

tests/inspection/test_info.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,24 @@ def demo_setup_complex_calls_script(
109109
shutil.copytree(fixture_dir("scripts"), scripts_dir)
110110

111111
pyproject = source_dir / "pyproject.toml"
112-
pyproject.write_text(f"""\
112+
pyproject.write_text(
113+
f"""\
113114
[build-system]
114115
requires = ["setuptools", "scripts @ {scripts_dir.as_uri()}"]
115116
build-backend = "setuptools.build_meta:__legacy__"
116-
""")
117+
"""
118+
)
117119

118120
setup_py = source_dir / "setup.py"
119-
setup_py.write_text("""\
121+
setup_py.write_text(
122+
"""\
120123
import subprocess
121124
from setuptools import setup
122125
if subprocess.call(["exit-code"]) != 42:
123126
raise RuntimeError("Wrong exit code.")
124127
setup(name="demo", version="0.1.0", install_requires=[i for i in ["package"]])
125-
""")
128+
"""
129+
)
126130

127131
return source_dir
128132

tests/packages/test_locker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,7 @@ def test_reading_lock_file_should_raise_an_error_on_missing_metadata(
649649

650650
assert (
651651
"The lock file does not have a metadata entry.\nRegenerate the lock file with"
652-
" the `poetry lock` command."
653-
in str(e.value)
652+
" the `poetry lock` command." in str(e.value)
654653
)
655654

656655

tests/puzzle/test_solver.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4393,8 +4393,7 @@ def test_solver_yanked_warning(
43934393
assert "The locked version 2 for bar is a yanked version." in error
43944394
assert (
43954395
"The locked version 3 for baz is a yanked version. Reason for being yanked:"
4396-
" just wrong"
4397-
in error
4396+
" just wrong" in error
43984397
)
43994398
assert error.count("is a yanked version") == 2
44004399
assert error.count("Reason for being yanked") == 1

0 commit comments

Comments
 (0)