@@ -54,7 +54,8 @@ class InitCommand(Command):
54
54
]
55
55
56
56
help = """\
57
- The <c1>init</c1> command creates a basic <comment>pyproject.toml</> file in the current directory.
57
+ The <c1>init</c1> command creates a basic <comment>pyproject.toml</> file in the\
58
+ current directory.
58
59
"""
59
60
60
61
def __init__ (self ) -> None :
@@ -76,13 +77,15 @@ def handle(self) -> int:
76
77
if pyproject .file .exists ():
77
78
if pyproject .is_poetry_project ():
78
79
self .line (
79
- "<error>A pyproject.toml file with a poetry section already exists.</error>"
80
+ "<error>A pyproject.toml file with a poetry section already"
81
+ " exists.</error>"
80
82
)
81
83
return 1
82
84
83
85
if pyproject .data .get ("build-system" ):
84
86
self .line (
85
- "<error>A pyproject.toml file with a defined build-system already exists.</error>"
87
+ "<error>A pyproject.toml file with a defined build-system already"
88
+ " exists.</error>"
86
89
)
87
90
return 1
88
91
@@ -91,7 +94,8 @@ def handle(self) -> int:
91
94
if self .io .is_interactive ():
92
95
self .line ("" )
93
96
self .line (
94
- "This command will guide you through creating your <info>pyproject.toml</> config."
97
+ "This command will guide you through creating your"
98
+ " <info>pyproject.toml</> config."
95
99
)
96
100
self .line ("" )
97
101
@@ -165,16 +169,18 @@ def handle(self) -> int:
165
169
)
166
170
167
171
question = "Would you like to define your main dependencies interactively?"
168
- help_message = (
169
- "You can specify a package in the following forms:\n "
170
- " - A single name (<b>requests</b>)\n "
171
- " - A name and a constraint (<b>requests@^2.23.0</b>)\n "
172
- " - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)\n "
173
- " - A git url with a revision (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)\n "
174
- " - A file path (<b>../my-package/my-package.whl</b>)\n "
175
- " - A directory (<b>../my-package/</b>)\n "
176
- " - A url (<b>https://example.com/packages/my-package-0.1.0.tar.gz</b>)\n "
177
- )
172
+ help_message = """\
173
+ You can specify a package in the following forms:
174
+ - A single name (<b>requests</b>)
175
+ - A name and a constraint (<b>requests@^2.23.0</b>)
176
+ - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)
177
+ - A git url with a revision\
178
+ (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)
179
+ - A file path (<b>../my-package/my-package.whl</b>)
180
+ - A directory (<b>../my-package/</b>)
181
+ - A url (<b>https://example.com/packages/my-package-0.1.0.tar.gz</b>)
182
+ """
183
+
178
184
help_displayed = False
179
185
if self .confirm (question , True ):
180
186
if self .io .is_interactive ():
@@ -280,11 +286,13 @@ def _determine_requirements(
280
286
choices .append (found_package .pretty_name )
281
287
282
288
self .line (
283
- f"Found <info>{ len (matches )} </info> packages matching <c1>{ package } </c1>"
289
+ f"Found <info>{ len (matches )} </info> packages matching"
290
+ f" <c1>{ package } </c1>"
284
291
)
285
292
286
293
package = self .choice (
287
- "\n Enter package # to add, or the complete package name if it is not listed" ,
294
+ "\n Enter package # to add, or the complete package name if it"
295
+ " is not listed" ,
288
296
choices ,
289
297
attempts = 3 ,
290
298
)
@@ -310,7 +318,8 @@ def _determine_requirements(
310
318
)
311
319
312
320
self .line (
313
- f"Using version <b>{ package_constraint } </b> for <c1>{ package } </c1>"
321
+ f"Using version <b>{ package_constraint } </b> for"
322
+ f" <c1>{ package } </c1>"
314
323
)
315
324
316
325
constraint ["version" ] = package_constraint
0 commit comments