mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-24 10:05:29 -05:00
* Tighten up ruff ignore list * Okay that fix was indeed unsafe * enable type-name-incorrect-variance * enable literal-membership * enable non-augmented-assignment * enable useless-return * enable global-variable-not-assigned * - * fixup * Clean up roff.toml from annotations * use ignore instead of explicit re-export * use more descriptive names --------- Co-authored-by: Kyle Altendorf <sda@fstab.net>
42 lines
860 B
Python
Executable File
42 lines
860 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
from __future__ import annotations
|
|
|
|
import enum
|
|
import os
|
|
import pathlib
|
|
import subprocess
|
|
import sys
|
|
|
|
here = pathlib.Path(__file__).parent.absolute()
|
|
|
|
|
|
class Env(enum.Enum):
|
|
chia = ".venv"
|
|
poetry = ".penv"
|
|
|
|
|
|
def main(*args: str) -> int:
|
|
if len(args) == 0:
|
|
print("Parameters required")
|
|
return 1
|
|
|
|
env = Env.chia
|
|
if args[0].startswith("--"):
|
|
env = Env[args[0][2:]]
|
|
args = args[1:]
|
|
|
|
if sys.platform == "win32":
|
|
script = "activated.ps1"
|
|
command = ["powershell", os.fspath(here.joinpath(script)), env.value, *args]
|
|
else:
|
|
script = "activated.sh"
|
|
command = ["sh", os.fspath(here.joinpath(script)), env.value, *args]
|
|
|
|
completed_process = subprocess.run(command, check=False)
|
|
|
|
return completed_process.returncode
|
|
|
|
|
|
sys.exit(main(*sys.argv[1:]))
|