Properly manage contraints and requirements 85/72285/3
authorCédric Ollivier <cedric.ollivier@orange.com>
Mon, 29 Mar 2021 08:21:31 +0000 (10:21 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Mon, 29 Mar 2021 08:27:48 +0000 (10:27 +0200)
It leverages OpenStack's python librairy management.
Ussuri is selected as OpenStack dropped py27 in the newer releases.

Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Change-Id: Iccfda223eb5c7013ec712beab9cd6f0c784f3fae

testapi/docker/Dockerfile
testapi/requirements.txt
testapi/setup.py
testapi/test-requirements.txt
testapi/tox.ini
testapi/upper-constraints.txt [new file with mode: 0644]

index 9fbeb8d..d4446b3 100644 (file)
@@ -30,7 +30,6 @@ LABEL version="v1" description="OPNFV TestAPI Docker container"
 ARG user=ubuntu
 ARG group=ubuntu
 
-# Packaged dependencies
 RUN apt-get update && apt-get install -y \
     curl git gcc wget python-dev python-pip python-wheel python-setuptools \
     crudini libxslt-dev zlib1g-dev --no-install-recommends && \
@@ -39,7 +38,9 @@ RUN apt-get update && apt-get install -y \
   chown -R $user:$group /home/ubuntu/releng-testresults && \
   git clone https://gerrit.opnfv.org/gerrit/releng-testresults \
     /home/ubuntu/releng-testresults && \
-  pip install -r /home/ubuntu/releng-testresults/testapi/requirements.txt && \
+  pip install -r /home/ubuntu/releng-testresults/testapi/requirements.txt \
+    -c /home/ubuntu/releng-testresults/testapi/upper-constraints.txt \
+    -c https://raw.githubusercontent.com/openstack/requirements/stable/ussuri/upper-constraints.txt && \
   sed -i '152,152s/)/,\ verify=False)/g' \
     /usr/local/lib/python2.7/dist-packages/cas.py && \
   cd /home/ubuntu/releng-testresults/testapi/ && python setup.py install && \
index 0223752..9dba746 100644 (file)
@@ -2,24 +2,13 @@
 # of appearance. Changing the order has an impact on the overall integration
 # process, which may cause wedges in the gate later.
 
-pbr==4.0.4
-tornado==4.3 # Apache-2.0
-epydoc>=0.3.1
-six==1.11.0  # MIT
-motor==1.2.2  # Apache-2.0
-python-cas==1.2.0
-requests==2.19.1
-futures==3.2.0
-argparse==1.2.1
-backports-abc==0.5
-backports.ssl-match-hostname==3.5.0.1
-certifi==2018.4.16
-chardet==3.0.4
-colorama==0.2.5
-html5lib==0.999
-idna==2.7
-iniparse==0.4
-pymongo==3.6.1
-singledispatch==3.4.0.3
-urllib3==1.23
-wsgiref==0.1.2
+pbr!=2.1.0 # Apache-2.0
+setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0;python_version>='3.5' # PSF/ZPL
+setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0,<45.0.0;python_version<='2.7' # PSF/ZPL
+tornado<=4.3,>=3.1 # Apache-2.0
+epydoc
+six # MIT
+motor # Apache-2.0
+python-cas
+requests[security]!=2.20.0 # Apache-2.0
+futures!=0.17.0;python_version=='2.7' or python_version=='2.6' # PSF
index f9d95a3..566d844 100644 (file)
@@ -1,13 +1,29 @@
-import setuptools
+# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
-__author__ = 'serena'
+# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
+import setuptools
 
+# In python < 2.7.4, a lazy loading of package `pbr` will break
+# setuptools if some other modules registered functions in `atexit`.
+# solution from: http://bugs.python.org/issue15881#msg170215
 try:
     import multiprocessing  # noqa
 except ImportError:
     pass
 
-
 setuptools.setup(
     setup_requires=['pbr>=2.0.0'],
     pbr=True)
index 233f465..67fd8f0 100644 (file)
@@ -2,9 +2,9 @@
 # of appearance. Changing the order has an impact on the overall integration
 # process, which may cause wedges in the gate later.
 
-coverage>=4.0,!=4.4  # Apache-2.0
-mock>=2.0  # BSD
-nose  # LGPL
-pytest  # MIT
-pytest-cov  # MIT
-pytest-mock  # MIT
+coverage!=4.4 # Apache-2.0
+mock!=4.0.0,!=4.0.1 # BSD
+nose # LGPL
+pytest # MIT
+pytest-cov
+pytest-mock
index 3092284..0478e23 100644 (file)
@@ -14,6 +14,8 @@ install_command = pip install -U {opts} {packages}
 deps =
   -rrequirements.txt
   -rtest-requirements.txt
+  -chttps://raw.githubusercontent.com/openstack/requirements/stable/ussuri/upper-constraints.txt
+  -cupper-constraints.txt
 commands=
   py.test \
   --basetemp={envtmpdir} \
diff --git a/testapi/upper-constraints.txt b/testapi/upper-constraints.txt
new file mode 100644 (file)
index 0000000..5226f48
--- /dev/null
@@ -0,0 +1,9 @@
+epydoc===3.0.1
+motor===1.2.2
+python-cas===1.2.0
+argparse===1.2.1
+backports-abc===0.5
+backports.ssl-match-hostname===3.5.0.1
+html5lib===0.999
+singledispatch===3.4.0.3
+wsgiref===0.1.2