-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.py
More file actions
103 lines (76 loc) · 1.92 KB
/
Copy pathpackage.py
File metadata and controls
103 lines (76 loc) · 1.92 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
early = globals()["early"]
@early()
def __mock():
"""Define package from command line option
"""
import sys
import argparse
if any(help_ in sys.argv[1:] for help_ in ["-h", "--help"]):
# Skip parsing version string if user is asking for help,
# or the following parser will print out it's own help
# message without rez-build's.
return ""
parser = argparse.ArgumentParser()
with open("./parse_build_args.py", "r") as add_args:
exec(add_args.read(), {"parser": parser})
opt, unknown = parser.parse_known_args() # parse `sys.argv`
return {
"name": opt.name,
"version": opt.version,
"requires": opt.requires or [],
"tools": opt.tools or [],
}
@early()
def name():
mock = globals()["this"].__mock
if mock:
return "mock" + mock["name"]
else:
return "mockapp"
@early()
def description():
mock = globals()["this"].__mock
if mock:
return "Mocking %s" % mock["name"]
else:
"Mocking App"
@early()
def version():
mock = globals()["this"].__mock
if mock:
return mock["version"]
else:
return "0"
@early()
def requires():
mock = globals()["this"].__mock
if mock:
return mock["requires"] + ["Qt.py"] # for gui mock
else:
return []
@early()
def tools():
mock = globals()["this"].__mock
if mock:
return mock["tools"]
else:
return []
@early()
def build_command():
mock = globals()["this"].__mock
command = "python {root}/rezbuild.py {install} "
if mock:
return command + " ".join(mock["tools"])
else:
return command
private_build_requires = [
"identicon",
]
# This will be picked up by Allzpark
_data = {
"icon": "{root}/resources/icon.png"
}
def commands():
env = globals()["env"]
env.PYTHONPATH.prepend("{root}/python")
env.PATH.prepend("{root}/bin")