File tree Expand file tree Collapse file tree 2 files changed +11
-19
lines changed
Expand file tree Collapse file tree 2 files changed +11
-19
lines changed Original file line number Diff line number Diff line change 22set -ex
33
44usage () {
5- echo " Script to generate pylock.toml from scratch"
6- echo " If pylock.toml already exists just run \` pdm lock --update-reuse\` "
5+ echo " Script to generate pylock.toml"
76 echo " Usage: $0 [-f] [-h]"
87 echo " -f Force update of all dependencies"
98 echo " -h Show this help message"
109}
1110
12- # Check if pdm is available
13- if ! command -v pdm > /dev/null 2>&1
11+ # Check if uv is available
12+ if ! command -v uv > /dev/null 2>&1
1413then
15- echo " This script requires 'pdm ' but it's not installed."
14+ echo " This script requires 'uv ' but it's not installed."
1615 exit 1
1716fi
1817
@@ -27,13 +26,7 @@ while getopts "fh" opt; do
2726 esac
2827done
2928
30- set +e
31- update_stratagy=" $( [ $FORCE_REGEN -eq 0 ] && echo " --update-reuse" ) "
32- set -e
33-
34- # Locking all dependencies to the same version for all supported
35- # python versions is not possible (mostly due to numpy)
36- # so we need to lock separately for python >=3.12 and <3.12
37- # Only set update-reuse if not forcing regeneration
38- pdm lock --python " ~=3.12" $update_stratagy
39- pdm lock --append --python " <3.12" $update_stratagy
29+ if [ $FORCE_REGEN -eq 1 ]; then
30+ uv lock --refresh
31+ fi
32+ uv export --frozen --all-groups --all-extras --format=pylock.toml --output-file=pylock.toml --quiet
Original file line number Diff line number Diff line change @@ -94,8 +94,7 @@ commands =
9494[testenv:lock]
9595description = Update pylock
9696skip_install = true
97- setenv =
98- PDM_IGNORE_SAVED_PYTHON =" 1"
99- deps = pdm[all]
97+ allowlist_externals = ./scripts/generate_pylock.sh
98+ deps = uv
10099commands =
101- pdm lock --update-reuse
100+ ./scripts/generate_pylock.sh {posargs}
You can’t perform that action at this time.
0 commit comments