Skip to content

Commit 4e16cb2

Browse files
committed
ci: use tox-uv-bare to pin tox-uv version
1 parent 99432b4 commit 4e16cb2

4 files changed

Lines changed: 221 additions & 166 deletions

File tree

Jenkinsfile

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,17 @@ def mac_wheels(pythonVersions, testPackages, params, wheelStashes){
103103
retries: 3,
104104
testCommand: {
105105
findFiles(glob: 'dist/*.whl').each{
106-
sh(label: 'Running Tox',
107-
script: """python${pythonVersion} -m venv venv
108-
. ./venv/bin/activate
109-
trap "rm -rf venv" EXIT
110-
python -m pip install --disable-pip-version-check uv
111-
trap "rm -rf venv && rm -rf .tox" EXIT
112-
venv/bin/uv run --only-group tox --with tox-uv tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}
113-
"""
114-
)
106+
withEnv(["TOX_UV_PATH=${WORKSPACE}/venv/bin/uv"]){
107+
sh(label: 'Running Tox',
108+
script: """python${pythonVersion} -m venv venv
109+
. ./venv/bin/activate
110+
trap "rm -rf venv" EXIT
111+
python -m pip install --disable-pip-version-check uv
112+
trap "rm -rf venv && rm -rf .tox" EXIT
113+
venv/bin/uv run --only-group=tox-uv tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}
114+
"""
115+
)
116+
}
115117
}
116118
},
117119
post:[
@@ -189,14 +191,16 @@ def mac_wheels(pythonVersions, testPackages, params, wheelStashes){
189191
retries: 3,
190192
testCommand: {
191193
findFiles(glob: 'dist/*.whl').each{
192-
sh(label: 'Running Tox',
193-
script: """python${pythonVersion} -m venv venv
194-
trap "rm -rf venv" EXIT
195-
./venv/bin/python -m pip install --disable-pip-version-check uv
196-
trap "rm -rf venv && rm -rf .tox" EXIT
197-
venv/bin/uv run --only-group tox --with tox-uv tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}
198-
"""
199-
)
194+
withEnv(["TOX_UV_PATH=${WORKSPACE}/venv/bin/uv"]){
195+
sh(label: 'Running Tox',
196+
script: """python${pythonVersion} -m venv venv
197+
trap "rm -rf venv" EXIT
198+
./venv/bin/python -m pip install --disable-pip-version-check uv
199+
trap "rm -rf venv && rm -rf .tox" EXIT
200+
venv/bin/uv run --only-group=tox-uv tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}
201+
"""
202+
)
203+
}
200204
}
201205
},
202206
post:[
@@ -273,7 +277,7 @@ def windows_wheels(pythonVersions, testPackages, params, wheelStashes, sharedPip
273277
unstash "python${pythonVersion} windows wheel"
274278
findFiles(glob: 'dist/*.whl').each{
275279
bat """python -m pip install --disable-pip-version-check uv
276-
uv run --only-group tox --with tox-uv tox run -e py${pythonVersion.replace('.', '')} --installpkg ${it.path}
280+
uv run --only-group=tox-uv tox run -e py${pythonVersion.replace('.', '')} --installpkg ${it.path}
277281
rmdir /s /q .tox
278282
rmdir /s /q dist
279283
"""
@@ -352,13 +356,11 @@ def linux_wheels(pythonVersions, testPackages, params, wheelStashes, sharedPipCa
352356
'UV_TOOL_DIR=/tmp/uvtools',
353357
'UV_PYTHON_CACHE_DIR=/tmp/uvpython',
354358
'UV_CACHE_DIR=/tmp/uvcache',
355-
"TOX_INSTALL_PKG=${findFiles(glob:'dist/*.whl')[0].path}",
356-
"TOX_ENV=py${pythonVersion.replace('.', '')}"
357359
]){
358-
docker.image('ghcr.io/astral-sh/uv:debian').inside{
360+
docker.image('ghcr.io/astral-sh/uv:debian').inside('--tmpfs /.local/share:exec'){
359361
sh(
360362
label: 'Testing with tox',
361-
script: 'uv run --only-group=tox tox'
363+
script: "uv run --python=${pythonVersion} --only-group=tox-uv tox run -e py${pythonVersion.replace('.', '')} --installpkg ${findFiles(glob:'dist/*.whl')[0].path}"
362364
)
363365
}
364366
}
@@ -859,7 +861,7 @@ pipeline {
859861
image.inside{
860862
try{
861863
sh( label: 'Running Tox',
862-
script: "uv run --only-group tox --with tox-uv tox run -e ${toxEnv} --runner uv-venv-lock-runner -vv"
864+
script: "uv run --only-group=tox-uv tox run -e ${toxEnv} --runner uv-venv-lock-runner -vv"
863865
)
864866
} catch(e) {
865867
sh(script: './venv/bin/uv python list')
@@ -932,7 +934,7 @@ pipeline {
932934
image.inside("--mount source=${SHARED_PIP_CACHE_VOLUME_NAME},target=${env:PIP_CACHE_DIR} --mount source=uv_python_cache_dir,target=${env.UV_PYTHON_CACHE_DIR}"){
933935
powershell(label: 'Running Tox',
934936
script: """uv python install cpython-${version}
935-
uv run --only-group tox --with tox-uv tox run -e ${toxEnv} --runner uv-venv-lock-runner -vv
937+
uv run --only-group=tox-uv tox run -e ${toxEnv} --runner uv-venv-lock-runner -vv
936938
"""
937939
)
938940
}
@@ -1057,14 +1059,16 @@ pipeline {
10571059
},
10581060
testCommand: {
10591061
findFiles(glob: 'dist/*.tar.gz').each{
1060-
sh(label: 'Running Tox',
1061-
script: """python${pythonVersion} -m venv venv
1062-
venv/bin/python -m pip install --disable-pip-version-check uv
1063-
CONAN_REVISIONS_ENABLED=1 venv/bin/uv run --only-group tox --with tox-uv tox run --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}
1064-
rm -rf ./.tox
1065-
rm -rf ./venv
1066-
"""
1067-
)
1062+
withEnv(["TOX_UV_PATH=${WORKSPACE}/venv/bin/uv"]){
1063+
sh(label: 'Running Tox',
1064+
script: """python${pythonVersion} -m venv venv
1065+
venv/bin/python -m pip install --disable-pip-version-check uv
1066+
CONAN_REVISIONS_ENABLED=1 venv/bin/uv run --only-group=tox-uv tox run --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}
1067+
rm -rf ./.tox
1068+
rm -rf ./venv
1069+
"""
1070+
)
1071+
}
10681072
}
10691073
},
10701074
post:[
@@ -1108,7 +1112,7 @@ pipeline {
11081112
findFiles(glob: 'dist/*.tar.gz').each{
11091113
powershell(
11101114
label: 'Running Tox',
1111-
script: "uv run --only-group tox --with tox-uv tox run --workdir \${Env.TEMP}\\.tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')} -vv"
1115+
script: "uv run --python=${pythonVersion} --only-group=tox-uv tox run --workdir \${Env.TEMP}\\.tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')} -vv"
11121116
)
11131117
}
11141118
}
@@ -1169,12 +1173,8 @@ pipeline {
11691173
findFiles(glob: 'dist/*.tar.gz').each{
11701174
sh(
11711175
label: 'Running Tox',
1172-
script: """python3 -m venv venv
1173-
trap "rm -rf venv" EXIT
1174-
venv/bin/pip install --disable-pip-version-check uv
1175-
trap "rm -rf venv && rm -rf .tox" EXIT
1176-
venv/bin/uv run --only-group tox --with tox-uv tox run --installpkg ${it.path} --workdir ./.tox -e py${pythonVersion.replace('.', '')}"""
1177-
)
1176+
script: "uv run --only-group=tox-uv tox run --installpkg ${it.path} --workdir ./.tox -e py${pythonVersion.replace('.', '')}"
1177+
)
11781178
}
11791179
}
11801180
},

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ lint = [
5252
"pydocstyle"
5353
]
5454
tox = ["tox"]
55-
test = ["coverage[toml]", "gcovr", "pytest"]
55+
tox-uv = [
56+
{include-group = "tox"},
57+
"tox-uv-bare"
58+
]
59+
test = ["coverage[toml]", "gcovr;os_name!= 'nt'", "pytest"]
5660
conan = ["conan>=2.0", "cmake<4.0"]
5761
dev = [
5862
{include-group = "conan"},

scripts/build_windows.ps1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ function Build-DockerImage {
2121
"--build-arg CHOCOLATEY_SOURCE",
2222
"--build-arg UV_INDEX_URL",
2323
"--build-arg UV_EXTRA_INDEX_URL",
24-
"--build-arg PIP_EXTRA_INDEX_URL",
25-
"--build-arg PIP_INDEX_URL",
2624
"--build-arg CONAN_CENTER_PROXY_V2_URL",
2725
"--build-arg UV_CACHE_DIR=c:/users/containeradministrator/appdata/local/uv",
2826
"-t", $ImageName,
@@ -57,7 +55,7 @@ function Build-Wheel {
5755
$venv = "${containerCacheDir}\venv"
5856

5957
$UV_TOOL_DIR = "${containerCacheDir}\uvtools"
60-
$UV_PYTHON_INSTALL_DIR = "${containerCacheDir}\uvpython"
58+
$UV_PYTHON_CACHE_DIR = "${containerCacheDir}\uvpython"
6159

6260
# This makes a symlink copy of the files mounted in the source. Any changes to the files will not affect outside the container
6361
$createShallowCopy = "foreach (`$item in `$(Get-ChildItem -Path $containerSourcePath)) { `
@@ -76,7 +74,7 @@ function Build-Wheel {
7674
"--mount type=bind,source=$(Resolve-Path $projectRootDirectory),target=${containerSourcePath}",
7775
"--mount type=bind,source=$(Resolve-Path $outputDirectory),target=${containerDistPath}",
7876
"-e UV_TOOL_DIR=${UV_TOOL_DIR}",
79-
"-e UV_PYTHON_INSTALL_DIR=${UV_PYTHON_INSTALL_DIR}",
77+
"-e UV_PYTHON_CACHE_DIR=${UV_PYTHON_CACHE_DIR}",
8078
'--entrypoint', 'powershell',
8179
$DockerImageName
8280
"-c",

0 commit comments

Comments
 (0)