-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
executable file
·43 lines (30 loc) · 1.19 KB
/
setup
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
#!/usr/bin/env python3
"""Setup CLI script"""
import subprocess
import click
@click.group(name="setup")
def setup():
"""Setup toolkit for CodeScribe"""
@setup.command(name="develop")
def develop():
"""Development mode"""
subprocess.run("python3 setup.py develop --user", shell=True, check=True)
subprocess.run("cp figaro/scripts/figaro $HOME/.local/bin", shell=True, check=True)
@setup.command(name="install")
def install():
"""Installation command"""
subprocess.run("python3 setup.py develop --user", shell=True, check=True)
subprocess.run("python3 setup.py build", shell=True, check=True)
subprocess.run("python3 setup.py install --user", shell=True, check=True)
subprocess.run("cp figaro/scripts/figaro $HOME/.local/bin", shell=True, check=True)
@setup.command(name="publish")
def publish():
"""Publish PyPi package"""
subprocess.run("python3 setup.py sdist", shell=True, check=True)
subprocess.run("twine upload --verbose dist/*", shell=True, check=True)
@setup.command(name="clean")
def clean():
"""Clean installation artifacts"""
subprocess.run("rm -rf *.egg-info build dist", shell=True, check=True)
if __name__ == "__main__":
setup()