Sort requirement files in alphabetical order

This makes code more readable, and can check whether specific library
in the requirement files easily. We also enforce the check in pep8.

Change-Id: I032c3c3d29522ce85f64b21d6428d975e46cc701
Closes-Bug: #1285478
This commit is contained in:
ChenZheng 2014-02-27 14:49:09 +08:00
parent ec350d7a4f
commit 035abae6ef
4 changed files with 57 additions and 25 deletions

View File

@ -1,30 +1,30 @@
pbr>=0.6,!=0.7,<1.0
pycrypto>=2.6
argparse
Babel>=1.3
eventlet>=0.13.0
greenlet>=0.3.2
httplib2>=0.7.5
iso8601>=0.1.9
kombu>=2.4.8
argparse
lxml>=2.3
netaddr>=0.7.6
six>=1.5.2
sqlalchemy-migrate>=0.8.2,!=0.8.4
python-novaclient>=2.17.0
oslo.config>=1.2.0
paramiko>=1.9.0
PasteDeploy>=1.5.0
requests>=1.1
Routes>=1.12.3
SQLAlchemy>=0.7.8,<=0.9.99
WebOb>=1.2.3
python-heatclient>=0.2.3
python-keystoneclient>=0.7.0
python-swiftclient>=1.6
python-neutronclient>=2.3.4,<3
pbr>=0.6,!=0.7,<1.0
pycrypto>=2.6
python-ceilometerclient>=1.0.6
python-cinderclient>=1.0.6
python-heatclient>=0.2.3
python-keystoneclient>=0.7.0
python-neutronclient>=2.3.4,<3
python-novaclient>=2.17.0
python-swiftclient>=1.6
python-troveclient>=1.0.3
PyYAML>=3.1.0
paramiko>=1.9.0
Babel>=1.3
oslo.config>=1.2.0
qpid-python
requests>=1.1
Routes>=1.12.3
six>=1.5.2
SQLAlchemy>=0.7.8,<=0.9.99
sqlalchemy-migrate>=0.8.2,!=0.8.4
WebOb>=1.2.3

View File

@ -1,14 +1,13 @@
# Hacking already pins down pep8, pyflakes and flake8
hacking>=0.8.0,<0.9
coverage>=3.6
discover
# Hacking already pins down pep8, pyflakes and flake8
hacking>=0.8.0,<0.9
lockfile>=0.8
mock>=1.0
mox>=0.5.3
testtools>=0.9.34
testrepository>=0.0.18
testscenarios>=0.4
oslosphinx
python-glanceclient>=0.9.0
sphinx>=1.1.2,<1.2
oslosphinx
lockfile>=0.8
testrepository>=0.0.18
testscenarios>=0.4
testtools>=0.9.34

View File

@ -0,0 +1,32 @@
#!/bin/bash
#
# Enforce the requirement that dependencies are listed in the input
# files in alphabetical order.
# FIXME(dhellmann): This doesn't deal with URL requirements very
# well. We should probably sort those on the egg-name, rather than the
# full line.
function check_file() {
typeset f=$1
# We don't care about comment lines.
grep -v '^#' $f > ${f}.unsorted
sort -i -f ${f}.unsorted > ${f}.sorted
diff -c ${f}.unsorted ${f}.sorted
rc=$?
rm -f ${f}.sorted ${f}.unsorted
return $rc
}
exit_code=0
for filename in $@
do
check_file $filename
if [ $? -ne 0 ]
then
echo "Please list requirements in $filename in alphabetical order" 1>&2
exit_code=1
fi
done
exit $exit_code

View File

@ -17,6 +17,7 @@ commands =
flake8 heat bin/heat-api bin/heat-api-cfn bin/heat-api-cloudwatch bin/heat-engine bin/heat-manage contrib
# disable check_uptodate until a resolution is found to bug #1288586
#{toxinidir}/tools/config/check_uptodate.sh
{toxinidir}/tools/requirements_style_check.sh requirements.txt test-requirements.txt
[testenv:venv]
commands = {posargs}