From 3c40db975cbf0dc6af02e64ecaf8048fe088877c Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 31 Jul 2021 20:44:57 +0800 Subject: [PATCH] script/run_tox.sh: drop support of python2 since we don't support python2 anymore, there is not need to mention or support python2 when performing tests Signed-off-by: Kefu Chai --- doc/dev/developer_guide/dash-devel.rst | 5 +---- doc/dev/developer_guide/tests-unit-tests.rst | 1 - src/script/run_tox.sh | 20 +++++--------------- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/doc/dev/developer_guide/dash-devel.rst b/doc/dev/developer_guide/dash-devel.rst index 5c616ade37c9..3e33566d4d47 100644 --- a/doc/dev/developer_guide/dash-devel.rst +++ b/doc/dev/developer_guide/dash-devel.rst @@ -1124,7 +1124,7 @@ Unit tests based on tox ~~~~~~~~~~~~~~~~~~~~~~~~ We included a ``tox`` configuration file that will run the unit tests under -Python 2 or 3, as well as linting tools to guarantee the uniformity of code. +Python 3, as well as linting tools to guarantee the uniformity of code. You need to install ``tox`` and ``coverage`` before running it. To install the packages in your system, either install it via your operating system's package @@ -1139,9 +1139,6 @@ Alternatively, you can use Python's native package installation method:: To run the tests, run ``src/script/run_tox.sh`` in the dashboard directory (where ``tox.ini`` is located):: - ## Run Python 2+3 tests+lint commands: - $ ../../../script/run_tox.sh --tox-env py27,py3,lint,check - ## Run Python 3 tests+lint commands: $ ../../../script/run_tox.sh --tox-env py3,lint,check diff --git a/doc/dev/developer_guide/tests-unit-tests.rst b/doc/dev/developer_guide/tests-unit-tests.rst index de9d6de6fcd1..21db9bf9f4cb 100644 --- a/doc/dev/developer_guide/tests-unit-tests.rst +++ b/doc/dev/developer_guide/tests-unit-tests.rst @@ -145,7 +145,6 @@ environments and run options:: $ tox -e py3,lint,check ## To run it as Jenkins would: - $ ../../../script/run_tox.sh --tox-env py27,py3,lint,check $ ../../../script/run_tox.sh --tox-env py3,lint,check Manager core unit tests diff --git a/src/script/run_tox.sh b/src/script/run_tox.sh index 2dab5f1d9873..9d45d8b9246c 100755 --- a/src/script/run_tox.sh +++ b/src/script/run_tox.sh @@ -25,13 +25,13 @@ options: example: -following command will run tox with envlist of "py27,py3" using the "tox.ini" in current directory. +following command will run tox with envlist of "py3,mypy" using the "tox.ini" in current directory. - $prog_name --tox-envs py27,py3 + $prog_name --tox-envs py3,mypy -following command will run tox with envlist of "py27" using "/ceph/src/python-common/tox.ini" +following command will run tox with envlist of "py3" using "/ceph/src/python-common/tox.ini" - $prog_name --tox-envs py27 --tox-path /ceph/src/python-common + $prog_name --tox-envs py3 --tox-path /ceph/src/python-common EOF } @@ -116,17 +116,7 @@ function main() { echo "$PWD already exists, but it's not a virtualenv. test_name empty?" exit 1 fi - # try to use the prefered python for creating the virtual env for - # bootstrapping tox. - case $tox_envs in - py3*) - virtualenv_python=python3;; - py2*) - virtualenv_python=python2;; - *) - virtualenv_python=python3;; - esac - $source_dir/src/tools/setup-virtualenv.sh --python=${virtualenv_python} ${venv_path} + $source_dir/src/tools/setup-virtualenv.sh ${venv_path} fi source ${venv_path}/bin/activate pip install tox -- 2.47.3