Mercurial > hg
comparison setup.py @ 32251:a04f5c651e52
policy: relax the default for in-place build
We're going to make the 'c' policy more strict, where no missing attribute
will be allowed. Since we want to run 'hg bisect' without rebuilding the C
extension modules, we'll need a looser policy for development environment.
The default for system installation isn't changed.
Note that the current 'c' policy is practically 'allow'-ish as we have lots
of adhoc fallbacks to pure functions.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 26 Apr 2017 23:02:43 +0900 |
parents | feb910d2f59b |
children | a9c71d578a1c |
comparison
equal
deleted
inserted
replaced
32250:8a137ef6e5da | 32251:a04f5c651e52 |
---|---|
370 'Mercurial but weren\'t found in %s' % h) | 370 'Mercurial but weren\'t found in %s' % h) |
371 | 371 |
372 def run(self): | 372 def run(self): |
373 if self.distribution.pure: | 373 if self.distribution.pure: |
374 modulepolicy = 'py' | 374 modulepolicy = 'py' |
375 elif self.build_lib == '.': | |
376 # in-place build should run without rebuilding C extensions | |
377 modulepolicy = 'allow' | |
375 else: | 378 else: |
376 modulepolicy = 'c' | 379 modulepolicy = 'c' |
377 with open("mercurial/__modulepolicy__.py", "w") as f: | 380 with open("mercurial/__modulepolicy__.py", "w") as f: |
378 f.write('# this file is autogenerated by setup.py\n') | 381 f.write('# this file is autogenerated by setup.py\n') |
379 f.write('modulepolicy = b"%s"\n' % modulepolicy) | 382 f.write('modulepolicy = b"%s"\n' % modulepolicy) |