MCPcopy Index your code
hub / github.com/kivy/python-for-android / build_dist_from_args

Function build_dist_from_args

pythonforandroid/toolchain.py:124–174  ·  view source on GitHub ↗

Parses out any bootstrap related arguments, and uses them to build a dist.

(ctx, dist, args)

Source from the content-addressed store, hash-verified

122
123
124def build_dist_from_args(ctx, dist, args):
125 """Parses out any bootstrap related arguments, and uses them to build
126 a dist."""
127 bs = Bootstrap.get_bootstrap(args.bootstrap, ctx)
128 blacklist = getattr(args, "blacklist_requirements", "").split(",")
129 if len(blacklist) == 1 and blacklist[0] == "":
130 blacklist = []
131 build_order, python_modules, bs = (
132 get_recipe_order_and_bootstrap(
133 ctx, dist.recipes, bs,
134 blacklist=blacklist
135 ))
136 assert set(build_order).intersection(set(python_modules)) == set()
137 ctx.recipe_build_order = build_order
138 ctx.python_modules = python_modules
139
140 info('The selected bootstrap is {}'.format(bs.name))
141 info_main('# Creating dist with {} bootstrap'.format(bs.name))
142 bs.distribution = dist
143 info_notify('Dist will have name {} and requirements ({})'.format(
144 dist.name, ', '.join(dist.recipes)))
145 info('Dist contains the following requirements as recipes: {}'.format(
146 ctx.recipe_build_order))
147 info('Dist will also contain modules ({}) installed from pip'.format(
148 ', '.join(ctx.python_modules)))
149 info(
150 'Dist will be build in mode {build_mode}{with_debug_symbols}'.format(
151 build_mode='debug' if ctx.build_as_debuggable else 'release',
152 with_debug_symbols=' (with debug symbols)'
153 if ctx.with_debug_symbols
154 else '',
155 )
156 )
157
158 ctx.distribution = dist
159 ctx.prepare_bootstrap(bs)
160 if dist.needs_build:
161 ctx.prepare_dist()
162
163 build_recipes(build_order, python_modules, ctx,
164 getattr(args, "private", None),
165 ignore_project_setup_py=getattr(
166 args, "ignore_setup_py", False
167 ),
168 )
169
170 ctx.bootstrap.assemble_distribution()
171
172 info_main('# Your distribution was created successfully, exiting.')
173 info('Dist can be found at (for now) {}'
174 .format(join(ctx.dist_dir, ctx.distribution.dist_dir)))
175
176
177def split_argument_list(arg_list):

Callers 1

wrapper_funcFunction · 0.85

Calls 9

info_mainFunction · 0.90
info_notifyFunction · 0.90
build_recipesFunction · 0.90
get_bootstrapMethod · 0.80
formatMethod · 0.80
prepare_bootstrapMethod · 0.80
prepare_distMethod · 0.80
assemble_distributionMethod · 0.45

Tested by

no test coverage detected