[openstack-dev] [all][requirements] Proposing a slight change in requirements.txt syncing output.

Robert Collins robertc at robertcollins.net
Mon Jun 15 23:18:55 UTC 2015

At the moment we copy the global-requirements lines verbatim.

So if we have two lines in global-requirements.txt:
oslotest>=1.5.1  # Apache-2.0
PyECLib>=1.0.7                          # BSD
with very different layouts

That is preserved precisely into the output file - be that
requirements.txt, test-requirements.txt etc.

With the advent of extras, stored in setup.cfg and conditional
dependencies using PEP-426 environment markers we can't do that quite
so easily.

Because to put
requests-kerberos>=0.6;python_version=='2.7' # MIT
into a setup.cfg extra called kerberos, we have to write it like so:

kerberos =
  requests-kerberos>=0.6:python_version=='2.7' # MIT

(Note the ; -> : change)

This means we're going to be parsing and reconstructing the line.

I could go to some effort to make sure we store the whitespace gaps
and reproduce... but I think it will be better code, and easier to
understand if we just regenerate the line from the parsed data
(package name, specifiers, markers, comment).

This will mean that
PyECLib>=1.0.7                          # BSD
would be synced into requirements.txt as
PyECLib>=1.0.7 # BSD

I'm writing the code to do this at the moment, and in the absence of
folk crying out loudly here, hope to have it in as soon as a find
reviewers for openstack/requirements (which btw for all that I have
hear much interest in.... +2 folk timeslices are rare as hens teeth!)


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

More information about the OpenStack-dev mailing list