fix: reoslve the uv issue

This commit is contained in:
Omid Zamani
2026-01-02 16:50:08 +01:00
parent e6cdcc207a
commit 68277cc929
7 changed files with 24 additions and 7 deletions

View File

@@ -194,7 +194,7 @@ def test_cmd_options(parser):
def test_cmd(args, out):
"""Run local and online tests for chatmail deployment.
This will automatically pip-install 'deltachat' if it's not available.
This will automatically uv-pip-install 'deltachat' if it's not available.
"""
x = importlib.util.find_spec("deltachat")

View File

@@ -13,7 +13,7 @@ from pyinfra import facts, host, logger
from pyinfra.api import FactBase
from pyinfra.facts.files import Sha256File
from pyinfra.facts.systemd import SystemdEnabled
from pyinfra.operations import apt, files, pip, server, systemd
from pyinfra.operations import apt, files, server, systemd
from cmdeploy.cmdeploy import Out

View File

@@ -46,7 +46,7 @@ steps. Please substitute it with your own domain.
mta-sts.chat.example.org. 3600 IN CNAME chat.example.org.
2. On your local PC, clone the repository and bootstrap the Python
virtualenv.
environment using ``uv``.
::

11
init.sh
View File

@@ -7,11 +7,20 @@ sudo apt update
sudo apt install -y git curl wget python3-dev gcc python3 nano sed
# 1.1 Install uv
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH"
if ! command -v uv &> /dev/null; then
if [ -f "/root/.local/bin/uv" ]; then
export PATH="/root/.local/bin:$PATH"
elif [ -f "$HOME/.local/bin/uv" ]; then
export PATH="$HOME/.local/bin:$PATH"
fi
fi
if ! command -v uv &> /dev/null; then
echo "--- Installing uv ---"
curl -LsSf https://astral.sh/uv/install.sh | sh
# Ensure uv is in PATH for the current script
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH"
fi
# 2. Clone the repository if not already in it

View File

@@ -3,7 +3,7 @@
# Wrapper for building the docs
set -e
# Ensure uv is in PATH
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH"
cd doc/
uv run make html

View File

@@ -3,6 +3,6 @@
# Wrapper for cmdelpoy to run it in activated virtualenv.
set -e
# Ensure uv is in PATH
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH"
uv run cmdeploy "$@"

View File

@@ -19,7 +19,15 @@ if command -v lsb_release 2>&1 >/dev/null; then
fi
# Ensure uv is in PATH
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH"
if ! command -v uv &> /dev/null; then
if [ -f "/root/.local/bin/uv" ]; then
export PATH="/root/.local/bin:$PATH"
elif [ -f "$HOME/.local/bin/uv" ]; then
export PATH="$HOME/.local/bin:$PATH"
fi
fi
if ! command -v uv &> /dev/null; then
echo "uv not found. Please install it first or run init.sh"