-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.py
More file actions
53 lines (37 loc) · 1.6 KB
/
Build.py
File metadata and controls
53 lines (37 loc) · 1.6 KB
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
"""Build tasks for this project."""
import sys
from pathlib import Path
import typer
from dbrownell_Common import PathEx
from dbrownell_DevTools.RepoBuildTools import Python as RepoBuildTools
from typer.core import TyperGroup
# ----------------------------------------------------------------------
class NaturalOrderGrouper(TyperGroup):
# pylint: disable=missing-class-docstring
# ----------------------------------------------------------------------
def list_commands(self, *args, **kwargs): # pylint: disable=unused-argument
return self.commands.keys()
# ----------------------------------------------------------------------
app = typer.Typer(
cls=NaturalOrderGrouper,
help=__doc__,
no_args_is_help=True,
pretty_exceptions_show_locals=False,
pretty_exceptions_enable=False,
)
# ----------------------------------------------------------------------
this_dir = PathEx.EnsureDir(Path(__file__).parent)
# ----------------------------------------------------------------------
Black = RepoBuildTools.BlackFuncFactory(this_dir, app)
Pytest = RepoBuildTools.PytestFuncFactory(
this_dir,
"code_coverage_does_not_apply_to_this_repo",
app,
default_min_coverage=0.0,
)
CreateDockerImage = RepoBuildTools.CreateDockerImageFuncFactory(this_dir, app)
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
if __name__ == "__main__":
sys.exit(app())