From 5b302877fc3c6f34d2682770513a5166d8ac9de4 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 8 Jul 2014 09:39:03 -0700 Subject: [PATCH] Remove requirements style check This is incorrect and should never have been added. The order of lines in requirements files affects the pip dependency resolver. Therefore, while it's nice to add new packages in alphabetical order, it must not be required. Move pbr to the top of the list as it should always be installed first. Move hacking to the top of the test-requires list. Change-Id: I81f7e75b77baccd12d9660dc009f30f2f2c891bc --- requirements.txt | 8 +++++++- test-requirements.txt | 9 ++++++++- tools/requirements_style_check.sh | 32 ------------------------------- tox.ini | 1 - 4 files changed, 15 insertions(+), 35 deletions(-) delete mode 100755 tools/requirements_style_check.sh diff --git a/requirements.txt b/requirements.txt index 0a9e26fd1f..c447554d67 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,10 @@ +# Order matters to the pip dependency resolver, so sorting this file +# changes how packages are installed. New dependencies should be +# added in alphabetical order, however, some dependencies may need to +# be installed in a specific order. +# +# PBR should always appear first +pbr>=0.6,!=0.7,<1.0 # Horizon Core Requirements Django>=1.4,<1.7 django_compressor>=1.4 @@ -11,7 +18,6 @@ kombu>=2.4.8 # for SECURE_KEY generation lockfile>=0.8 netaddr>=0.7.6 -pbr>=0.6,!=0.7,<1.0 pyscss>=1.2.0 # MIT License python-ceilometerclient>=1.0.6 python-cinderclient>=1.0.7 diff --git a/test-requirements.txt b/test-requirements.txt index 98a3da2612..ac9f81feb1 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,14 @@ +# Order matters to the pip dependency resolver, so sorting this file +# changes how packages are installed. New dependencies should be +# added in alphabetical order, however, some dependencies may need to +# be installed in a specific order. +# +# Hacking should appear first in case something else depends on pep8 +hacking>=0.9.2,<0.10 +# coverage>=3.6 django-nose docutils==0.9.1 -hacking>=0.9.2,<0.10 mox>=0.5.3 nodeenv>=0.9.4 # BSD License nose diff --git a/tools/requirements_style_check.sh b/tools/requirements_style_check.sh deleted file mode 100755 index ccbff3bddc..0000000000 --- a/tools/requirements_style_check.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/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 diff --git a/tox.ini b/tox.ini index 78353fcf83..f6f399bbb2 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,6 @@ commands = /bin/bash run_tests.sh -N --no-pep8 {posargs} [testenv:pep8] commands = /bin/bash run_tests.sh -N --pep8 - {toxinidir}/tools/requirements_style_check.sh requirements.txt test-requirements.txt [testenv:venv] commands = {posargs}