[openstack-dev] [requirements] converging the openstack-infra/project-config and openstack/requirements requirements checks

Robert Collins robertc at robertcollins.net
Wed Jun 24 04:03:18 UTC 2015


We have inconsistent rules being applied to requirements files.

In openstack/requirements we handle:
# comments
packages[specifiers][markers]
-e / -f [ARBITRARY]
https://tarballs.openstack.org/

^- blanklines

In openstack-infra/project-config, we check that everything is one of:
- a trailing \n on the file
packages[specifiers]
# comments
http://tarballs.openstack.org/

^- blanklines

We also have a strict/nonstrict mode which appears to be the same to me.

So - I'd like to do two things here.

Firstly, I want to move all the linting code into
openstack/requirements, so we don't have two different parsers that
*can* vary in what they can handle. That seems mechanical.

More interestingly though, I want to converge the rules.

So far I have this list of variance:
1) trailing \n is mandatory in infra [requirements *generates files,
so to date hasn't cared]
2) -e and -f line are not supported in infra (but don't error in
non-strict mode)
3) infra doesn't handle markers at all

I propose the following to reconcile:
 - I'll add a lint command to openstack/requirements
 - it will check for \n
 - it will accept the set that openstack/requirements accepts in each
of non-strict and strict mode
 - anything that parses will be checked against global-requirements
for equivalence.

This is conservative in that it accepts the broader of the two sets of
things we had. I could be conservative in the other way and clamp
update-requirements down to reject -e and -f in non-strict mode, if
thats desired: but I don't really want to have to chase some number of
projects to be stricter as part of this.

While this is discussed, I'm going to prep the basic patch set, and
can fine tune based on the resulting discussion.

-Rob


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



More information about the OpenStack-dev mailing list