Skip to content
Merged

Dev #172

Show file tree
Hide file tree
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
380 changes: 218 additions & 162 deletions Jenkinsfile

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions ci/scripts/create_uv_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#! /usr/bin/env bash
# This script creates a global configuration file for Jenkins to make the UV cache metadata for longer than standard

set -e

MAX_AGE_API=6000
MAX_AGE_FILES=365000000

GLOBAL_CONFIG_FILE=uv.toml

echo "# This file is auto-generated by $(basename $0)" > $GLOBAL_CONFIG_FILE

echo '' >> $GLOBAL_CONFIG_FILE
echo '[[index]]' >> $GLOBAL_CONFIG_FILE
echo "url = \"https://pypi.org/simple\"" >> $GLOBAL_CONFIG_FILE
echo 'default = true' >> $GLOBAL_CONFIG_FILE
echo "cache-control = { api = \"max-age=$MAX_AGE_API\", files = \"max-age=$MAX_AGE_FILES, immutable\" }" >> $GLOBAL_CONFIG_FILE

for arg in "$@"; do
echo '' >> $GLOBAL_CONFIG_FILE
echo '[[index]]' >> $GLOBAL_CONFIG_FILE
echo "url = \"$arg\"" >> $GLOBAL_CONFIG_FILE
echo "cache-control = { api = \"max-age=$MAX_AGE_API\", files = \"max-age=$MAX_AGE_FILES, immutable\" }" >> $GLOBAL_CONFIG_FILE
done

echo "$(realpath $GLOBAL_CONFIG_FILE)"
23 changes: 23 additions & 0 deletions ci/scripts/new-uv-global-config.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$GLOBAL_CONFIG_FILE = "uv.toml"
$MAX_AGE_API="6000"
$MAX_AGE_FILES="365000000"

$scriptName = $MyInvocation.MyCommand.Name
"# This file is auto-generated by $scriptName" | Set-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8

'' | Add-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8
'[[index]]' | Add-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8
"url = `"https://pypi.org/simple`"" | Add-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8
'default = true' | Add-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8
"cache-control = { api = `"max-age=$MAX_AGE_API`", files = `"max-age=$MAX_AGE_FILES, immutable`" }" | Add-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8


foreach ($arg in $args) {
'' | Add-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8
'[[index]]' | Add-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8
"url = `"$arg`"" | Add-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8
'default = true' | Add-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8
"cache-control = { api = `"max-age=$MAX_AGE_API`", files = `"max-age=$MAX_AGE_FILES, immutable`" }" | Add-Content -Path $GLOBAL_CONFIG_FILE -Encoding UTF8
}

Write-Output (Get-ChildItem -Path $GLOBAL_CONFIG_FILE).FullName
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Documentation = "https://www.library.illinois.edu/dccdocs/imagevalidate"
Download = "https://github.com/UIUCLibrary/imagevalidate"

[dependency-groups]
audit-dependencies = ["uv-secure"]
docs = ["sphinx"]
type_checking = [
"mypy",
Expand All @@ -64,7 +63,6 @@ dev = [
{include-group = "docs"},
{include-group = "lint"},
{include-group = "test"},
{include-group = "audit-dependencies"},
"coverage[toml]",
"gcovr;os_name!= 'nt'",
]
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pass_env =
LIBPATH
dependency_groups = test
commands = pytest --basetemp={envtmpdir}/pytest {posargs}
uv_sync_flags = --no-editable

[testenv:docs]
dependency_groups = docs
Expand Down
Loading
Loading