-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.py
48 lines (43 loc) · 1.5 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import click
from buildutils import BuildConfiguration
from buildutils.plugins import (
CoveragePlugin,
FlakePlugin,
GenericCommandPlugin,
GenericCleanPlugin,
EnsureVenvActivePlugin,
alias,
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(),
alias(
'integration-test',
GenericCommandPlugin(
'INTEGRATION',
'Run integration tests with no code coverage analysis.'
)
),
GenericCommandPlugin('AUDIT', 'Audit the dependencies in the requirements.txt file for vulnerabilities.'),
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()