@@ -84,7 +84,7 @@ def run(self):
84
84
85
85
def prepare_build_dir (self ):
86
86
87
- if argv_contains ('--private' ):
87
+ if argv_contains ('--private' ) and not argv_contains ( '--launcher' ) :
88
88
print ('WARNING: Received --private argument when this would '
89
89
'normally be generated automatically.' )
90
90
print (' This is probably bad unless you meant to do '
@@ -105,27 +105,30 @@ def prepare_build_dir(self):
105
105
filens .extend (glob (pattern ))
106
106
107
107
main_py_dirs = []
108
- for filen in filens :
109
- new_dir = join (bdist_dir , dirname (filen ))
110
- if not exists (new_dir ):
111
- makedirs (new_dir )
112
- print ('Including {}' .format (filen ))
113
- copyfile (filen , join (bdist_dir , filen ))
114
- if basename (filen ) in ('main.py' , 'main.pyo' ):
115
- main_py_dirs .append (filen )
108
+ if not argv_contains ('--launcher' ):
109
+ for filen in filens :
110
+ new_dir = join (bdist_dir , dirname (filen ))
111
+ if not exists (new_dir ):
112
+ makedirs (new_dir )
113
+ print ('Including {}' .format (filen ))
114
+ copyfile (filen , join (bdist_dir , filen ))
115
+ if basename (filen ) in ('main.py' , 'main.pyo' ):
116
+ main_py_dirs .append (filen )
116
117
117
118
# This feels ridiculous, but how else to define the main.py dir?
118
119
# Maybe should just fail?
119
- if len ( main_py_dirs ) == 0 :
120
+ if not main_py_dirs and not argv_contains ( '--launcher' ) :
120
121
print ('ERROR: Could not find main.py, so no app build dir defined' )
121
122
print ('You should name your app entry point main.py' )
122
123
exit (1 )
123
124
if len (main_py_dirs ) > 1 :
124
125
print ('WARNING: Multiple main.py dirs found, using the shortest path' )
125
126
main_py_dirs = sorted (main_py_dirs , key = lambda j : len (split (j )))
126
127
127
- sys .argv .append ('--private={}' .format (join (realpath (curdir ), bdist_dir ,
128
- dirname (main_py_dirs [0 ]))))
128
+ if not argv_contains ('--launcher' ):
129
+ sys .argv .append ('--private={}' .format (
130
+ join (realpath (curdir ), bdist_dir , dirname (main_py_dirs [0 ])))
131
+ )
129
132
130
133
131
134
def _set_user_options ():
0 commit comments