poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Add support to `poetry show` for packages that are not installed

Open JakeSummers opened this issue 1 year ago • 4 comments

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the FAQ and general documentation and believe that my question is not already covered.

Feature Request

I am working on publishing a package using poetry publish. Before publishing, I would like to check what versions of my package are already available on Pypi, so that I can ensure that I don't overwrite an existing version.

Poetry has some functionality, that lets you interact with Pypi including:

  • poetry show --latest foo (note this only works for packages that you depend on - if you don't have foo in your dependencies the command doesn't work)
  • poetry search foo

It would be awesome if we could use poetry info foo or poetry show foo to get info on packages that are not currently installed (or is the current package).

Ideally, it would have format something like this:

$ poetry info black
 name         : black
 version      : 22.10.0
 description  : The uncompromising code formatter.

dependencies
 - click >=8.0.0
 - mypy-extensions >=0.4.3
 - pathspec >=0.9.0
 - platformdirs >=2
 - tomli >=1.1.0
 - typing-extensions >=3.10.0.0

And maybe a command to list all of the versions:

poetry info black --verisons
22.10.0
22.9.0
22.7.0
...

JakeSummers avatar Mar 28 '23 17:03 JakeSummers

There are existing projects with similar purpose - eg quick google finds https://pypi.org/project/pypi-command-line/ - suggest using that or similar. poetry doesnt have to do everything!

dimbleby avatar Mar 28 '23 18:03 dimbleby

I just found this issue and came here being surprised that poetry show PACKAGENAME does not show me info about an available package in some repository that would get installed/added when I run poetry add PACKAGENAME - which I somehow took for granted given that many other package managers like apt, rpm, pip, gem etc have a function like that...

I absolutely agree poetry doesn't need to do everything, but at the same time this is a common function pattern and not really unrelated top the tasks people use poetry. So as a user it would be quite natural and a good experience.

henning avatar Sep 07 '23 14:09 henning

I guess that's a consequence from the fact that poetry is more like a build system than a package manager, but still, being able to cast show at least for the package one is currently developing seems like a must to me.

mshonichev avatar Dec 09 '23 16:12 mshonichev

this is a must for me too .. +1

LucasSchelkes-BA avatar Apr 09 '24 18:04 LucasSchelkes-BA