Skip to content

Commit c9be792

Browse files
authored
Merge pull request #2574 from dgnsrekt/master
Adds ways to specify a package to poetry add --help section.
2 parents 1fb9132 + d1786b8 commit c9be792

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

Diff for: poetry/console/commands/add.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,18 @@ class AddCommand(EnvCommand, InitCommand):
4040
"Output the operations but do not execute anything (implicitly enables --verbose).",
4141
),
4242
]
43-
44-
help = """The add command adds required packages to your <comment>pyproject.toml</> and installs them.
45-
46-
If you do not specify a version constraint, poetry will choose a suitable one based on the available package versions.
47-
"""
43+
help = (
44+
"The add command adds required packages to your <comment>pyproject.toml</> and installs them.\n\n"
45+
"If you do not specify a version constraint, poetry will choose a suitable one based on the available package versions.\n\n"
46+
"You can specify a package in the following forms:\n"
47+
" - A single name (<b>requests</b>)\n"
48+
" - A name and a constraint (<b>requests@^2.23.0</b>)\n"
49+
" - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)\n"
50+
" - A git url with a revision (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)\n"
51+
" - A file path (<b>../my-package/my-package.whl</b>)\n"
52+
" - A directory (<b>../my-package/</b>)\n"
53+
" - A url (<b>https://example.com/packages/my-package-0.1.0.tar.gz</b>)\n"
54+
)
4855

4956
loggers = ["poetry.repositories.pypi_repository"]
5057

Diff for: poetry/console/commands/init.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def handle(self):
146146
help_message = (
147147
"You can specify a package in the following forms:\n"
148148
" - A single name (<b>requests</b>)\n"
149-
" - A name and a constraint (<b>requests ^2.23.0</b>)\n"
149+
" - A name and a constraint (<b>requests@^2.23.0</b>)\n"
150150
" - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)\n"
151151
" - A git url with a revision (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)\n"
152152
" - A file path (<b>../my-package/my-package.whl</b>)\n"

0 commit comments

Comments
 (0)