File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -221,29 +221,28 @@ The should_build method
221221~~~~~~~~~~~~~~~~~~~~~~~
222222
223223The 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
228229By default, should_build returns True, but you can override it however
229230you like. For instance, PythonRecipe and its subclasses all replace it
230231with a check for whether the recipe is already installed in the Python
231232distribution::
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-
247246Using a PythonRecipe
248247--------------------
249248
You can’t perform that action at this time.
0 commit comments