-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
31 lines (27 loc) · 1.12 KB
/
build.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
import click
from buildutils import BuildConfiguration
from buildutils.plugins import CoveragePlugin, FlakePlugin, \
GenericCommandPlugin, GenericCleanPlugin, EnsureVenvActivePlugin, group
@click.command()
@click.option('--profile', '-pr')
@click.option('--plugins', '-p')
@click.option('--list-plugins', '-l', is_flag=True)
def main(profile: str, plugins: str, list_plugins: bool):
(
BuildConfiguration()
.config('build.ini')
.plugins(
EnsureVenvActivePlugin(),
GenericCleanPlugin('CLEAN', 'Remove previous build files.'),
GenericCommandPlugin('INSTALL', 'Install required dependencies from requirements.txt file.'),
FlakePlugin(),
CoveragePlugin(),
group(
'generate-docs',
GenericCommandPlugin('PREPARE_DOCS', 'Prepare Sphinx for generating documentation from inline comments.'),
GenericCommandPlugin('GENERATE_DOCS', 'Generate documentation from inline comments using Sphinx')
)
).build(profile, plugins, list_plugins)
)
if __name__ == '__main__':
main()