From 74239cac5d975b5b805cbeba395dbc7a92882066 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Feb 07 2020 17:39:54 +0000 Subject: [PATCH 1/2] Assert that tox uses the appropriate Python version --- diff --git a/smoke/venv.sh b/smoke/venv.sh index 6744a3a..725c948 100755 --- a/smoke/venv.sh +++ b/smoke/venv.sh @@ -86,6 +86,23 @@ set -u # use it with tox [[ "$TOX" != "true" ]] && exit 0 +if [[ $PYTHON == python* ]]; then + export TOXENV=py${VERSION/./} +else + export TOXENV=$PYTHON +fi + +cat > tox.ini << EOF +[tox] +skipsdist = True +[testenv] +commands = python -c 'import sys; print(sys.version)' +EOF + +# Tests that the Python version used in tox is really the Python version we want +tox | tee toxlog +grep "^$VERSION\.[0-9]" toxlog + cat > tox.ini << EOF [tox] skipsdist = True @@ -94,8 +111,5 @@ deps = pytest commands = python -m pytest -v test_foo.py EOF -if [[ $PYTHON == python* ]]; then - tox -e py${VERSION/./} -else - tox -e $PYTHON -fi +# A more complex example with pytest +tox From 38d9a441ce730c296880558e17960492e450b8b6 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Feb 07 2020 17:39:54 +0000 Subject: [PATCH 2/2] Test with Python 3.9 as well --- diff --git a/tests.yml b/tests.yml index c55eca8..e308377 100644 --- a/tests.yml +++ b/tests.yml @@ -28,6 +28,9 @@ - smoke38: dir: smoke run: VERSION=3.8 METHOD=venv ./venv.sh + - smoke39: + dir: smoke + run: VERSION=3.9 METHOD=venv ./venv.sh - smokepypy: dir: smoke run: VERSION=2.7 METHOD=virtualenv PYTHON=pypy ./venv.sh @@ -51,6 +54,7 @@ - python36 - python37 - python38 + - python39 - pypy - pypy3 - python2-devel