42
42
43
43
args = parser .parse_args ()
44
44
45
+ class InstalledScriptInfo :
46
+ """Information holder about a script that is to be installed."""
47
+
48
+ def __init__ (self , name ):
49
+ self .name = name
50
+ self .installName = os .path .splitext (name )[0 ]
51
+
52
+
45
53
chipDLLName = '_ChipDeviceCtrl.so'
46
- deviceManagerShellName = 'chip-device-ctrl.py'
47
- chipControllerShellInstalledName = os .path .splitext (deviceManagerShellName )[0 ]
48
54
packageName = args .package_name
49
55
chipPackageVer = args .build_number
50
56
57
+ installScripts = [
58
+ InstalledScriptInfo ('chip-device-ctrl.py' ),
59
+ InstalledScriptInfo ('chip-repl.py' ),
60
+ ]
61
+
51
62
# Record the current directory at the start of execution.
52
63
curDir = os .curdir
53
64
85
96
os .makedirs (os .path .dirname (dstFile ), exist_ok = True )
86
97
shutil .copyfile (srcFile , dstFile )
87
98
88
- os .rename (os .path .join (tmpDir , deviceManagerShellName ),
89
- os .path .join (tmpDir , chipControllerShellInstalledName ))
99
+ for script in installScripts :
100
+ os .rename (os .path .join (tmpDir , script .name ),
101
+ os .path .join (tmpDir , script .installName ))
90
102
91
103
# Define a custom version of the bdist_wheel command that configures the
92
104
# resultant wheel as platform-specific (i.e. not "pure").
93
105
class bdist_wheel_override (bdist_wheel ):
94
106
def finalize_options (self ):
95
107
bdist_wheel .finalize_options (self )
96
108
self .root_is_pure = False
109
+
110
+ requiredPackages = []
111
+
112
+ requiredPackages .append ('ipython' )
97
113
98
- # Select required packages based on the target system.
99
114
if platform .system () == 'Linux' :
100
- requiredPackages = [
101
- 'dbus-python' ,
102
- 'six' ,
103
- 'pygobject' ,
104
- ]
105
- else :
106
- requiredPackages = []
115
+ requiredPackages .append ('dbus-python' )
116
+ requiredPackages .append ('six' )
117
+ requiredPackages .append ('pygobject' )
107
118
108
119
#
109
120
# Build the chip package...
@@ -126,7 +137,8 @@ def finalize_options(self):
126
137
],
127
138
python_requires = '>=2.7' ,
128
139
packages = [
129
- packageName # Arrange to install a package named "chip"
140
+ 'chip' ,
141
+ 'chip.ble' ,
130
142
],
131
143
package_dir = {
132
144
'' :tmpDir , # By default, look in the tmp directory for packages/modules to be included.
@@ -136,9 +148,10 @@ def finalize_options(self):
136
148
chipDLLName # Include the wrapper DLL as package data in the "chip" package.
137
149
]
138
150
},
139
- scripts = [ # Install the Device controller Shell as an executable script in the 'bin' directory.
140
- os .path .join (tmpDir , chipControllerShellInstalledName )
141
- ],
151
+ scripts = [name for name in map (
152
+ lambda script : os .path .join (tmpDir , script .installName ),
153
+ installScripts
154
+ )],
142
155
install_requires = requiredPackages ,
143
156
options = {
144
157
'bdist_wheel' :{
0 commit comments