[openstack-dev] [all] requirements-py{2,3} and universal wheels

Robert Collins robertc at robertcollins.net
Mon Mar 16 23:54:00 UTC 2015


I've raised this in reviews 157135 and 153966, but I think it deserves
a thread of its own.

I think universal wheels are useful - they are simple to build and
publish - we don't need to do one wheel per Python version.

However, right now I'm fairly sure that we're not exporting the
requirements from requirements-py2 / requirements-py3 as environment
markers (see PEP-426).

That means that a wheel built on Python2 for a pbr project using
requirements-pyN files, even if marked as a universal wheel, will only
have the requirements for the Python2 deps.

This is broken - I've filed a bug about it (http://pad.lv/1431529).

I think we should deprecate and remove the requirements-pyN files and
instead use environment markers directly in requirements.txt. That
will then flow into wheels and things should just work (plus we can
delete more pbr code).

I haven't tested yet (and someone should) that it does all JUST WORK,
but thats easy: put an environment marker in a requirements.txt file
like so:

 argparse; python_version < '3'

Build a wheel, unpack it(unzip foo.whl) and cat
foo/*,dist-info/METADATA to check that the marker carried through.

-Rob

-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud



More information about the OpenStack-dev mailing list