feat(tools): migrate to UV from Poetry for blazing fast ultra safe secure unhackable dependency management 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀

This commit is contained in:
Ivan
2026-05-10 03:19:42 -05:00
parent 2ce02e1eef
commit 7e31cd0d56
19 changed files with 2759 additions and 2676 deletions
+2 -2
View File
@@ -182,7 +182,7 @@ function shouldRefreshLicenseArtifacts(repoRoot) {
const inputFiles = [
path.join(repoRoot, "pyproject.toml"),
path.join(repoRoot, "poetry.lock"),
path.join(repoRoot, "uv.lock"),
path.join(repoRoot, "package.json"),
path.join(repoRoot, "pnpm-lock.yaml"),
path.join(repoRoot, "meshchatx", "src", "backend", "licenses_collector.py"),
@@ -266,7 +266,7 @@ try {
}
// Allow overriding the python command
const pythonCmd = process.env.PYTHON_CMD || "poetry run python";
const pythonCmd = process.env.PYTHON_CMD || "uv run python";
console.log(
`Building backend for ${platform} (target: ${targetName}, output: ${buildDirRelative}) using: ${pythonCmd}`
+2 -2
View File
@@ -5,7 +5,7 @@ set -euo pipefail
cd /src
export POETRY_VERSION="${POETRY_VERSION:-2.3.4}"
export UV_VERSION="${UV_VERSION:-0.11.12}"
export PNPM_VERSION="${PNPM_VERSION:-10.33.0}"
apt-get update -y
@@ -37,7 +37,7 @@ curl -fsSL "https://github.com/go-task/task/releases/download/v${TASK_VER}/task_
corepack enable
corepack prepare "pnpm@${PNPM_VERSION}" --activate
bash scripts/ci/github-install-poetry.sh
bash scripts/ci/github-install-uv.sh
export TRIVY_SBOM=0
+8 -8
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Install Python (Poetry) and Node (pnpm) dependencies for native Electron builds.
# Install Python (UV) and Node (pnpm) dependencies for native Electron builds.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
@@ -28,13 +28,13 @@ if [[ "$(uname -s)" == "Linux" ]] && command -v apt-get >/dev/null 2>&1; then
run_priv apt-get install -y libopus0 libogg0
fi
python -m poetry check --lock
python -m poetry install --no-interaction --no-ansi --with dev
python -m poetry run python scripts/patch_lxst_pyogg_ogg_ctypes.py
uv lock --check
uv sync --group dev
uv run python scripts/patch_lxst_pyogg_ogg_ctypes.py
if [[ "$(uname -s)" == "Darwin" ]]; then
if poetry run python -c "import platform, sys; sys.exit(0 if platform.machine() == 'arm64' else 1)"; then
_miniaudio_state="$(poetry run python -c "
if uv run python -c "import platform, sys; sys.exit(0 if platform.machine() == 'arm64' else 1)"; then
_miniaudio_state="$(uv run python -c "
import importlib.util
import pathlib
import subprocess
@@ -78,10 +78,10 @@ else:
export ARCHFLAGS="-arch arm64"
export CFLAGS="-arch arm64"
export CXXFLAGS="-arch arm64"
poetry run python -m pip install --force-reinstall --no-cache-dir --no-binary miniaudio "miniaudio>=1.70,<2"
uv run python -m pip install --force-reinstall --no-cache-dir --no-binary miniaudio "miniaudio>=1.70,<2"
)
fi
if ! poetry run python -c "
if ! uv run python -c "
import importlib.util
import pathlib
import subprocess
-10
View File
@@ -1,10 +0,0 @@
#!/usr/bin/env bash
# Install Poetry from PyPI with an explicit version (no third-party installers).
# Set POETRY_VERSION to override the default.
set -euo pipefail
POETRY_VERSION="${POETRY_VERSION:-2.3.4}"
python -m pip install --disable-pip-version-check --upgrade pip
python -m pip install --disable-pip-version-check "poetry==${POETRY_VERSION}"
python -m poetry --version
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Install UV (Python package manager) from PyPI with an explicit version.
# Set UV_VERSION to override the default.
set -euo pipefail
UV_VERSION="${UV_VERSION:-0.11.12}"
python -m pip install --disable-pip-version-check --upgrade pip
python -m pip install --disable-pip-version-check "uv==${UV_VERSION}"
uv --version
+1 -1
View File
@@ -17,7 +17,7 @@ cleanup() {
}
trap cleanup EXIT INT TERM
poetry run python -m meshchatx.meshchat &
uv run python -m meshchatx.meshchat &
BE_PID=$!
sleep "${DEV_BACKEND_WAIT:-1}"
+1 -1
View File
@@ -25,7 +25,7 @@ trap cleanup EXIT INT TERM
echo "E2E: starting MeshChat backend on 127.0.0.1:${BACKEND_PORT} (isolated storage under ${TMPDIR})"
poetry run python -m meshchatx.meshchat \
uv run python -m meshchatx.meshchat \
--headless \
--no-https \
--host 127.0.0.1 \
+1 -1
View File
@@ -42,7 +42,7 @@ wine_wrap wine "./$GIT_EXE" /VERYSILENT /NORESTART
echo "Installing build dependencies in Wine Python..."
wine_wrap wine C:/Python314/python.exe -m pip install --upgrade pip
wine_wrap wine C:/Python314/python.exe -m pip install cx_Freeze poetry
wine_wrap wine C:/Python314/python.exe -m pip install cx_Freeze
if [ -f "requirements.txt" ]; then
wine_wrap wine C:/Python314/python.exe -m pip install -r requirements.txt
fi