Use uv instead of pip in development env (#113517)
This commit is contained in:
@@ -7,6 +7,6 @@ set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
echo "Installing development dependencies..."
|
||||
python3 -m pip install wheel --constraint homeassistant/package_constraints.txt --upgrade
|
||||
python3 -m pip install colorlog $(grep awesomeversion requirements.txt) --constraint homeassistant/package_constraints.txt --upgrade
|
||||
python3 -m pip install -r requirements_test.txt -c homeassistant/package_constraints.txt --upgrade
|
||||
uv pip install wheel --constraint homeassistant/package_constraints.txt --upgrade
|
||||
uv pip install colorlog $(grep awesomeversion requirements.txt) --constraint homeassistant/package_constraints.txt --upgrade
|
||||
uv pip install -r requirements_test.txt -c homeassistant/package_constraints.txt --upgrade
|
||||
|
||||
@@ -268,7 +268,7 @@ def install_requirements(integration: Integration, requirements: set[str]) -> bo
|
||||
if is_installed:
|
||||
continue
|
||||
|
||||
args = [sys.executable, "-m", "pip", "install", "--quiet"]
|
||||
args = ["uv", "pip", "install", "--quiet"]
|
||||
if install_args:
|
||||
args.append(install_args)
|
||||
args.append(requirement_arg)
|
||||
|
||||
@@ -32,8 +32,7 @@ def main() -> int | None:
|
||||
requirements = gather_recursive_requirements(args.integration)
|
||||
|
||||
cmd = [
|
||||
sys.executable,
|
||||
"-m",
|
||||
"uv",
|
||||
"pip",
|
||||
"install",
|
||||
"-c",
|
||||
|
||||
@@ -8,11 +8,11 @@ cd "$(dirname "$0")/.."
|
||||
|
||||
command -v pytest >/dev/null 2>&1 || {
|
||||
echo >&2 "This script requires pytest but it's not installed." \
|
||||
"Aborting. Try: pip install pytest"; exit 1; }
|
||||
"Aborting. Try: uv pip install pytest"; exit 1; }
|
||||
|
||||
command -v monkeytype >/dev/null 2>&1 || {
|
||||
echo >&2 "This script requires monkeytype but it's not installed." \
|
||||
"Aborting. Try: pip install monkeytype"; exit 1; }
|
||||
"Aborting. Try: uv pip install monkeytype"; exit 1; }
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
|
||||
@@ -13,14 +13,18 @@ if [ -s .python-version ]; then
|
||||
export PYENV_VERSION
|
||||
fi
|
||||
|
||||
# other common virtualenvs
|
||||
my_path=$(git rev-parse --show-toplevel)
|
||||
if [ -n "${VIRTUAL_ENV}" ] && [ -f "${VIRTUAL_ENV}/bin/activate" ]; then
|
||||
. "${VIRTUAL_ENV}/bin/activate"
|
||||
else
|
||||
# other common virtualenvs
|
||||
my_path=$(git rev-parse --show-toplevel)
|
||||
|
||||
for venv in venv .venv .; do
|
||||
if [ -f "${my_path}/${venv}/bin/activate" ]; then
|
||||
. "${my_path}/${venv}/bin/activate"
|
||||
break
|
||||
fi
|
||||
done
|
||||
for venv in venv .venv .; do
|
||||
if [ -f "${my_path}/${venv}/bin/activate" ]; then
|
||||
. "${my_path}/${venv}/bin/activate"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
||||
14
script/setup
14
script/setup
@@ -16,15 +16,23 @@ fi
|
||||
|
||||
mkdir -p config
|
||||
|
||||
if [ ! -n "$DEVCONTAINER" ] && [ ! -n "$VIRTUAL_ENV" ];then
|
||||
python3 -m venv venv
|
||||
if [ ! -n "$VIRTUAL_ENV" ]; then
|
||||
if [ -x "$(command -v uv)" ]; then
|
||||
uv venv venv
|
||||
else
|
||||
python3 -m venv venv
|
||||
fi
|
||||
source venv/bin/activate
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v uv)" ]; then
|
||||
python3 -m pip install uv
|
||||
fi
|
||||
|
||||
script/bootstrap
|
||||
|
||||
pre-commit install
|
||||
python3 -m pip install -e . --config-settings editable_mode=compat --constraint homeassistant/package_constraints.txt
|
||||
uv pip install -e . --config-settings editable_mode=compat --constraint homeassistant/package_constraints.txt
|
||||
python3 -m script.translations develop --all
|
||||
|
||||
hass --script ensure_config -c config
|
||||
|
||||
Reference in New Issue
Block a user