python-poetry / python-poetry/poetry

(🎁) `poetry show X --version` would be pretty useful for scripts

Open
#5,128 0 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/cli area/show kind/feature status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

I want to be able to:

> version=$(poetry show playwright --version)

Currently I have to do something like:

> version=$(poetry show playwright | grep -P "Version\s*:" | grep -oP '[^ ]*$')

Why on earth is --version a global option?

> poetry show playwright --version
Poetry version 1.1.12

It only ever makes sense to run it on it's own poetry --version, never with other arguments/sub commands:

> poetry add pendulum --dev --version
Poetry version 1.1.12

😕

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the poetry show command and how the global --version option is handled. Verify the requested behavior with poetry show playwright --version and poetry --version; done means the former outputs the package version for scripts while the latter still reports Poetry's version.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.