8000 Updated should_build doc · latin1593/python-for-android@c75b6bd · GitHub
[go: up one dir, main page]

Skip to content

Commit c75b6bd

Browse files
committed
Updated should_build doc
1 parent bf350e9 commit c75b6bd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

doc/source/recipes.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,29 +221,28 @@ The should_build method
221221
~~~~~~~~~~~~~~~~~~~~~~~
222222

223223
The Recipe class has a ``should_build`` method, which returns a
224-
boolean. This is called before running ``build_arch``, and if it
225-
returns False then the build is skipped. This is useful to avoid
226-
building a recipe more than once for different dists.
224+
boolean. This is called for each architecture before running
225+
``build_arch``, and if it returns False then the build is
226+
skipped. This is useful to avoid building a recipe more than once for
227+
different dists.
227228

228229
By default, should_build returns True, but you can override it however
229230
you like. For instance, PythonRecipe and its subclasses all replace it
230231
with a check for whether the recipe is already installed in the Python
231232
distribution::
232233

233-
def should_build(self):
234+
def should_build(self, arch):
234235
name = self.site_packages_name
235236
if name is None:
236237
name = self.name
237-
if exists(join(self.ctx.get_site_packages_dir(), name)):
238+
if self.ctx.has_package(name):
238239
info('Python package already exists in site-packages')
239240
return False
240-
print('site packages', self.ctx.get_site_packages_dir())
241241
info('{} apparently isn\'t already in site-packages'.format(name))
242242
return True
243243

244244

245245

246-
247246
Using a PythonRecipe
248247
--------------------
249248

0 commit comments

Comments
 (0)
0