feat: switch to Uv

This commit is contained in:
ducklet 2025-05-15 21:56:57 +02:00
parent 5c272b5110
commit 2814be8975
10 changed files with 538 additions and 852 deletions

View file

@ -4,4 +4,6 @@ cd "$RUN_DIR"
[ -z "${DEBUG:-}" ] || set -x
exec poetry run python -m unwind "$@"
python_bin=$(uv run command -v python)
exec "$python_bin" -m unwind "$@"

View file

@ -33,9 +33,12 @@ githash_long=$(git rev-parse HEAD)
version="$githash_short"
echo "$version" >"$builddir"/version
poetry export \
--with=build \
--output="$builddir"/requirements.txt
uv export \
--frozen \
--format=requirements.txt \
--no-dev \
--no-emit-project \
>"$builddir"/requirements.txt
$DOCKER_BIN build \
--pull \

View file

@ -4,7 +4,7 @@ cd "$RUN_DIR"
[ -z "${DEBUG:-}" ] || set -x
poetry install --with=dev --sync
uv sync --frozen
cd unwind-ui
npm ci

View file

@ -4,7 +4,7 @@ cd "$RUN_DIR"
[ -z "${DEBUG:-}" ] || set -x
poetry run ruff check --fix . ||:
poetry run ruff format .
uv run ruff check --fix . ||:
uv run ruff format .
poetry run pyright
uv run pyright

View file

@ -4,8 +4,10 @@ cd "$RUN_DIR"
[ -z "${DEBUG:-}" ] || set -x
echo '# Poetry:'
poetry show --outdated --top-level --with=build,dev
echo '# Uv:'
uv tree --outdated \
| grep --color=never ' (latest: ' \
| sed -E 's/^[│├└─ ]*//'
echo '
# Npm:'

View file

@ -11,4 +11,4 @@ trap 'rm "$dbfile" "${dbfile}-shm" "${dbfile}-wal"' EXIT TERM INT QUIT
[ -z "${DEBUG:-}" ] || set -x
UNWIND_STORAGE="$dbfile" \
exec poetry run pytest --cov "$@"
exec uv run pytest --cov "$@"

View file

@ -13,34 +13,23 @@ cd "$RUN_DIR"
[ -z "${DEBUG:-}" ] || set -x
# Poetry
# Uv
poetry update --with=build,dev
uv sync --upgrade
poetry show --outdated --top-level \
| cut -d ' ' -f 1 \
| while read -r pkg; do
poetry add "$pkg@latest"
done
uv tree --outdated --no-dev \
| sed -nE 's/.*─ ([^ ]+) (v[^ ]+) \(latest: v([^)]+)\)/\1>=\3/p' \
| xargs uv add
poetry show --outdated --top-level --only=build \
| cut -d ' ' -f 1 \
| while read -r pkg; do
poetry add --group=build "$pkg@latest"
done
poetry show --outdated --top-level --only=dev \
| cut -d ' ' -f 1 \
| while read -r pkg; do
poetry add --group=dev "$pkg@latest"
done
uv tree --outdated --only-dev \
| sed -nE 's/.*─ ([^ ]+) (v[^ ]+) \(latest: v([^)]+)\)/\1>=\3/p' \
| xargs uv add --dev
# Npm
cd unwind-ui
npm update
npm install $(npm outdated --json --silent | jq -r 'keys|map("\(.)@latest")|@sh')
npm outdated --json --silent \
| jq -r 'keys|map(@sh"\(.)@latest")|join("\n")' \