@@ -62,10 +62,29 @@ jobs:
62
62
done
63
63
exit 1
64
64
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
67
70
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
69
88
- name : Setup brew python for test ${{ matrix.py }}
70
89
if : startsWith(matrix.py,'brew@')
71
90
run : |
@@ -74,37 +93,18 @@ jobs:
74
93
brew cleanup && brew upgrade python@$PY || brew install python@$PY
75
94
echo "/usr/local/opt/python@$PY/libexec/bin" >>"${GITHUB_PATH}"
76
95
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 .
88
96
- name : Setup python for test ${{ matrix.py }}
89
97
if : " !( startsWith(matrix.py,'brew@') || endsWith(matrix.py, '-dev') )"
90
98
uses : actions/setup-python@v5
91
99
with :
92
100
python-version : ${{ matrix.py }}
93
101
allow-prereleases : true
94
102
- 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 }}
104
104
- name : Setup test suite
105
- run : tox -vv --notest --skip-missing-interpreters false
105
+ run : tox run -vv --notest --skip-missing-interpreters false
106
106
- name : Run test suite
107
- run : tox --skip-pkg-install
107
+ run : tox run --skip-pkg-install
108
108
timeout-minutes : 20
109
109
env :
110
110
PYTEST_ADDOPTS : " -vv --durations=20"
@@ -134,15 +134,19 @@ jobs:
134
134
- uses : actions/checkout@v4
135
135
with :
136
136
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
139
139
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
141
147
- 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 }}
145
151
- 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