From e8d56b6856b4365e62a36dbeea1b42fc29d81174 Mon Sep 17 00:00:00 2001 From: tierno Date: Sun, 24 Nov 2019 07:48:37 +0000 Subject: [PATCH] fix RO/tox.ini,requirements.txt Change-Id: Iaafbf458cabbecc748185e3fb52366b6f27965cf Signed-off-by: tierno --- Dockerfile | 33 ++++++--------------------------- RO/requirements.txt | 2 +- RO/tox.ini | 13 ++++++------- devops-stages/stage-test.sh | 3 +-- 4 files changed, 14 insertions(+), 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index 71e649f2..4e0e7bf3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,37 +15,16 @@ # This Dockerfile is intented for devops and deb package generation # -# Use docker/Dockerfile-local for running osm/RO in a docker container from source +# Use Dockerfile-local for running osm/RO in a docker container from source FROM ubuntu:16.04 RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get --yes install git tox make python-all python3 python3-pip debhelper wget && \ - DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-all libssl-dev flake8 apt-utils && \ - DEBIAN_FRONTEND=noninteractive pip3 install -U setuptools setuptools-version-command stdeb + DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-all libssl-dev apt-utils && \ + DEBIAN_FRONTEND=noninteractive pip3 install -U setuptools setuptools-version-command stdeb && \ + DEBIAN_FRONTEND=noninteractive apt-get --yes install libmysqlclient-dev mysql-client -# FROM ubuntu:16.04 - -# RUN apt-get update && \ -# DEBIAN_FRONTEND=noninteractive apt-get -y install git make python python-pip debhelper python3 python3-all python3-pip python3-setuptools && \ -# DEBIAN_FRONTEND=noninteractive apt-get -y install wget tox apt-utils flake8 python-nose python-mock && \ -# DEBIAN_FRONTEND=noninteractive pip install pip==9.0.3 && \ -# DEBIAN_FRONTEND=noninteractive pip3 install pip==9.0.3 && \ -# DEBIAN_FRONTEND=noninteractive pip install -U setuptools setuptools-version-command stdeb && \ -# DEBIAN_FRONTEND=noninteractive pip install -U pyang pyangbind && \ -# DEBIAN_FRONTEND=noninteractive pip3 install -U pyang pyangbind && \ -# DEBIAN_FRONTEND=noninteractive apt-get -y install python-yaml python-netaddr python-boto && \ -# DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common && \ -# DEBIAN_FRONTEND=noninteractive add-apt-repository -y cloud-archive:queens && \ -# DEBIAN_FRONTEND=noninteractive apt-get update && \ -# DEBIAN_FRONTEND=noninteractive apt-get -y install python-novaclient python-keystoneclient python-glanceclient python-cinderclient python-neutronclient python-networking-l2gw && \ -# DEBIAN_FRONTEND=noninteractive pip install -U progressbar pyvmomi pyvcloud==19.1.1 && \ -# DEBIAN_FRONTEND=noninteractive pip install -U fog05rest && \ -# DEBIAN_FRONTEND=noninteractive pip install -U azure && \ -# DEBIAN_FRONTEND=noninteractive apt-get -y install python-argcomplete python-bottle python-cffi python-packaging python-paramiko python-pkgconfig libmysqlclient-dev libssl-dev libffi-dev python-mysqldb && \ -# DEBIAN_FRONTEND=noninteractive apt-get -y install python-logutils python-openstackclient python-openstacksdk && \ -# DEBIAN_FRONTEND=noninteractive pip install untangle && \ -# DEBIAN_FRONTEND=noninteractive pip install pyone && \ -# DEBIAN_FRONTEND=noninteractive pip install -e git+https://github.com/python-oca/python-oca#egg=oca + # needed for tests: libmysqlclient-dev mysql-client tox # TODO py3 comment # Uncomment this block to generate automatically a debian package and show info @@ -53,5 +32,5 @@ RUN apt-get update && \ # WORKDIR /app # # Copy the current directory contents into the container at /app # ADD . /app -# CMD /app/devops-stages/stage-build.sh && find -name "*.deb" -exec dpkg -I {} ";" +# CMD /app/devops-stages/stage-build.sh && find deb_dist -name "*.deb" -exec dpkg -I {} ";" diff --git a/RO/requirements.txt b/RO/requirements.txt index 973b82d3..8d8ea73d 100644 --- a/RO/requirements.txt +++ b/RO/requirements.txt @@ -14,7 +14,7 @@ PyYAML bottle -MySQL-python +mysqlclient jsonschema paramiko requests==2.18.* diff --git a/RO/tox.ini b/RO/tox.ini index 810ab397..7c20f6f4 100644 --- a/RO/tox.ini +++ b/RO/tox.ini @@ -12,17 +12,16 @@ # limitations under the License. [tox] -#envlist = py27,py3 -envlist = py35 -toxworkdir={homedir}/.tox +envlist = flake8, unittest +toxworkdir={toxinidir}/.tox [testenv] -deps=nose - mock -commands=nosetests +usedevelop = True +basepython = python3 +install_command = python3 -m pip install -r requirements.txt -U {opts} {packages} [testenv:flake8] -basepython = python +basepython = python3 deps = flake8 # TODO for the moment few files are tested. commands = flake8 osm_ro/wim --max-line-length 120 \ diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh index 13cef859..d57c97a7 100755 --- a/devops-stages/stage-test.sh +++ b/devops-stages/stage-test.sh @@ -13,6 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -flake8 RO/osm_ro/wim RO/osm_ro/vim_thread.py --max-line-length 120 \ - --exclude .svn,CVS,.gz,.git,__pycache__,.tox,local,temp,osm_im --ignore W291,W293,E226,E402,W504 +tox -c RO/tox.ini -- 2.17.1