What does "Py version" mean on a PyPI project page? And does it matter?

I notice that most projects released in PyPI contain "Py Version" metadata in the project page, but the values ​​are different.

Unless the package is a generic package or is not a pure python package, their values ​​appear to be different to indicate their target platform, such as a nasal page and a simplejson page .

But some other generic clean (as far as I can tell) Python packages still contain slightly different content. For example:

So my question is, are they caused by the different instrumental targets that the author uses to build his release package? My attempt to run python2 setup.py sdist bdist_wheel --universal upload

gives me the value "2.7" Py Version. Next time I'll try python3 ...

, then twine ...

to see what I get.

More importantly, does it all matter? My aforementioned command line still creates a generic package suitable for use by others in both Python 2 and Python 3 environments, doesn't it?

+1


source to share


1 answer


Anywhere you see 2.7

either 3.5

or another version of Python, this column was set by the commandbdist_wheel

based on the current version of Python used to build, but this is not the correct value. This is bug 102 in the Wheels issue tracker.

This has also been reported as a bug in the PyPI project. This really has to say py2.py3

for all these projects. Fortunately, for the tools used to set the wheels, it doesn't matter what this column says, you still have a universal wheel, it will be used for Python 2 or Python 3 installations.

This is not a PyPI bug, but the field is set by the download tool. file_upload()

The XML-RPC handler
takes the unmodified value from the loader and inserts it into the database for later display. When used, setuptools upload

this value is ultimately derived from the code that built the distribution file, so bdist_wheel

in this case.



If you care about your own project by providing the correct information there, I recommend using an twine

uploader
instead ; this package extracts the field pyversion

from the wheel filename
. Any project that has py2.py3

installed in the "Version version" column has used this tool to download. Twine has many other benefits, not least that you can use it to securely upload files over HTTPS.

As to the meaning any

, which is either set by manually downloading the file to PyPI interface, or perhaps another tool or a previous version twine

, or setuptools bdist_wheel

that I do not know.

+1


source







All Articles