mirror of
https://github.com/rhasspy/piper-sample-generator.git
synced 2026-08-27 18:15:58 -04:00
18 lines
500 B
Python
Executable file
18 lines
500 B
Python
Executable file
#!/usr/bin/env python3
|
|
import subprocess
|
|
import venv
|
|
from pathlib import Path
|
|
|
|
_DIR = Path(__file__).parent
|
|
_PROGRAM_DIR = _DIR.parent
|
|
_VENV_DIR = _PROGRAM_DIR / ".venv"
|
|
_SCRIPT = _PROGRAM_DIR / "generate_samples.py"
|
|
|
|
if _VENV_DIR.exists():
|
|
context = venv.EnvBuilder().ensure_directories(_VENV_DIR)
|
|
python_exe = context.env_exe
|
|
else:
|
|
python_exe = "python3"
|
|
|
|
subprocess.check_call([python_exe, "-m", "black", str(_SCRIPT)])
|
|
subprocess.check_call([python_exe, "-m", "isort", str(_SCRIPT)])
|