From 564a93a872397543412fcb57630399d7302de66c Mon Sep 17 00:00:00 2001 From: Alvaro Lopez Garcia Date: Wed, 27 Sep 2023 11:54:47 +0200 Subject: [PATCH 1/3] Update Python version in tox envs and GH actions --- .github/workflows/ci.yml | 2 +- .github/workflows/python-publish.yml | 2 +- tox.ini | 18 +++++++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7768c2a4..d8629ab9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 89573a2b..fe981c9c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 diff --git a/tox.ini b/tox.ini index 685ef74a..e6b40fe8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] min_version = 4.3.3 envlist = - py3{7, 8, 9, 10} + py3{8, 9, 10} flake8 black bandit @@ -12,13 +12,14 @@ skipsdist = True [gh-actions] python = - 3.7: py37 3.8: py38 3.9: py39 - 3.10: py310, flake8, black, bandit, pip-missing-reqs, pypi + 3.10: py310 + 3.11: py311, flake8, black, bandit, pip-missing-reqs, pypi + 3.12: py312 [base] -python = python3.10 +python = python3.11 skip_install = true package = deepaas @@ -50,9 +51,6 @@ commands = find . -type f -name "*.pyc" -delete pytest {posargs} -[testenv:py37] -basepython = python3.7 - [testenv:py38] basepython = python3.8 @@ -62,6 +60,12 @@ basepython = python3.9 [testenv:py310] basepython = python3.10 +[testenv:py311] +basepython = python3.11 + +[testenv:py312] +basepython = python3.12 + [flake8] # Black default line length is 88 max-line-length = 88 From be1d3c10cb635f4279c31abee02aca6d1b5cb2af Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Wed, 27 Sep 2023 13:28:00 +0200 Subject: [PATCH 2/3] 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} From 59bf010158040a8d89d3502e6680b6d76dd9036f Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Wed, 27 Sep 2023 13:28:27 +0200 Subject: [PATCH 3/3] fix: comment breaking Jenkins stages --- Jenkinsfile | 90 ++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5d3edad6..5187e6cb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,12 +35,12 @@ pipeline { ToxEnvRun('cover') ToxEnvRun('cobertura') } - post { - success { - HTMLReport('cover', 'index.html', 'coverage.py report') - CoberturaReport('**/coverage.xml') - } - } + // post { + // success { + // HTMLReport('cover', 'index.html', 'coverage.py report') + // CoberturaReport('**/coverage.xml') + // } + // } } stage('Dependency check') { @@ -49,46 +49,46 @@ pipeline { } } - stage('DockerHub delivery') { - when { - anyOf { - branch 'master' - buildingTag() - } - } - agent { - label 'docker-build' - } - steps { - checkout scm - script { - dockerhub_image_id = DockerBuild(dockerhub_repo, - tag: env.BRANCH_NAME) - } - } - post { - success { - DockerPush(dockerhub_image_id) - } - failure { - DockerClean() - } - always { - cleanWs() - } - } - } + // stage('DockerHub delivery') { + // when { + // anyOf { + // branch 'master' + // buildingTag() + // } + // } + // agent { + // label 'docker-build' + // } + // steps { + // checkout scm + // script { + // dockerhub_image_id = DockerBuild(dockerhub_repo, + // tag: env.BRANCH_NAME) + // } + // } + // post { + // success { + // DockerPush(dockerhub_image_id) + // } + // failure { + // DockerClean() + // } + // always { + // cleanWs() + // } + // } + // } - stage('PyPI delivery') { - when { - anyOf { - buildingTag() - } - } - steps { - PyPIDeploy('deepaas', 'indigobot-pypi') - } - } + // stage('PyPI delivery') { + // when { + // anyOf { + // buildingTag() + // } + // } + // steps { + // PyPIDeploy('deepaas', 'indigobot-pypi') + // } + // } } }