pypi / warehouse

The Python Package Index
https://pypi.org
Apache License 2.0
3.6k stars 963 forks source link

Include a copyable line that I can add to my requirements.txt on the pypi home page for each library #8019

Open michaelwiles opened 4 years ago

michaelwiles commented 4 years ago

What's the problem this feature will solve? Looking to increase efficiency and convenience

Describe the solution you'd like So on the pypi home page for each library there is a pip install xxx line that you can copy.

I'm requesting that a requirements.txt entry for the latest version of the library is also included here. So xxx== that I can just copy so that I can paste it in to my requirements.txt. Not entirely sure how to present it on the pypi front page but this would be very helpful and not a lot of work to do.

bpabel commented 4 years ago

The Packaging User Guide doesn't even cover requirements.txt files, so I'm assuming their use is de facto deprecated in favor of more modern tools like poetry or pipenv (which are mentioned in the packaging docs).

It would seem odd to provide a convenience item for something the docs don't recommend using anymore.

di commented 4 years ago

The guide does cover requirements files (e.g. https://packaging.python.org/guides/installing-using-pip-and-virtual-environments#using-requirements-files) and they are not deprecated.

michaelwiles commented 4 years ago

So then why not include lines for poetry and pipenv then? And even if requirements.txt is deprecated, don't lots of people use pip install -r requirements.txt?

I assumed because you provide a pip install line that you "support" requirements.txt...

Besides, panda, numpy, pillow, urllib3, boto3, Python-dateutil all have some kind of requirements.txt - and I'm sure if I looked more I'd find more popular python projects that do still use some kind of requirements.txt

The other flavour is that they use dependencies in this format: chardet==3.0.2 specified in the setup.py file. Which is the same format as requirements uses - and the format I'm requesting gets added.

But like I said, why not cover pipenv and poetry as well.

sedders123 commented 4 years ago

NuGet the package manager for .NET has a nice UI that can show multiple install commands for different tools. image image image (From https://www.nuget.org/packages/Newtonsoft.Json/)

Maybe warehouse could do something similar?

michaelwiles commented 4 years ago

Yes! The maven repository also has that. That's why I'm asking for it.

image

from https://mvnrepository.com/artifact/junit/junit/4.13