PBR

"Requires Python" metadata is not put to PyPI

Bug #1735668 reported by wim glenn
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PBR
Fix Released
Medium
Ben Nemec

Bug Description

Hi there, I'm trying out PBR for the first time today because I like the idea of getting all that crap out of the setup.py file. However I faced an issue where the "Requires Python" metadata, which pip uses to know whether to download a distribution or not, was not appearing on PyPI.

"python_requires" is a setuptools keyword arg, it's a string corresponding to a version specifier (as defined in PEP 440) for the Python version, used to specify the Requires-Python defined in PEP 345.

Here's the distribution I created with PBR, which is missing the "Requires Python":
https://pypi.python.org/pypi/logging-tz
https://github.com/wimglenn/logging_tz/blob/e7b80eacbb6ce0cfe3f4a16c35939313ed442466/setup.cfg#L8

And here's one I created without, which does correctly display this metadata on PyPI:
https://pypi.python.org/pypi/pynapple
https://github.com/wimglenn/pynapple/blob/b64ef0497747a844fc25f7c6678d64cac2932cb4/setup.py#L13

Both distributions were uploaded to PyPI with twine. I followed the example of PBR itself to specify the tag like this. What am I missing here?

Revision history for this message
cmcginty (casey-mcginty) wrote :

Confirmed. Funny that even pbr's setup.cfg tries to use it as "requires-python" but it doesn't work.

Revision history for this message
Dennis Verspuij (dennis.verspuij) wrote :

This can be fixed by adding the following key-value pair to the D1_D2_SETUP_ARGS dictionary in util.py:

"python_requires": ("metadata",),

Then you can define Python version requirements in setup.cfg, for example:

python-requires = >=3.0, <4

Pip then correctly checks the version requirements upon install.

Please commit this simple fix.

Revision history for this message
Dennis Verspuij (dennis.verspuij) wrote :
Revision history for this message
Dennis Verspuij (dennis.verspuij) wrote :
Ben Nemec (bnemec)
Changed in pbr:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to pbr (master)

Fix proposed to branch: master
Review: https://review.openstack.org/571795

Changed in pbr:
assignee: nobody → Ben Nemec (bnemec)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pbr (master)

Reviewed: https://review.openstack.org/571795
Committed: https://git.openstack.org/cgit/openstack-dev/pbr/commit/?id=74680aa5f1464261d135ecee0ffa7395f1bfb09e
Submitter: Zuul
Branch: master

commit 74680aa5f1464261d135ecee0ffa7395f1bfb09e
Author: Ben Nemec <email address hidden>
Date: Fri Jun 1 18:02:55 2018 +0000

    Support python-requires metadata

    Expose the python_require setuptools option via the python-requires
    metadata item in setup.cfg.

    Closes-Bug: 1735668

    Change-Id: Idf2bb90882121e118f5b7531e027d350c0e4a441
    Co-authored-by: Dennis Verspuij <email address hidden>

Changed in pbr:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack-dev/pbr 4.1.0

This issue was fixed in the openstack-dev/pbr 4.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.