-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.py
executable file
·55 lines (35 loc) · 919 Bytes
/
dev.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
51
52
53
54
55
#!/usr/bin/env -S poetry run python
import os
import click
from executor import execute
def python_source_files():
import glob
include_paths = glob.glob("*.py") + glob.glob("hobart_svg/*.py")
exclude_paths = []
return [x for x in include_paths if x not in exclude_paths]
@click.group()
def cli():
pass
@cli.command()
def install():
execute("poetry install --sync")
@cli.command()
def test():
execute("python -m pytest")
@cli.command()
def lint():
execute("flake8", *python_source_files())
@cli.command()
def black():
execute("black", *python_source_files())
@cli.command()
def black_check():
execute("black", "--check", *python_source_files())
@cli.command()
def publish():
execute("rm -rf dist/")
execute("poetry build")
execute("twine upload dist/*")
if __name__ == "__main__":
os.chdir(os.path.abspath(os.path.dirname(__file__)))
cli()