91e75e620b
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
58 lines
1.5 KiB
Python
Executable File
58 lines
1.5 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Setup script for Cua Desktop Extension
|
|
Installs required dependencies if not available
|
|
"""
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
|
|
def check_and_install_package(package_name, import_name=None):
|
|
"""Check if a package is available, install if not."""
|
|
if import_name is None:
|
|
import_name = package_name
|
|
|
|
try:
|
|
__import__(import_name)
|
|
print(f"✓ {package_name} is available")
|
|
return True
|
|
except ImportError:
|
|
print(f"⚠ {package_name} not found, installing...")
|
|
try:
|
|
subprocess.check_call([sys.executable, "-m", "pip", "install", package_name])
|
|
print(f"✓ {package_name} installed successfully")
|
|
return True
|
|
except subprocess.CalledProcessError as e:
|
|
print(f"✗ Failed to install {package_name}: {e}")
|
|
return False
|
|
|
|
|
|
def main():
|
|
"""Install required packages."""
|
|
print("Setting up Cua Desktop Extension dependencies...")
|
|
|
|
# Required packages
|
|
packages = [
|
|
("mcp", "mcp"),
|
|
("anyio", "anyio"),
|
|
("cua-agent[all]", "agent"),
|
|
("cua-computer", "computer"),
|
|
]
|
|
|
|
all_installed = True
|
|
for package, import_name in packages:
|
|
if not check_and_install_package(package, import_name):
|
|
all_installed = False
|
|
|
|
if all_installed:
|
|
print("✓ All dependencies are ready!")
|
|
return 0
|
|
else:
|
|
print("✗ Some dependencies failed to install")
|
|
return 1
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|