switch to uv (#32853)

* switch to uv

* pin back numpy

* remove lock

* try without cache

* test with no cache

* no cache for all

* debug

* remove debug

* remove pygame dep

* Update README.md

* remove lower bound

* update repo maintenance job

* upgradable

* repo maintenance

* copy poetry api

* build system

* unpin pygame

* readd cache

* readd cache

* basic command

* lower delay

* macos

* fix authors

* macos fix

* use uv

* preview

* other way

* new metadrive

* uv sync

* cp lock in docker

* fix docker

* use hatchling

* fix devcontainer

* fix container

* path

* uv run

* cleanup

* pre-commit

* format

* release_file
old-commit-hash: 12d5afba73
This commit is contained in:
Maxime Desroches
2024-06-27 17:04:05 -07:00
committed by GitHub
parent d94198652d
commit a1a0e9e8a0
12 changed files with 7997 additions and 184 deletions

View File

@@ -8,22 +8,17 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
ROOT=$DIR/../
cd $ROOT
RC_FILE="${HOME}/.$(basename ${SHELL})rc"
if [ "$(uname)" == "Darwin" ] && [ $SHELL == "/bin/bash" ]; then
RC_FILE="$HOME/.bash_profile"
fi
if ! command -v "poetry" > /dev/null 2>&1; then
echo "installing poetry..."
curl -sSL https://install.python-poetry.org | python3 -
POETRY_BIN='$HOME/.local/bin'
ADD_PATH_CMD="export PATH=\"$POETRY_BIN:\$PATH\""
if ! command -v "uv" > /dev/null 2>&1; then
echo "installing uv..."
curl -LsSf https://astral.sh/uv/install.sh | sh
UV_BIN='$HOME/.cargo/env'
ADD_PATH_CMD=". \"$UV_BIN\""
eval $ADD_PATH_CMD
printf "\n#poetry path\n$ADD_PATH_CMD\n" >> $RC_FILE
fi
poetry config virtualenvs.prefer-active-python true --local
poetry config virtualenvs.in-project true --local
echo "installing python packages..."
uv sync --all-extras
source .venv/bin/activate
echo "PYTHONPATH=${PWD}" > $ROOT/.env
if [[ "$(uname)" == 'Darwin' ]]; then
@@ -32,15 +27,8 @@ if [[ "$(uname)" == 'Darwin' ]]; then
echo "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> $ROOT/.env
fi
poetry self add poetry-dotenv-plugin@^0.1.0
echo "installing python packages..."
poetry install --no-cache --no-root
[ -n "$POETRY_VIRTUALENVS_CREATE" ] && RUN="" || RUN="poetry run"
if [ "$(uname)" != "Darwin" ] && [ -e "$ROOT/.git" ]; then
echo "pre-commit hooks install..."
$RUN pre-commit install
$RUN git submodule foreach pre-commit install
pre-commit install
git submodule foreach pre-commit install
fi