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
221
221
~~~~~~~~~~~~~~~~~~~~~~~
222
222
223
223
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.
227
228
228
229
By default, should_build returns True, but you can override it however
229
230
you like. For instance, PythonRecipe and its subclasses all replace it
230
231
with a check for whether the recipe is already installed in the Python
231
232
distribution::
232
233
233
- def should_build(self):
234
+ def should_build(self, arch ):
234
235
name = self.site_packages_name
235
236
if name is None:
236
237
name = self.name
237
- if exists(join( self.ctx.get_site_packages_dir(), name) ):
238
+ if self.ctx.has_package( name):
238
239
info('Python package already exists in site-packages')
239
240
return False
240
- print('site packages', self.ctx.get_site_packages_dir())
241
241
info('{} apparently isn\'t already in site-packages'.format(name))
242
242
return True
243
243
244
244
245
245
246
-
247
246
Using a PythonRecipe
248
247
--------------------
249
248
You can’t perform that action at this time.
0 commit comments