@@ -33,47 +33,20 @@ install-precommit:
3333upgrade-package package : && uvmirror devenv
3434 uv lock --upgrade-package {{ package }}
3535
36- # Upgrade all packages to the latest versions as of the cutoff in pyproject.toml
37- upgrade-all : && uvmirror devenv
38- uv lock --upgrade
36+ # Upgrade all packages to the latest versions
37+ upgrade-all cooldown = " 7 days ago" : && devenv
38+ uv lock --upgrade --exclude-newer " {{ cooldown }} "
3939
4040# update the uv mirror requirements file
4141uvmirror file = " requirements.uvmirror.txt":
4242 rm -f {{ file }}
4343 uv export --format requirements-txt --frozen --no-hashes --all-groups --all-extras > {{ file }}
4444
45- # Move the cutoff date in pyproject.toml to N days ago (default: 7) at midnight UTC
46- bump-uv-cutoff days = " 7":
47- #!/ usr/ bin/ env -S uvx --with tomlkit python3.13
48- # Note we specify the python version here and we don't care if it's different to
49- # the .python-version; we need 3.11+ for the datetime code used.
50-
51- import datetime
52- import tomlkit
53-
54- with open(" pyproject.toml" , " rb" ) as f:
55- content = tomlkit.load(f)
56-
57- new_datetime = (
58- datetime .datetime .now(datetime .UTC) - datetime .timedelta(days=int(" {{ days }} " ))
59- ).replace (hour=0, minute=0, second=0, microsecond=0)
60- new_timestamp = new_datetime.strftime(" %Y-%m-%dT%H:%M:%SZ" )
61- if existing_timestamp := content[" tool" ][" uv" ].get(" exclude-newer" ):
62- if new_datetime < datetime .datetime .fromisoformat(existing_timestamp):
63- print(
64- f " Existing cutoff {existing_timestamp} is more recent than {new_timestamp}, not updating."
65- )
66- exit(0)
67- content[" tool" ][" uv" ][" exclude-newer" ] = new_timestamp
68-
69- with open(" pyproject.toml" , " w" ) as f:
70- tomlkit.dump(content, f)
71-
7245# This is the default input command to update-dependencies action
7346# https://github.com/bennettoxford/update-dependencies-action
7447
75- # Bump the timestamp cutoff to midnight UTC 7 days ago and upgrade all dependencies
76- update-dependencies : bump-uv-cutoff upgrade-all
48+ # recipe is used for doing lockfileMaintenance via update-dependencies action, until min release age is respected fo uv
49+ update-dependencies : upgrade-all && uvmirror
7750
7851# *args is variadic, 0 or more. This allows us to do `just test -k match`, for example.
7952
@@ -128,14 +101,10 @@ check:
128101check-lockfile :
129102 #!/usr/bin/env bash
130103 set -euo pipefail
131- # Make sure dates in pyproject.toml and uv.lock are in sync
104+ # Make sure lockfile is reproducible from pyproject.toml
132105 unset UV_EXCLUDE_NEWER
133106 rc=0
134- uv lock --check || rc=$?
135- if test " $rc " ! = " 0" ; then
136- echo " Timestamp cutoffs in uv.lock must match those in pyproject.toml. See DEVELOPERS.md for details and hints." >&2
137- exit $rc
138- fi
107+ uv lock --check
139108
140109# Fix formatting, import sort ordering, and justfile
141110fix :
0 commit comments