Skip to content

Adds ways to specify a package to poetry add --help section.#2574

Merged
finswimmer merged 2 commits into
python-poetry:masterfrom
dgnsrekt:master
Jun 20, 2020
Merged

Adds ways to specify a package to poetry add --help section.#2574
finswimmer merged 2 commits into
python-poetry:masterfrom
dgnsrekt:master

Conversation

@dgnsrekt
Copy link
Copy Markdown
Contributor

Pull Request Check List

Resolves: #2569

  • Added tests for changed code.
  • Updated documentation for changed code.

No new tests or documentation needed.

@dgnsrekt
Copy link
Copy Markdown
Contributor Author

The poetry add --help changes look like this.

$ poetry add --help

USAGE
  poetry add [-D] [-E <...>] [--optional] [--python <...>] [--platform <...>] [--allow-prereleases] [--dry-run] <name1> ... [<nameN>]

ARGUMENTS
  <name>                 The packages to add.

OPTIONS
  -D (--dev)             Add as a development dependency.
  -E (--extras)          Extras to activate for the dependency. (multiple values allowed)
  --optional             Add as an optional dependency.
  --python               Python version for which the dependency must be installed.
  --platform             Platforms for which the dependency must be installed.
  --allow-prereleases    Accept prereleases.
  --dry-run              Output the operations but do not execute anything (implicitly enables --verbose).

GLOBAL OPTIONS
  -h (--help)            Display this help message
  -q (--quiet)           Do not output any message
  -v (--verbose)         Increase the verbosity of messages: "-v" for normal output, "-vv" for more verbose output and "-vvv" for debug
  -V (--version)         Display this application version
  --ansi                 Force ANSI output
  --no-ansi              Disable ANSI output
  -n (--no-interaction)  Do not ask any interactive question

DESCRIPTION
  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.
  
  You can specify a package in the following forms:
    - A single name (requests)
    - A name and a constraint (requests ^2.23.0)
    - A git url (git+https://github.com/python-poetry/poetry.git)
    - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)
    - A file path (../my-package/my-package.whl)
    - A directory (../my-package/)
    - A url (https://example.com/packages/my-package-0.1.0.tar.gz)

Comment thread poetry/console/commands/add.py Outdated
Copy link
Copy Markdown
Member

@finswimmer finswimmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Thanks a lot for your contribution.

@finswimmer finswimmer merged commit c9be792 into python-poetry:master Jun 20, 2020
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 1, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add information on the different ways to specify a package in to the help section.

2 participants