cutekit 0.9.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cutekit-0.9.3/PKG-INFO +10 -0
- cutekit-0.9.3/cutekit/__init__.py +97 -0
- cutekit-0.9.3/cutekit/__main__.py +5 -0
- cutekit-0.9.3/cutekit/builder.py +783 -0
- cutekit-0.9.3/cutekit/cli.py +1000 -0
- cutekit-0.9.3/cutekit/const.py +50 -0
- cutekit-0.9.3/cutekit/doc.py +0 -0
- cutekit-0.9.3/cutekit/export.py +431 -0
- cutekit-0.9.3/cutekit/fmt.py +37 -0
- cutekit-0.9.3/cutekit/jexpr.py +214 -0
- cutekit-0.9.3/cutekit/mixins.py +100 -0
- cutekit-0.9.3/cutekit/model.py +1166 -0
- cutekit-0.9.3/cutekit/ninja.py +210 -0
- cutekit-0.9.3/cutekit/package.py +67 -0
- cutekit-0.9.3/cutekit/plugins.py +61 -0
- cutekit-0.9.3/cutekit/py.typed +0 -0
- cutekit-0.9.3/cutekit/requirements.txt +2 -0
- cutekit-0.9.3/cutekit/rules.py +110 -0
- cutekit-0.9.3/cutekit/shell.py +520 -0
- cutekit-0.9.3/cutekit/utils.py +84 -0
- cutekit-0.9.3/cutekit/vt100.py +92 -0
- cutekit-0.9.3/cutekit.egg-info/PKG-INFO +10 -0
- cutekit-0.9.3/cutekit.egg-info/SOURCES.txt +30 -0
- cutekit-0.9.3/cutekit.egg-info/dependency_links.txt +1 -0
- cutekit-0.9.3/cutekit.egg-info/entry_points.txt +3 -0
- cutekit-0.9.3/cutekit.egg-info/requires.txt +2 -0
- cutekit-0.9.3/cutekit.egg-info/top_level.txt +1 -0
- cutekit-0.9.3/pyproject.toml +31 -0
- cutekit-0.9.3/setup.cfg +4 -0
- cutekit-0.9.3/tests/test_cli.py +261 -0
- cutekit-0.9.3/tests/test_jexpr.py +30 -0
- cutekit-0.9.3/tests/test_resolver.py +105 -0
cutekit-0.9.3/PKG-INFO
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cutekit
|
|
3
|
+
Version: 0.9.3
|
|
4
|
+
Summary: The magical build system and package manager
|
|
5
|
+
Author-email: Keyboard Slayer <joda@cute.engineering>, Sleepy Monax <nivb@cute.engineering>, Cyp <cypb@cute.engineering>, Cute Engineering <contact@cute.engineering>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: graphviz~=0.20.1
|
|
10
|
+
Requires-Dist: dataclasses-json~=0.6.4
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import logging
|
|
3
|
+
|
|
4
|
+
from . import (
|
|
5
|
+
builder, # noqa: F401 this is imported for side effects
|
|
6
|
+
export, # noqa: F401 this is imported for side effects
|
|
7
|
+
fmt, # noqa: F401 this is imported for side effects
|
|
8
|
+
package, # noqa: F401 this is imported for side effects
|
|
9
|
+
cli,
|
|
10
|
+
const,
|
|
11
|
+
model,
|
|
12
|
+
plugins,
|
|
13
|
+
shell,
|
|
14
|
+
vt100,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def ensure(version: tuple[int, int, int]):
|
|
19
|
+
if (
|
|
20
|
+
const.VERSION[0] == version[0]
|
|
21
|
+
and const.VERSION[1] == version[1]
|
|
22
|
+
and const.VERSION[2] >= version[2]
|
|
23
|
+
):
|
|
24
|
+
return
|
|
25
|
+
|
|
26
|
+
raise RuntimeError(
|
|
27
|
+
f"Expected cutekit version {version[0]}.{version[1]}.{version[2]} but found {const.VERSION_STR}"
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class logger:
|
|
32
|
+
class LoggerArgs:
|
|
33
|
+
verbose: bool = cli.arg(None, "verbose", "Enable verbose logging")
|
|
34
|
+
|
|
35
|
+
@staticmethod
|
|
36
|
+
def setup(args: LoggerArgs):
|
|
37
|
+
if args.verbose:
|
|
38
|
+
logging.basicConfig(
|
|
39
|
+
level=logging.DEBUG,
|
|
40
|
+
format=f"{vt100.CYAN}%(asctime)s{vt100.RESET} {vt100.YELLOW}%(levelname)s{vt100.RESET} %(name)s: %(message)s",
|
|
41
|
+
datefmt="%Y-%m-%d %H:%M:%S",
|
|
42
|
+
)
|
|
43
|
+
else:
|
|
44
|
+
projectRoot = model.Project.topmost()
|
|
45
|
+
logFile = const.GLOBAL_LOG_FILE
|
|
46
|
+
if projectRoot is not None:
|
|
47
|
+
logFile = os.path.join(projectRoot.dirname(), const.PROJECT_LOG_FILE)
|
|
48
|
+
|
|
49
|
+
shell.mkdir(os.path.dirname(logFile))
|
|
50
|
+
|
|
51
|
+
logging.basicConfig(
|
|
52
|
+
level=logging.INFO,
|
|
53
|
+
filename=logFile,
|
|
54
|
+
filemode="w",
|
|
55
|
+
format="%(asctime)s %(levelname)s %(name)s: %(message)s",
|
|
56
|
+
datefmt="%Y-%m-%d %H:%M:%S",
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class RootArgs(
|
|
61
|
+
plugins.PluginsArgs,
|
|
62
|
+
logger.LoggerArgs,
|
|
63
|
+
):
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@cli.command("/", const.DESCRIPTION)
|
|
68
|
+
def _(args: RootArgs):
|
|
69
|
+
shell.mkdir(const.GLOBAL_CK_DIR)
|
|
70
|
+
const.setup()
|
|
71
|
+
logger.setup(args)
|
|
72
|
+
plugins.setup(args)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@cli.command("usage", "Show usage information")
|
|
76
|
+
def _():
|
|
77
|
+
cli.usage()
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@cli.command("version", "Show current version")
|
|
81
|
+
def _():
|
|
82
|
+
print(f"CuteKit v{const.VERSION_STR}")
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def main() -> int:
|
|
86
|
+
try:
|
|
87
|
+
cli.exec()
|
|
88
|
+
return 0
|
|
89
|
+
|
|
90
|
+
except RuntimeError as e:
|
|
91
|
+
logging.exception(e)
|
|
92
|
+
vt100.error(str(e))
|
|
93
|
+
return 1
|
|
94
|
+
|
|
95
|
+
except KeyboardInterrupt:
|
|
96
|
+
print()
|
|
97
|
+
return 1
|