-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.py
50 lines (33 loc) · 941 Bytes
/
manage.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! ./.venv/bin/python
import os
from typing import Optional
from enum import Enum
try:
import typer
except ImportError as e:
os.system("pip install typer")
import typer
app = typer.Typer()
class Environment(str, Enum):
dev = "dev"
test = "test"
staging = "staging"
production = "production"
@app.command()
def install():
typer.echo("\nInstalling packages 🚀")
os.system("pip install -r src/requirements.txt")
typer.echo(f"\nPackages installed. Have fun 😁 \n")
@app.command("test")
def test():
os.system(f"ENV=test pytest -s")
@app.command("coverage")
def coverage():
os.system(f"ENV=test pytest -s --cov=timepulse")
# os.system(f"coverage report")
@app.command("seed")
def seed(env: Optional[Environment] = Environment.dev):
typer.echo(f"\nRunning Seed | Environment: {env} 🚀 \n")
os.system(f"ENV=dev python3 seed.py")
if __name__ == "__main__":
app()