mirror of
https://github.com/ceph/ceph
synced 2025-04-07 01:54:01 +00:00
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 <kchai@redhat.com>
This commit is contained in:
parent
5ae7b9202b
commit
3c40db975c
@ -1124,7 +1124,7 @@ Unit tests based on tox
|
|||||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
We included a ``tox`` configuration file that will run the unit tests under
|
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
|
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
|
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
|
To run the tests, run ``src/script/run_tox.sh`` in the dashboard directory (where
|
||||||
``tox.ini`` is located)::
|
``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:
|
## Run Python 3 tests+lint commands:
|
||||||
$ ../../../script/run_tox.sh --tox-env py3,lint,check
|
$ ../../../script/run_tox.sh --tox-env py3,lint,check
|
||||||
|
|
||||||
|
@ -145,7 +145,6 @@ environments and run options::
|
|||||||
$ tox -e py3,lint,check
|
$ tox -e py3,lint,check
|
||||||
|
|
||||||
## To run it as Jenkins would:
|
## 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
|
$ ../../../script/run_tox.sh --tox-env py3,lint,check
|
||||||
|
|
||||||
Manager core unit tests
|
Manager core unit tests
|
||||||
|
@ -25,13 +25,13 @@ options:
|
|||||||
|
|
||||||
example:
|
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
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,17 +116,7 @@ function main() {
|
|||||||
echo "$PWD already exists, but it's not a virtualenv. test_name empty?"
|
echo "$PWD already exists, but it's not a virtualenv. test_name empty?"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# try to use the prefered python for creating the virtual env for
|
$source_dir/src/tools/setup-virtualenv.sh ${venv_path}
|
||||||
# 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}
|
|
||||||
fi
|
fi
|
||||||
source ${venv_path}/bin/activate
|
source ${venv_path}/bin/activate
|
||||||
pip install tox
|
pip install tox
|
||||||
|
Loading…
Reference in New Issue
Block a user