Skip to content

Commit 92884e6

Browse files
Merge pull request #43 from UIUCLibrary/update-deps
Update deps
2 parents 11c1034 + fd0a4df commit 92884e6

4 files changed

Lines changed: 170 additions & 557 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ repos:
1111
- pre-push
1212
repo: https://github.com/commitizen-tools/commitizen
1313
rev: v4.5.0
14-
- repo: https://github.com/owenlamont/uv-secure
15-
rev: 0.13.0
14+
- repo: https://github.com/astral-sh/uv-pre-commit
15+
# uv version.
16+
rev: 0.11.8
1617
hooks:
17-
- id: uv-secure
18+
- id: uv-audit

Jenkinsfile

Lines changed: 68 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pipeline {
128128
docker{
129129
image 'ghcr.io/astral-sh/uv:debian'
130130
label 'docker && linux && x86_64'
131-
args '--mount source=tripwire_cache,target=/tmp --tmpfs /.config:exec --tmpfs /.tree-sitter:exec'
131+
args "--label=purpose=ci --label \"JOB_NAME=\$JOB_NAME\" --label \"absoluteUrl=${currentBuild.absoluteUrl}\" --label \"BUILD_NUMBER=${currentBuild.number}\" --mount source=tripwire_cache,target=/tmp --tmpfs /.config:exec --tmpfs /.tree-sitter:exec"
132132
}
133133

134134
}
@@ -183,8 +183,8 @@ pipeline {
183183
timeout(5)
184184
}
185185
steps{
186-
catchError(buildResult: 'UNSTABLE', message: 'uv-secure found issues', stageResult: 'UNSTABLE') {
187-
sh 'uv run uv-secure --disable-cache uv.lock'
186+
catchError(buildResult: 'UNSTABLE', message: 'uv audit found issues', stageResult: 'UNSTABLE') {
187+
sh 'uv audit'
188188
}
189189
}
190190
}
@@ -360,7 +360,7 @@ pipeline {
360360
docker {
361361
image 'ghcr.io/astral-sh/uv:debian'
362362
label 'docker && linux'
363-
args '--mount source=tripwire_cache,target=/tmp'
363+
args "--label=purpose=ci --label \"JOB_NAME=\$JOB_NAME\" --label \"absoluteUrl=${currentBuild.absoluteUrl}\" --label \"BUILD_NUMBER=${currentBuild.number}\" --mount source=tripwire_cache,target=/tmp"
364364
}
365365
}
366366
steps{
@@ -440,12 +440,14 @@ pipeline {
440440
unstash 'PYTHON_PACKAGES'
441441
if(['linux', 'windows'].contains(entry.OS) && params.containsKey("INCLUDE_${entry.OS}-${entry.ARCHITECTURE}".toUpperCase()) && params["INCLUDE_${entry.OS}-${entry.ARCHITECTURE}".toUpperCase()]){
442442
docker.image(isUnix() ? 'ghcr.io/astral-sh/uv:debian' :'python')
443-
.inside(
444-
isUnix() ?
445-
'--mount source=tripwire_cache,target=/tmp --tmpfs /.local/share:exec --tmpfs /.local/bin:exec' :
446-
"--mount type=volume,source=uv_python_cache_dir,target=C:\\Users\\ContainerUser\\Documents\\cache\\uvpython \
447-
--mount type=volume,source=pipcache,target=C:\\Users\\ContainerUser\\Documents\\cache\\pipcache \
448-
--mount type=volume,source=uv_cache_dir,target=C:\\Users\\ContainerUser\\Documents\\cache\\uvcache"
443+
.inside("--label=purpose=ci --label \"JOB_NAME=\$JOB_NAME\" --label \"absoluteUrl=${currentBuild.absoluteUrl}\" --label \"BUILD_NUMBER=${currentBuild.number}\" " +
444+
(
445+
isUnix() ?
446+
'--mount source=tripwire_cache,target=/tmp --tmpfs /.local/share:exec --tmpfs /.local/bin:exec'
447+
:
448+
"--mount type=volume,source=uv_python_cache_dir,target=C:\\Users\\ContainerUser\\Documents\\cache\\uvpython \
449+
--mount type=volume,source=pipcache,target=C:\\Users\\ContainerUser\\Documents\\cache\\pipcache \
450+
--mount type=volume,source=uv_cache_dir,target=C:\\Users\\ContainerUser\\Documents\\cache\\uvcache")
449451
){
450452
if(isUnix()){
451453
withEnv([
@@ -454,12 +456,17 @@ pipeline {
454456
'UV_PYTHON_CACHE_DIR=/tmp/uvpython',
455457
'UV_CACHE_DIR=/tmp/uvcache',
456458
]){
457-
sh(
458-
label: 'Testing with tox',
459-
script: """uv python install cpython-${entry.PYTHON_VERSION}
460-
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('.', '')}
461-
"""
462-
)
459+
sh "uv python install cpython-${entry.PYTHON_VERSION}"
460+
def attempt = 0
461+
retry(2){
462+
attempt += 1
463+
withEnv([(attempt == 1) ? 'UV_OFFLINE=1' : 'UV_OFFLINE=0']){
464+
sh(
465+
label: "Testing with tox: ${(attempt == 1) ? 'Offline' : 'Online'}",
466+
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('.', '')}"
467+
)
468+
}
469+
}
463470
}
464471
} else {
465472
withEnv([
@@ -469,38 +476,57 @@ pipeline {
469476
'UV_CACHE_DIR=C:\\Users\\ContainerUser\\Documents\\cache\\uvcache',
470477
"TOX_UV_PATH=${env.WORKSPACE}\\venv\\Scripts\\uv.exe",
471478
]){
472-
powershell(
473-
label: 'Testing with tox',
474-
script: """python -m venv venv
475-
.\\venv\\Scripts\\pip install --disable-pip-version-check uv
476-
.\\venv\\Scripts\\uv python install cpython-${entry.PYTHON_VERSION}
477-
.\\venv\\Scripts\\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('.', '')}
478-
"""
479-
)
479+
bat """python -m venv venv
480+
.\\venv\\Scripts\\pip install --disable-pip-version-check uv
481+
.\\venv\\Scripts\\uv python install cpython-${entry.PYTHON_VERSION}
482+
"""
483+
def attempt = 0
484+
retry(2){
485+
attempt += 1
486+
withEnv([(attempt == 1) ? 'UV_OFFLINE=1' : 'UV_OFFLINE=0']){
487+
powershell(
488+
label: "Testing with tox: ${(attempt == 1) ? 'Offline' : 'Online'}",
489+
script: ".\\venv\\Scripts\\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('.', '')}"
490+
)
491+
}
492+
}
480493
}
481494
}
482495
}
483496
} else {
484497
if(isUnix()){
498+
sh """python3 -m venv venv
499+
./venv/bin/pip install --disable-pip-version-check uv
500+
./venv/bin/uv python install cpython-${entry.PYTHON_VERSION}
501+
"""
485502
withEnv(["TOX_UV_PATH=${env.WORKSPACE}/venv/bin/uv"]){
486-
sh(
487-
label: 'Testing with tox',
488-
script: """python3 -m venv venv
489-
./venv/bin/pip install --disable-pip-version-check uv
490-
./venv/bin/uv run --python=${entry.PYTHON_VERSION} --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('.', '')}
491-
"""
492-
)
503+
def attempt = 0
504+
retry(2){
505+
attempt += 1
506+
withEnv([(attempt == 1) ? 'UV_OFFLINE=1' : 'UV_OFFLINE=0']){
507+
sh(
508+
label: "Testing with tox: ${(attempt == 1) ? 'Offline' : 'Online'}",
509+
script: "./venv/bin/uv run --python=${entry.PYTHON_VERSION} --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('.', '')}"
510+
)
511+
}
512+
}
493513
}
494514
} else {
515+
bat """python -m venv venv
516+
.\\venv\\Scripts\\pip install --disable-pip-version-check uv
517+
.\\venv\\Scripts\\uv python install cpython-${entry.PYTHON_VERSION}
518+
"""
495519
withEnv(["TOX_UV_PATH=${env.WORKSPACE}\\venv\\Scripts\\uv.exe"]){
496-
bat(
497-
label: 'Testing with tox',
498-
script: """python -m venv venv
499-
.\\venv\\Scripts\\pip install --disable-pip-version-check uv
500-
.\\venv\\Scripts\\uv python install cpython-${entry.PYTHON_VERSION}
501-
.\\venv\\Scripts\\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('.', '')}
502-
"""
503-
)
520+
def attempt = 0
521+
retry(2){
522+
attempt += 1
523+
withEnv([(attempt == 1) ? 'UV_OFFLINE=1' : 'UV_OFFLINE=0']){
524+
bat(
525+
label: "Testing with tox: ${(attempt == 1) ? 'Offline' : 'Online'}",
526+
script: ".\\venv\\Scripts\\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('.', '')}"
527+
)
528+
}
529+
}
504530
}
505531
}
506532
}
@@ -668,7 +694,7 @@ pipeline {
668694
docker{
669695
image 'python'
670696
label 'windows && docker && x86_64'
671-
args '--mount source=uv_python_cache_dir,target=C:\\Users\\ContainerUser\\Documents\\uvpython'
697+
args "--label=purpose=ci --label \"JOB_NAME=\$JOB_NAME\" --label \"absoluteUrl=${currentBuild.absoluteUrl}\" --label \"BUILD_NUMBER=${currentBuild.number}\" --mount source=uv_python_cache_dir,target=C:\\Users\\ContainerUser\\Documents\\uvpython"
672698
}
673699
}
674700
steps{
@@ -699,6 +725,7 @@ pipeline {
699725
docker {
700726
image 'mcr.microsoft.com/windows/servercore:ltsc2025'
701727
label 'windows && docker && x86_64'
728+
args "--label=purpose=ci --label \"JOB_NAME=\$JOB_NAME\" --label \"absoluteUrl=${currentBuild.absoluteUrl}\" --label \"BUILD_NUMBER=${currentBuild.number}\""
702729
}
703730
}
704731
options {
@@ -749,7 +776,7 @@ pipeline {
749776
docker{
750777
image 'ghcr.io/astral-sh/uv:debian'
751778
label 'docker && linux'
752-
args '--mount source=uv_python_cache_dir,target=/tmp/uvpython '
779+
args "--label=purpose=ci --label \"JOB_NAME=\$JOB_NAME\" --label \"absoluteUrl=${currentBuild.absoluteUrl}\" --label \"BUILD_NUMBER=${currentBuild.number}\" --mount source=uv_python_cache_dir,target=/tmp/uvpython"
753780
}
754781
}
755782
when{

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ tripwire = "uiucprescon.tripwire.main:main"
2828
[dependency-groups]
2929
test = ["pytest>7"]
3030
docs = ["sphinx"]
31-
audit-dependencies = ['uv-secure']
3231
type-checking = ["mypy", "types-tqdm"]
3332
lint = ["ruff"]
3433
tox = ["tox"]
@@ -40,7 +39,6 @@ dev = [
4039
"lxml",
4140
"pre-commit",
4241
"pytest",
43-
{include-group = "audit-dependencies"},
4442
{include-group = "docs"},
4543
{include-group = "lint"},
4644
{include-group = "test"},

0 commit comments

Comments
 (0)