Skip to content

Commit 3fd0e5d

Browse files
committed
ci: Run tox in a fixed python version
Tox doesn't need to be the same python version as the one being tested. This works around Tox's current incompatibility with Python 3.14b1. It will probably be reverted after that is fixed so we no longer need to install two versions of python. See tox-dev/tox#3523
1 parent a838977 commit 3fd0e5d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,21 @@ jobs:
7474
- uses: actions/setup-python@v5
7575
name: Install Python
7676
with:
77-
python-version: ${{ matrix.python}}
77+
# In addition to the python version under test, install one known version
78+
# so we can run tox with it. This lets us avoid issues when we're testing
79+
# an alpha or beta version of python that is not yet compatible with tox.
80+
# TODO: do something about all of this repeated usage of python 3.11 (same
81+
# the docs/lint job in tox.ini).
82+
python-version: |
83+
3.11
84+
${{ matrix.python}}
7885
- name: Install apt packages
7986
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev
8087
- name: Install tox
81-
run: python -m pip install tox -c requirements.txt
88+
run: python3.11 -m pip install tox -c requirements.txt
8289

8390
- name: Run test suite
84-
run: python -m tox -e ${{ matrix.tox_env }}
91+
run: tox -e ${{ matrix.tox_env }}
8592

8693
test_win:
8794
# Windows tests are fairly slow, so only run one configuration here.

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ allowlist_externals = sh, env
6565

6666
# Tox filters line-by-line based on the environment name.
6767
commands =
68+
python --version
6869
# py3*: -b turns on an extra warning when calling
6970
# str(bytes), and -bb makes it an error.
7071
python -bb -m tornado.test {posargs:}

0 commit comments

Comments
 (0)