From b767d63a293a9c8e157b45236f06fe80bcea0a4d Mon Sep 17 00:00:00 2001 From: calvinmwadime Date: Tue, 1 Aug 2023 11:50:49 +0300 Subject: [PATCH] refactor: remove tox py3X tests --- tools/README.md | 1 - tools/setup_pyenv.sh | 30 -------------- tox.ini | 39 ++----------------- .../tests/constraints/constraints-bionic.txt | 8 ---- .../tests/constraints/constraints-focal.txt | 8 ---- .../tests/constraints/constraints-jammy.txt | 8 ---- .../tests/constraints/constraints-mypy.txt | 5 --- .../tests/constraints/constraints-xenial.txt | 10 ----- 8 files changed, 4 insertions(+), 105 deletions(-) delete mode 100755 tools/setup_pyenv.sh delete mode 100644 uaclient/tests/constraints/constraints-bionic.txt delete mode 100644 uaclient/tests/constraints/constraints-focal.txt delete mode 100644 uaclient/tests/constraints/constraints-jammy.txt delete mode 100644 uaclient/tests/constraints/constraints-mypy.txt delete mode 100644 uaclient/tests/constraints/constraints-xenial.txt diff --git a/tools/README.md b/tools/README.md index 088351c70f..f4e028b62f 100644 --- a/tools/README.md +++ b/tools/README.md @@ -12,7 +12,6 @@ in this directory will be shipped as part of the packaging - README.md: This file. - refresh-keyrings.sh: Refresh the keyring files for services, stored in the repo - run-integration-tests.py: Python entrypoint for the `tox -e behave` commands. -- setup_pyenv.sh: Downloads and compiles all Python versions we should support, and configures `pyenv` to use those. - setup_sbuild.sh: Downloads and prepares chroots used in the build (and test) process. - test-in-lxd.sh: Build the package and then install it on an LXD instance for testing - test-in-multipass.sh: Build the package and then install it on a multipass instance for testing diff --git a/tools/setup_pyenv.sh b/tools/setup_pyenv.sh deleted file mode 100755 index 65de5c0632..0000000000 --- a/tools/setup_pyenv.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -set -e - -sudo apt-get update -sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \ -libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils \ -tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev clang - -curl http://pyenv.run | bash - -export PYENV_ROOT="$HOME/.pyenv" -command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init -)" -eval "$(pyenv virtualenv-init -)" - -# gcc will segfault while compiling some python versions -export CC=clang - -pyenv install 3.10.4 -pyenv install 3.8.10 -pyenv install 3.6.9 -# Xenial has 3.5.2, which requires old libssl and is not worth it for the tests -pyenv install 3.5.3 - -pyenv local 3.10.4 3.8.10 3.6.9 3.5.3 - -python -m pip install tox -python -m pip install tox-setuptools-version -python -m pip install tox-pyenv diff --git a/tox.ini b/tox.ini index c1f46b6ca3..fc7d267c35 100644 --- a/tox.ini +++ b/tox.ini @@ -1,41 +1,12 @@ [tox] -envlist = {py35, py36, py38, py310}-{test, flake8}, mypy, black, isort, shellcheck - -[testenv:py35-flake8] -setuptools_version = 20.7.0 - -[testenv:py35-test] -setuptools_version = 20.7.0 - -[testenv:py36-flake8] -setuptools_version = 39.0.1 - -[testenv:py36-test] -setuptools_version = 39.0.1 - -[testenv:py38-flake8] -setuptools_version = 45.2.0 - -[testenv:py38-test] -setuptools_version = 45.2.0 - -[testenv:py310-flake8] -setuptools_version = 59.6.0 - -[testenv:py310-test] -setuptools_version = 59.6.0 +envlist = test, flake8, mypy, black, isort, shellcheck [testenv] allowlist_externals=/usr/bin/bash deps = - -rrequirements.txt - -rtest-requirements.txt - py35: -cuaclient/tests/constraints/constraints-xenial.txt - py36: -cuaclient/tests/constraints/constraints-bionic.txt - py38: -cuaclient/tests/constraints/constraints-focal.txt - py310: -cuaclient/tests/constraints/constraints-jammy.txt + test,mypy,flake8: -rrequirements.txt + test,mypy,flake8: -rtest-requirements.txt mypy: -rtypes-requirements.txt - mypy: -cuaclient/tests/constraints/constraints-mypy.txt black: -rdev-requirements.txt isort: -rdev-requirements.txt behave: -rintegration-requirements.txt @@ -61,9 +32,7 @@ setenv = commands = test: py.test --junitxml=pytest_results.xml {posargs:--cov uaclient uaclient} flake8: flake8 uaclient lib setup.py features - mypy: mypy --python-version 3.6 uaclient/ features/ lib/ - mypy: mypy --python-version 3.8 uaclient/ features/ lib/ - mypy: mypy --python-version 3.10 uaclient/ features/ lib/ + mypy: mypy uaclient/ features/ lib/ black: black --check --diff uaclient/ features/ lib/ setup.py isort: isort --check --diff uaclient/ features/ lib/ setup.py shellcheck: bash -O extglob -O nullglob -c "shellcheck -S warning tools/*.sh debian/*.{config,postinst,postrm,prerm} lib/*.sh sru/*.sh update-motd.d/*" diff --git a/uaclient/tests/constraints/constraints-bionic.txt b/uaclient/tests/constraints/constraints-bionic.txt deleted file mode 100644 index d1ee82c89e..0000000000 --- a/uaclient/tests/constraints/constraints-bionic.txt +++ /dev/null @@ -1,8 +0,0 @@ -attrs==17.4 -flake8==3.5.0 -py==1.5.2 -pycodestyle==2.3.1 -pyflakes==1.6.0 -pytest==3.3.2 -pytest-cov==2.5.1 -pyyaml==3.12 diff --git a/uaclient/tests/constraints/constraints-focal.txt b/uaclient/tests/constraints/constraints-focal.txt deleted file mode 100644 index 457fb9a963..0000000000 --- a/uaclient/tests/constraints/constraints-focal.txt +++ /dev/null @@ -1,8 +0,0 @@ -attrs==19.3 -flake8==3.7.9 -py==1.8.1 -pycodestyle==2.5.0 -pyflakes==2.1.1 -pytest==4.6.9 -pytest-cov==2.8.1 -pyyaml==5.3.1 \ No newline at end of file diff --git a/uaclient/tests/constraints/constraints-jammy.txt b/uaclient/tests/constraints/constraints-jammy.txt deleted file mode 100644 index 254e2bb52e..0000000000 --- a/uaclient/tests/constraints/constraints-jammy.txt +++ /dev/null @@ -1,8 +0,0 @@ -attrs==21.2 -flake8==4.0.1 -py==1.10 -pycodestyle==2.8.0 -pyflakes==2.4.0 -pytest==6.2.5 -pytest-cov==3.0.0 -pyyaml==5.4.1 diff --git a/uaclient/tests/constraints/constraints-mypy.txt b/uaclient/tests/constraints/constraints-mypy.txt deleted file mode 100644 index 0d6a3d9379..0000000000 --- a/uaclient/tests/constraints/constraints-mypy.txt +++ /dev/null @@ -1,5 +0,0 @@ -mypy -pyparsing==3.0.7 -pytest==6.1.2 -importlib-metadata==3.3.0 -packaging==20.9 diff --git a/uaclient/tests/constraints/constraints-xenial.txt b/uaclient/tests/constraints/constraints-xenial.txt deleted file mode 100644 index c036f022d0..0000000000 --- a/uaclient/tests/constraints/constraints-xenial.txt +++ /dev/null @@ -1,10 +0,0 @@ -attrs==15.2 -flake8==2.5.4 -pep8==1.7.0 -py==1.4.31 -# Xenial ships pyflakes 1.1.0, but there is a dependency mismatch between the -# deb and the pip versions of flake8==2.5.4, which requires pyflakes. -pyflakes==1.0.0 -pytest==2.8.7 -pytest-cov==2.2.1 -pyyaml==3.11