If the arguments for OWW are included, microwakeword will be disabled and OWW will be used for detection. Requires a running instance of OWW on the local machine using port 10400. If the OWW arguments are excluded, microwakeword is used for detection. --wake-uri 'tcp://127.0.0.1:10400' \ --wake-word-name 'marvin'
36 lines
1.1 KiB
Python
Executable File
36 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
import argparse
|
|
import subprocess
|
|
import venv
|
|
from pathlib import Path
|
|
|
|
_DIR = Path(__file__).parent
|
|
_PROGRAM_DIR = _DIR.parent
|
|
_VENV_DIR = _PROGRAM_DIR / ".venv"
|
|
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("--dev", action="store_true", help="Install dev requirements")
|
|
args = parser.parse_args()
|
|
|
|
# Create virtual environment
|
|
builder = venv.EnvBuilder(with_pip=True)
|
|
context = builder.ensure_directories(_VENV_DIR)
|
|
builder.create(_VENV_DIR)
|
|
|
|
# Upgrade dependencies
|
|
pip = [context.env_exe, "-m", "pip"]
|
|
subprocess.check_call(pip + ["install", "--upgrade", "pip"])
|
|
subprocess.check_call(pip + ["install", "--upgrade", "setuptools", "wheel"])
|
|
subprocess.check_call(pip + ["install", "--upgrade", "python-mpv"])
|
|
subprocess.check_call(pip + ["install", "--upgrade", "gpiozero"])
|
|
subprocess.check_call(pip + ["install", "--upgrade", "spidev"])
|
|
|
|
# Install requirements
|
|
subprocess.check_call(pip + ["install", "-e", str(_PROGRAM_DIR)])
|
|
|
|
if args.dev:
|
|
# Install dev requirements
|
|
subprocess.check_call(
|
|
pip + ["install", "-e", f"{_PROGRAM_DIR}[dev]"]
|
|
)
|