setup.py
changeset 42451 810f66b468cd
parent 42175 cd1bede340b0
child 42453 94167e701e12
equal deleted inserted replaced
42450:9d31581cc44e 42451:810f66b468cd
   554         self.mkpath(basepath)
   554         self.mkpath(basepath)
   555 
   555 
   556         if self.distribution.pure:
   556         if self.distribution.pure:
   557             modulepolicy = 'py'
   557             modulepolicy = 'py'
   558         elif self.build_lib == '.':
   558         elif self.build_lib == '.':
   559             # in-place build should run without rebuilding C extensions
   559             # in-place build should run without rebuilding C
   560             modulepolicy = 'allow'
   560             # and Rust extensions
       
   561             if hgrustext == 'cpython':
       
   562                 modulepolicy = 'rust+c-allow'
       
   563             else:
       
   564                 modulepolicy = 'allow'
   561         else:
   565         else:
   562             modulepolicy = 'c'
   566             if hgrustext == 'cpython':
       
   567                 modulepolicy = 'rust+c'
       
   568             else:
       
   569                 modulepolicy = 'c'
   563 
   570 
   564         content = b''.join([
   571         content = b''.join([
   565             b'# this file is autogenerated by setup.py\n',
   572             b'# this file is autogenerated by setup.py\n',
   566             b'modulepolicy = b"%s"\n' % modulepolicy.encode('ascii'),
   573             b'modulepolicy = b"%s"\n' % modulepolicy.encode('ascii'),
   567         ])
   574         ])