From 667d87ddcef799e841fef0c7e9800843827e8cad Mon Sep 17 00:00:00 2001 From: dgnsrekt Date: Wed, 17 Jun 2020 11:01:19 -0500 Subject: [PATCH 1/2] Adds ways to specify a package to poetry add --help section. --- poetry/console/commands/add.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/poetry/console/commands/add.py b/poetry/console/commands/add.py index 275fc44f5f1..ce980dc8f7a 100644 --- a/poetry/console/commands/add.py +++ b/poetry/console/commands/add.py @@ -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 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 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 (requests)\n" + " - A name and a constraint (requests ^2.23.0)\n" + " - A git url (git+https://github.com/python-poetry/poetry.git)\n" + " - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n" + " - A file path (../my-package/my-package.whl)\n" + " - A directory (../my-package/)\n" + " - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n" + ) loggers = ["poetry.repositories.pypi_repository"] From d1786b892cd060fe2d7d7c63b5e57e0bb8eb5b5f Mon Sep 17 00:00:00 2001 From: dgnsrekt Date: Sat, 20 Jun 2020 09:51:19 -0500 Subject: [PATCH 2/2] Fixes add and init command --help documentation. --- poetry/console/commands/add.py | 2 +- poetry/console/commands/init.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/poetry/console/commands/add.py b/poetry/console/commands/add.py index ce980dc8f7a..378d7a2f871 100644 --- a/poetry/console/commands/add.py +++ b/poetry/console/commands/add.py @@ -45,7 +45,7 @@ class AddCommand(EnvCommand, InitCommand): "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 (requests)\n" - " - A name and a constraint (requests ^2.23.0)\n" + " - A name and a constraint (requests@^2.23.0)\n" " - A git url (git+https://github.com/python-poetry/poetry.git)\n" " - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n" " - A file path (../my-package/my-package.whl)\n" diff --git a/poetry/console/commands/init.py b/poetry/console/commands/init.py index b74d191fa5c..c85f441b8aa 100644 --- a/poetry/console/commands/init.py +++ b/poetry/console/commands/init.py @@ -146,7 +146,7 @@ def handle(self): help_message = ( "You can specify a package in the following forms:\n" " - A single name (requests)\n" - " - A name and a constraint (requests ^2.23.0)\n" + " - A name and a constraint (requests@^2.23.0)\n" " - A git url (git+https://github.com/python-poetry/poetry.git)\n" " - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n" " - A file path (../my-package/my-package.whl)\n"