mirror of
https://github.com/trycua/computer.git
synced 2026-02-19 12:59:34 -06:00
Simplify uv build script and switch to uv
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
[build-system]
|
||||
build-backend = "pdm.backend"
|
||||
requires = ["pdm-backend"]
|
||||
|
||||
[project]
|
||||
authors = [{ name = "TryCua", email = "gh@trycua.com" }]
|
||||
dependencies = [
|
||||
@@ -19,20 +15,13 @@ version = "0.1.0"
|
||||
repository = "https://github.com/trycua/cua"
|
||||
|
||||
[dependency-groups]
|
||||
dev = []
|
||||
examples = []
|
||||
|
||||
[tool.pdm]
|
||||
distribution = false
|
||||
|
||||
[tool.pdm.dev-dependencies]
|
||||
dev = [
|
||||
"-e core @ file:///${PROJECT_ROOT}/libs/python/core",
|
||||
"-e agent @ file:///${PROJECT_ROOT}/libs/python/agent",
|
||||
"-e computer @ file:///${PROJECT_ROOT}/libs/python/computer",
|
||||
"-e computer-server @ file:///${PROJECT_ROOT}/libs/python/computer-server",
|
||||
"-e cua-som @ file:///${PROJECT_ROOT}/libs/python/som",
|
||||
"-e mcp-server @ file:///${PROJECT_ROOT}/libs/python/mcp-server",
|
||||
"cua-core",
|
||||
"cua-agent",
|
||||
"cua-computer",
|
||||
"cua-computer-server",
|
||||
"cua-som",
|
||||
"cua-mcp-server",
|
||||
"black>=23.0.0",
|
||||
"ipykernel>=6.29.5",
|
||||
"jedi>=0.19.2",
|
||||
@@ -40,9 +29,12 @@ dev = [
|
||||
"mypy>=1.10.0",
|
||||
"ruff>=0.9.2",
|
||||
"types-requests>=2.31.0",
|
||||
"hud-python[agent]==0.4.52"
|
||||
"hud-python[agent]==0.4.52",
|
||||
]
|
||||
docs = [
|
||||
"mkdocs-material>=9.2.0",
|
||||
"mkdocs>=1.5.0",
|
||||
]
|
||||
docs = ["mkdocs-material>=9.2.0", "mkdocs>=1.5.0"]
|
||||
test = [
|
||||
"aioresponses>=0.7.4",
|
||||
"pytest-asyncio>=0.21.1",
|
||||
@@ -51,9 +43,28 @@ test = [
|
||||
"pytest-xdist>=3.6.1",
|
||||
"pytest>=8.0.0",
|
||||
]
|
||||
examples = []
|
||||
|
||||
[tool.pdm.resolution]
|
||||
respect-source-order = true
|
||||
[tool.uv]
|
||||
package = false
|
||||
|
||||
[tool.uv.workspace]
|
||||
members = [
|
||||
"libs/python/agent",
|
||||
"libs/python/core",
|
||||
"libs/python/computer",
|
||||
"libs/python/computer-server",
|
||||
"libs/python/som",
|
||||
"libs/python/mcp-server",
|
||||
]
|
||||
|
||||
[tool.uv.sources]
|
||||
cua-agent = { workspace = true }
|
||||
cua-core = { workspace = true }
|
||||
cua-computer = { workspace = true }
|
||||
cua-computer-server = { workspace = true }
|
||||
cua-som = { workspace = true }
|
||||
cua-mcp-server = { workspace = true }
|
||||
|
||||
[tool.black]
|
||||
line-length = 100
|
||||
|
||||
@@ -92,61 +92,11 @@ rm -rf .venv
|
||||
uv venv .venv --python 3.12
|
||||
print_success "Virtual environment created"
|
||||
|
||||
# Activate virtual environment
|
||||
print_step "Activating virtual environment..."
|
||||
source .venv/bin/activate
|
||||
print_success "Virtual environment activated"
|
||||
|
||||
# Function to install a package and its dependencies using UV
|
||||
install_package() {
|
||||
local package_dir=$1
|
||||
local package_name=$2
|
||||
local extras=$3
|
||||
print_step "Installing ${package_name} with UV..."
|
||||
cd "$package_dir"
|
||||
|
||||
if [ -f "pyproject.toml" ]; then
|
||||
if [ -n "$extras" ]; then
|
||||
uv pip install -e ".[${extras}]"
|
||||
else
|
||||
uv pip install -e .
|
||||
fi
|
||||
else
|
||||
print_error "No pyproject.toml found in ${package_dir}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
cd "$PROJECT_ROOT"
|
||||
}
|
||||
|
||||
# Install packages in order of dependency
|
||||
# Install packages
|
||||
print_step "Installing packages in development mode with UV..."
|
||||
uv sync --group dev
|
||||
|
||||
# Install core first (base package with telemetry support)
|
||||
install_package "libs/python/core" "core"
|
||||
|
||||
# Install pylume (base dependency)
|
||||
install_package "libs/python/pylume" "pylume"
|
||||
|
||||
# Install computer with all its dependencies and extras
|
||||
install_package "libs/python/computer" "computer" "all"
|
||||
|
||||
# Install omniparser
|
||||
install_package "libs/python/som" "som"
|
||||
|
||||
# Install agent with all its dependencies and extras
|
||||
install_package "libs/python/agent" "agent" "all"
|
||||
|
||||
# Install computer-server
|
||||
install_package "libs/python/computer-server" "computer-server"
|
||||
|
||||
# Install mcp-server
|
||||
install_package "libs/python/mcp-server" "mcp-server"
|
||||
|
||||
# Install development tools from root project
|
||||
print_step "Installing development dependencies with UV..."
|
||||
uv pip install -e ".[dev,test,docs]"
|
||||
|
||||
# Print success
|
||||
print_success "All packages installed successfully with UV!"
|
||||
print_step "Your virtual environment is ready. To activate it:"
|
||||
echo " source .venv/bin/activate"
|
||||
|
||||
Reference in New Issue
Block a user