-
Notifications
You must be signed in to change notification settings - Fork 2
/
develop.py
32 lines (23 loc) · 885 Bytes
/
develop.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
"""Development bootstrap script."""
from argparse import ArgumentParser
from subprocess import run
def develop(test_only: bool, ci: bool):
"""Run the development bootstrap commands."""
run(['poetry', 'install'], check=True)
run(['poetry', 'run', 'pip', 'install', 'typer>=0.3.0'], check=True)
if not test_only:
ci_args = ['--ci'] if ci else []
run(
['poetry', 'run', 'python', '-m', 'tasks', 'install-dev-tools', *ci_args],
check=True,
)
def main(args):
"""Parse arguments and run script."""
argparser = ArgumentParser()
argparser.add_argument('--test-only', action='store_true', default=False)
argparser.add_argument('--ci', action='store_true', default=False)
ns = argparser.parse_args(args)
develop(ns.test_only, ns.ci)
if __name__ == '__main__':
import sys
main(sys.argv[1:])