chore: development script for syncing Poetry lockfile (#5170)

This commit is contained in:
Bowen Liang
2024-06-14 20:54:07 +08:00
committed by GitHub
parent 43c19007e0
commit e7752e8135
4 changed files with 32 additions and 1 deletions

15
dev/sync-poetry Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# rely on `poetry` in path
if ! command -v poetry &> /dev/null; then
echo "Installing Poetry ..."
pip install poetry
fi
# check poetry.lock in sync with pyproject.toml
poetry check -C api --lock
if [ $? -ne 0 ]; then
# update poetry.lock
# refreshing lockfile only without updating locked versions
poetry lock -C api --no-update
fi

13
dev/update-poetry Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# rely on `poetry` in path
if ! command -v poetry &> /dev/null; then
echo "Installing Poetry ..."
pip install poetry
fi
# refreshing lockfile, updating locked versions
poetry update -C api
# check poetry.lock in sync with pyproject.toml
poetry check -C api --lock