Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 54 additions & 31 deletions vars/runJenkinsPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ def call(){
' --tmpfs /.local/bin:exec' +
' --tmpfs /.local/share:exec'
:
"--mount type=volume,source=uv_python_cache_dir,target=C:\\Users\\ContainerUser\\Documents\\uvpython" +
' --mount type=volume,source=uv_cache_dir,target=C:\\Users\\ContainerUser\\Documents\\cache\\uvcache'
"--mount type=volume,source=uv_python_cache_dir,target=C:\\Users\\ContainerUser\\Documents\\uvpython " +
'--mount type=volume,source=uv_cache_dir,target=C:\\Users\\ContainerUser\\Documents\\cache\\uvcache'
){
if(isUnix()){
withEnv([
Expand All @@ -513,12 +513,17 @@ def call(){
'UV_CACHE_DIR=/tmp/uvcache',
"UV_CONFIG_FILE=${createUVConfig()}",
]){
sh(
label: 'Testing with tox',
script: """uv python install cpython-${entry.PYTHON_VERSION}
uv run --only-group=tox-uv --frozen tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
"""
)
sh "uv python install cpython-${entry.PYTHON_VERSION}"
def attempt = 0
retry(2){
attempt += 1
withEnv([(attempt == 1) ? 'UV_OFFLINE=1' : 'UV_OFFLINE=0']){
sh(
label: "Testing with tox: ${(attempt == 1) ? 'Offline' : 'Online'}",
script: "uv run --only-group=tox-uv --frozen tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}"
)
}
}
}
} else {
withEnv([
Expand All @@ -529,14 +534,20 @@ def call(){
"UV_CONFIG_FILE=${createUVConfig()}",
"TOX_UV_PATH=${WORKSPACE}\\venv\\Scripts\\uv.exe",
]){
bat(
label: 'Testing with tox',
script: """python -m venv venv
.\\venv\\Scripts\\pip install --disable-pip-version-check uv
.\\venv\\Scripts\\uv python install cpython-${entry.PYTHON_VERSION}
.\\venv\\Scripts\\uv run --only-group=tox-uv --isolated --frozen tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
"""
)
bat """python -m venv venv
.\\venv\\Scripts\\pip install --disable-pip-version-check uv
.\\venv\\Scripts\\uv python install cpython-${entry.PYTHON_VERSION}
"""
def attempt = 0
retry(2){
attempt += 1
withEnv([(attempt == 1) ? 'UV_OFFLINE=1' : 'UV_OFFLINE=0']){
bat(
label: "Testing with tox: ${(attempt == 1) ? 'Offline' : 'Online'}",
script: ".\\venv\\Scripts\\uv run --only-group=tox-uv --isolated --frozen tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}"
)
}
}
}
}
}
Expand All @@ -546,27 +557,39 @@ def call(){
"UV_CONFIG_FILE=${createUVConfig()}",
"TOX_UV_PATH=${WORKSPACE}/venv/bin/uv",
]){
sh(
label: 'Testing with tox',
script: """python3 -m venv venv
./venv/bin/pip install --disable-pip-version-check uv
./venv/bin/uv run --only-group=tox-uv --isolated --frozen tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
"""
)
sh '''python3 -m venv venv
./venv/bin/pip install --disable-pip-version-check uv
'''
def attempt = 0
retry(2){
attempt += 1
withEnv([(attempt == 1) ? 'UV_OFFLINE=1' : 'UV_OFFLINE=0']){
sh(
label: "Testing with tox: ${(attempt == 1) ? 'Offline' : 'Online'}",
script: "./venv/bin/uv run --only-group=tox-uv --isolated --frozen tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}"
)
}
}
}
} else {
withEnv([
"UV_CONFIG_FILE=${createUVConfig()}",
"TOX_UV_PATH=${WORKSPACE}\\venv\\Scripts\\uv.exe",
]){
bat(
label: 'Testing with tox',
script: """python -m venv venv
.\\venv\\Scripts\\pip install --disable-pip-version-check uv
.\\venv\\Scripts\\uv python install cpython-${entry.PYTHON_VERSION}
.\\venv\\Scripts\\uv run --only-group=tox-uv --isolated --frozen tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
"""
)
bat """python -m venv venv
.\\venv\\Scripts\\pip install --disable-pip-version-check uv
.\\venv\\Scripts\\uv python install cpython-${entry.PYTHON_VERSION}
"""
def attempt = 0
retry(2){
attempt += 1
withEnv([(attempt == 1) ? 'UV_OFFLINE=1' : 'UV_OFFLINE=0']){
bat(
label: "Testing with tox: ${(attempt == 1) ? 'Offline' : 'Online'}",
script: ".\\venv\\Scripts\\uv run --only-group=tox-uv --isolated --frozen tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}"
)
}
}
}
}
}
Expand Down
Loading