Ticket #3586: 3586.no-speedups.patch

File 3586.no-speedups.patch, 1.7 KB (added by techtonik, 4 years ago)
  • twisted/python/dist.py

     
    77""" 
    88 
    99import sys, os 
     10from distutils.command import build 
    1011from distutils.command import build_scripts, install_data, build_ext, build_py 
    1112from distutils.errors import CompileError 
    1213from distutils import core 
    13 from distutils.core import Extension 
     14from distutils.core import Extension, Distribution 
    1415 
    1516twisted_subprojects = ["conch", "lore", "mail", "names", 
    1617                       "news", "pair", "runner", "web", 
     
    7677    if 'cmdclass' not in kw: 
    7778        kw['cmdclass'] = { 
    7879            'install_data': install_data_twisted, 
     80            'build': build_twisted, 
    7981            'build_scripts': build_scripts_twisted} 
    8082        if sys.version_info[:3] < (2, 3, 0): 
    8183            kw['cmdclass']['build_py'] = build_py_twisted 
     
    253255 
    254256## Helpers and distutil tweaks 
    255257 
     258# Global --no-speedups option to install Twisted without extensions - #3586 
     259 
     260Distribution.global_options.append(('no-speedups', None, 'skip C extensions')) 
     261Distribution.no_speedups = 0 
     262 
     263 
    256264class build_py_twisted(build_py.build_py): 
    257265    """ 
    258266    Changes behavior in Python 2.2 to support simultaneous specification of 
     
    301309    Allow subclasses to easily detect and customize Extensions to 
    302310    build at install-time. 
    303311    """ 
     312    def finalize_options(self): 
     313        """ 
     314        Clean extension list if global --no-speedups option is set. 
     315        """ 
     316        build_ext.build_ext.finalize_options(self) 
     317        if self.distribution.no_speedups: 
     318            self.extensions = [] 
    304319 
    305320    def prepare_extensions(self): 
    306321        """