update requirements

Change-Id: I4cfed25238753b71ccd8093c9c07c30ebb6bf24b
This commit is contained in:
Moshe Levi 2017-05-04 14:19:35 +03:00
parent 71cfd3a094
commit 75de33192f
7 changed files with 124 additions and 20 deletions

View File

@ -1,7 +1,25 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
Babel>=1.3
pbr<2.0.0,>=1.8 # Apache-2.0
eventlet!=0.18.3,>=0.18.2 # MIT
netaddr!=0.7.16,>=0.7.13 # BSD
python-neutronclient>=5.1.0 # Apache-2.0
SQLAlchemy<1.1.0,>=1.0.10 # MIT
alembic>=0.8.10 # MIT
six>=1.9.0 # MIT
stevedore>=1.17.1 # Apache-2.0
oslo.config!=3.18.0,>=3.14.0 # Apache-2.0
oslo.i18n>=2.1.0 # Apache-2.0
oslo.log>=3.11.0 # Apache-2.0
oslo.messaging>=5.14.0 # Apache-2.0
oslo.serialization>=1.10.0 # Apache-2.0
oslo.utils>=3.18.0 # Apache-2.0
python-openstackclient>=3.3.0 # Apache-2.0
neutron-lib>=1.1.0 # Apache-2.0
lxml
pyzmq
-e git://git.openstack.org/openstack/neutron.git#egg=neutron

View File

@ -52,8 +52,15 @@ def print_help():
def main(argv):
root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
venv = os.path.join(root, '.venv')
if 'tools_path' in os.environ:
root = os.environ['tools_path']
else:
root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if 'venv' in os.environ:
venv = os.environ['venv']
else:
venv = os.path.join(root, '.venv')
pip_requires = os.path.join(root, 'requirements.txt')
test_requires = os.path.join(root, 'test-requirements.txt')
py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1])
@ -69,4 +76,4 @@ def main(argv):
if __name__ == '__main__':
main(sys.argv)
sys.exit(main(sys.argv))

View File

@ -112,12 +112,12 @@ class InstallVenv(object):
print('Installing dependencies with pip (this can take a while)...')
# First things first, make sure our venv has the latest pip and
# setuptools.
self.pip_install('pip>=1.3')
# setuptools and pbr
self.pip_install('pip>=1.4')
self.pip_install('setuptools')
self.pip_install('pbr')
self.pip_install('-r', self.requirements)
self.pip_install('-r', self.test_requirements)
self.pip_install('-r', self.requirements, '-r', self.test_requirements)
def parse_args(self, argv):
"""Parses command-line arguments."""
@ -125,7 +125,7 @@ class InstallVenv(object):
parser.add_option('-n', '--no-site-packages',
action='store_true',
help="Do not inherit packages from global Python "
"install")
"install.")
return parser.parse_args(argv[1:])[0]

8
tools/ostestr_compat_shim.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# preserve old behavior of using an arg as a regex when '--' is not present
case $@ in
(*--*) ostestr $@;;
('') ostestr;;
(*) ostestr --regex "$@"
esac

16
tools/tox_install.sh Executable file
View File

@ -0,0 +1,16 @@
#! /bin/sh
set -e
DIR=$(dirname $0)
${DIR}/tox_install_project.sh neutron neutron $*
CONSTRAINTS_FILE=$1
shift
install_cmd="pip install"
if [ $CONSTRAINTS_FILE != "unconstrained" ]; then
install_cmd="$install_cmd -c$CONSTRAINTS_FILE"
fi
$install_cmd -U $*

52
tools/tox_install_project.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/sh
# Many of neutron's repos suffer from the problem of depending on neutron,
# but it not existing on pypi.
# This wrapper for tox's package installer will use the existing package
# if it exists, else use zuul-cloner if that program exists, else grab it
# from neutron master via a hard-coded URL. That last case should only
# happen with devs running unit tests locally.
# From the tox.ini config page:
# install_command=ARGV
# default:
# pip install {opts} {packages}
PROJ=$1
MOD=$2
shift 2
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
neutron_installed=$(echo "import ${MOD}" | python 2>/dev/null ; echo $?)
BRANCH_NAME=master
set -e
CONSTRAINTS_FILE=$1
shift
install_cmd="pip install"
if [ $CONSTRAINTS_FILE != "unconstrained" ]; then
install_cmd="$install_cmd -c$CONSTRAINTS_FILE"
fi
if [ $neutron_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install-${PROJ}.txt
echo "${PROJ} already installed; using existing package"
elif [ -x "$ZUUL_CLONER" ]; then
echo "ZUUL CLONER" > /tmp/tox_install-${PROJ}.txt
cwd=$(/bin/pwd)
cd /tmp
$ZUUL_CLONER --cache-dir \
/opt/git \
--branch ${BRANCH_NAME} \
git://git.openstack.org \
openstack/${PROJ}
cd openstack/${PROJ}
$install_cmd -e .
cd "$cwd"
else
echo "PIP HARDCODE" > /tmp/tox_install-${PROJ}.txt
$install_cmd -U -egit+https://git.openstack.org/openstack/${PROJ}@${BRANCH_NAME}#egg=${PROJ}
fi

25
tox.ini
View File

@ -1,34 +1,37 @@
[tox]
envlist = py33,py34,py27,pep8
envlist = py35,py27,pep8
minversion = 1.6
skipsdist = True
[testenv]
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
usedevelop = True
install_command = pip install -U -r requirements.txt {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = sh
commands = python setup.py testr --slowest --testr-args='{posargs}'
commands =
{toxinidir}/tools/ostestr_compat_shim.sh {posargs}
# there is also secret magic in pretty_tox.sh which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:hashtest]
# This is the same as default environment, but with a random PYTHONHASHSEED.
# You can also specify a specific hashseed (for test repeatability) as follows:
# tox --hashseed 1235130571 -e hashtest
setenv = VIRTUAL_ENV={envdir}
[tox:jenkins]
sitepackages = True
[testenv:py27]
setenv = OS_FAIL_ON_MISSING_DEPS=1
[testenv:pep8]
basepython = python2.7
deps =
{[testenv]deps}
commands =
# If it is easier to add a check via a shell script, consider adding it in this file
sh ./tools/misc-sanity-checks.sh
flake8
neutron-db-manage --subproject networking-mlnx --database-connection sqlite:// check_migration
neutron-db-manage --subproject networking-mlnx check_migration
whitelist_externals = sh
[testenv:i18n]