@@ -62,10 +62,29 @@ jobs:
6262 done
6363 exit 1
6464 shell : bash
65- - name : Setup python for tox
66- uses : actions/setup-python@v5
65+ - uses : actions/checkout@v4
66+ with :
67+ fetch-depth : 0
68+ - name : Install the latest version of uv
69+ uses : astral-sh/setup-uv@v3
6770 with :
68- python-version : " 3.12"
71+ enable-cache : true
72+ cache-dependency-glob : " pyproject.toml"
73+ github-token : ${{ secrets.GITHUB_TOKEN }}
74+ - name : Add .local/bin to PATH Windows
75+ if : runner.os == 'Windows'
76+ shell : bash
77+ run : echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
78+ - name : Add .local/bin to PATH macos-13
79+ if : matrix.os == 'macos-13'
80+ shell : bash
81+ run : echo ~/.local/bin >> $GITHUB_PATH
82+ - name : Install tox
83+ if : matrix.py == '3.13'
84+ run : uv tool install --python-preference only-managed --python 3.12 tox --with tox-uv
85+ - name : Install tox
86+ if : matrix.py != '3.13'
87+ run : uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
6988 - name : Setup brew python for test ${{ matrix.py }}
7089 if : startsWith(matrix.py,'brew@')
7190 run : |
@@ -74,37 +93,18 @@ jobs:
7493 brew cleanup && brew upgrade python@$PY || brew install python@$PY
7594 echo "/usr/local/opt/python@$PY/libexec/bin" >>"${GITHUB_PATH}"
7695 shell : bash
77- - name : Install tox-uv
78- run : python -m pip install tox-uv pip -U
79- if :
" !(startsWith(matrix.py,'pypy') || matrix.py == '3.7' || matrix.py == '[email protected] ' || matrix.py == '[email protected] ')" 80- - name : Install tox
81- run : python -m pip install tox pip -U
82- if :
" (startsWith(matrix.py,'pypy') || matrix.py == '3.7' || matrix.py == '[email protected] ' || matrix.py == '[email protected] ')" 83- - uses : actions/checkout@v4
84- with :
85- fetch-depth : 0
86- - name : Use local virtualenv for tox
87- run : python -m pip install .
8896 - name : Setup python for test ${{ matrix.py }}
8997 if : " !( startsWith(matrix.py,'brew@') || endsWith(matrix.py, '-dev') )"
9098 uses : actions/setup-python@v5
9199 with :
92100 python-version : ${{ matrix.py }}
93101 allow-prereleases : true
94102 - name : Pick environment to run
95- run : |
96- import os; import platform; import sys; from pathlib import Path
97- plat = platform.python_implementation()
98- e = f"3.{sys.version_info.minor}" if plat == "CPython" else f"pypy3{sys.version_info.minor}"
99- env = f"TOXENV={e}"
100- print(f"Picked: {env} for {sys.version} based of {sys.executable}")
101- with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler:
102- file_handler.write(env)
103- shell : python
103+ run : python tasks/pick_tox_env.py ${{ matrix.py }}
104104 - name : Setup test suite
105- run : tox -vv --notest --skip-missing-interpreters false
105+ run : tox run -vv --notest --skip-missing-interpreters false
106106 - name : Run test suite
107- run : tox --skip-pkg-install
107+ run : tox run --skip-pkg-install
108108 timeout-minutes : 20
109109 env :
110110 PYTEST_ADDOPTS : " -vv --durations=20"
@@ -134,15 +134,19 @@ jobs:
134134 - uses : actions/checkout@v4
135135 with :
136136 fetch-depth : 0
137- - name : Setup Python "3.12"
138- uses : actions /setup-python@v5
137+ - name : Install the latest version of uv
138+ uses : astral-sh /setup-uv@v3
139139 with :
140- python-version : " 3.12"
140+ enable-cache : true
141+ cache-dependency-glob : " pyproject.toml"
142+ github-token : ${{ secrets.GITHUB_TOKEN }}
143+ - name : Add .local/bin to Windows PATH
144+ if : runner.os == 'Windows'
145+ shell : bash
146+ run : echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
141147 - name : Install tox
142- run : python -m pip install tox-uv
143- - name : Setup check
144- run : python -m tox --skip-missing-interpreters false -e ${{ matrix.tox_env }} --notest
148+ run : uv tool install -- python-preference only-managed --python 3.13 tox --with tox-uv
149+ - name : Setup check suite
150+ run : tox r -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
145151 - name : Run check for ${{ matrix.tox_env }}
146- run : python -m tox --skip-pkg-install -e ${{ matrix.tox_env }}
147- env :
148- UPGRADE_ADVISORY : " yes"
152+ run : tox r --skip-pkg-install -e ${{ matrix.tox_env }}
0 commit comments