Skip to content

Commit

Permalink
Merge pull request #2574 from dgnsrekt/master
Browse files Browse the repository at this point in the history
Adds ways to specify a package to poetry add --help section.
  • Loading branch information
finswimmer authored Jun 20, 2020
2 parents 1fb9132 + d1786b8 commit c9be792
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions poetry/console/commands/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,18 @@ class AddCommand(EnvCommand, InitCommand):
"Output the operations but do not execute anything (implicitly enables --verbose).",
),
]

help = """The add command adds required packages to your <comment>pyproject.toml</> and installs them.
If you do not specify a version constraint, poetry will choose a suitable one based on the available package versions.
"""
help = (
"The add command adds required packages to your <comment>pyproject.toml</> and installs them.\n\n"
"If you do not specify a version constraint, poetry will choose a suitable one based on the available package versions.\n\n"
"You can specify a package in the following forms:\n"
" - A single name (<b>requests</b>)\n"
" - A name and a constraint (<b>requests@^2.23.0</b>)\n"
" - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)\n"
" - A git url with a revision (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)\n"
" - A file path (<b>../my-package/my-package.whl</b>)\n"
" - A directory (<b>../my-package/</b>)\n"
" - A url (<b>https://example.com/packages/my-package-0.1.0.tar.gz</b>)\n"
)

loggers = ["poetry.repositories.pypi_repository"]

Expand Down
2 changes: 1 addition & 1 deletion poetry/console/commands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def handle(self):
help_message = (
"You can specify a package in the following forms:\n"
" - A single name (<b>requests</b>)\n"
" - A name and a constraint (<b>requests ^2.23.0</b>)\n"
" - A name and a constraint (<b>requests@^2.23.0</b>)\n"
" - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)\n"
" - A git url with a revision (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)\n"
" - A file path (<b>../my-package/my-package.whl</b>)\n"
Expand Down

0 comments on commit c9be792

Please sign in to comment.