From 4a265933f2b148ba0b89dbb1bad6052962a26b86 Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Wed, 27 Sep 2023 13:28:00 +0200 Subject: [PATCH] fix: use Jenkins `python3.8` agent --- Dockerfile.CI | 32 -------------------------------- Jenkinsfile | 4 +--- tox.ini | 31 ++++++++++++++++++------------- 3 files changed, 19 insertions(+), 48 deletions(-) delete mode 100644 Dockerfile.CI diff --git a/Dockerfile.CI b/Dockerfile.CI deleted file mode 100644 index 1d1143e0..00000000 --- a/Dockerfile.CI +++ /dev/null @@ -1,32 +0,0 @@ -FROM indigodatacloud/ci-images:base-u18 -MAINTAINER Pablo Orviz - -RUN apt-get update \ - && apt-get install --no-install-recommends -y wget \ - git \ - python3.7 python3-dev python-pip \ - python-setuptools python-wheel \ - python3-wheel python3-pip python3-venv \ - build-essential \ - libcurl4-gnutls-dev \ - libffi-dev \ - libssl-dev \ - libxml2-dev \ - libxslt1-dev \ - libgnutls28-dev \ - default-libmysqlclient-dev libsqlite3-dev \ - curl \ - tox flake8 pylint pydocstyle pep8 bandit \ - && rm -rf /var/lib/apt/lists/* - -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10 -RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10 -# otherwise issues with twine<=1.10.0 -RUN pip install twine==1.11.0 -RUN pip install -U wheel setuptools - -# Standard SSH port -EXPOSE 22 - -# Default command -CMD ["/usr/sbin/sshd", "-D"] diff --git a/Jenkinsfile b/Jenkinsfile index b5c8bf4d..5d3edad6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,9 +4,7 @@ pipeline { agent { - dockerfile { - filename 'Dockerfile.CI' - } + label 'python3.8' } environment { diff --git a/tox.ini b/tox.ini index e6b40fe8..e9bbe08b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] min_version = 4.3.3 -envlist = +envlist = py3{8, 9, 10} flake8 black @@ -23,6 +23,11 @@ python = python3.11 skip_install = true package = deepaas +[jenkins] +python = python3.8 +skip_install = true +package = deepaas + [pytest] addopts = -p no:warnings @@ -68,10 +73,10 @@ basepython = python3.12 [flake8] # Black default line length is 88 -max-line-length = 88 +max-line-length = 88 show-source = True builtins = _ -exclude = +exclude = .venv .git .tox @@ -82,8 +87,8 @@ exclude = build [testenv:flake8] -basepython = {[base]python} -skip_install = {[base]skip_install} +basepython = {[jenkins]python} +skip_install = {[jenkins]skip_install} deps = flake8>=4.0,<4.1 flake8-bugbear>=22.3,<22.4 @@ -112,7 +117,7 @@ commands = bandit -r {[base]package} -x tests -s B110,B410 basepython = {[base]python} deps = {[testenv:bandit]deps} skip_install = {[base]skip_install} -commands = +commands = - mkdir /tmp/bandit - bandit -r {[base]package} -x tests -s B110,B410 -f html -o /tmp/bandit/index.html @@ -128,21 +133,21 @@ commands = oslo-config-generator --config-file=etc/{[base]package}-config-genera [testenv:docs] basepython = {[base]python} -deps = +deps = -r {toxinidir}/doc/requirements.txt commands = rm -rf doc/build python setup.py build_sphinx -[testenv:mypy] -description = Static type checks +[testenv:mypy] +description = Static type checks basepython = {[base]python} -deps = +deps = mypy -commands = +commands = mypy --config-file mypy.ini -p {[base]package} [testenv:pip-missing-reqs] -basepython = {[base]python} +basepython = {[jenkins]python} deps = pip_check_reqs -commands=pip-missing-reqs -d --ignore-file={[base]package}/tests/* {[base]package} +commands=pip-missing-reqs -d --ignore-file={[jenkins]package}/tests/* {[jenkins]package}