-
Notifications
You must be signed in to change notification settings - Fork 253
Expand file tree
/
Copy pathsetup.py
More file actions
35 lines (25 loc) · 886 Bytes
/
setup.py
File metadata and controls
35 lines (25 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Setup script for the plexe project.
Installs core dependencies and configures pre-commit hooks.
"""
import subprocess
import sys
import shlex
def run_command(command):
try:
# shell=False is safer; command should be a list of arguments
if isinstance(command, str):
command = shlex.split(command)
subprocess.run(command, check=True, shell=False)
except subprocess.CalledProcessError:
# Command is always a list here due to normalization above
cmd_str = " ".join(map(str, command))
print(f"Failed to run: {cmd_str}")
sys.exit(1)
def main():
print("Configuring pre-commit hooks...")
print("(Note: Ensure you've run 'poetry install' first to install dependencies)")
run_command(["poetry", "run", "pre-commit", "install"])
print("Setup complete!")
if __name__ == "__main__":
main()