[Checkins] SVN: zope.interface/branches/regebro-python3/ Passing all tests on all supported versions as of now.

Lennart Regebro regebro at gmail.com
Sat Dec 5 02:47:39 EST 2009


Log message for revision 106211:
  Passing all tests on all supported versions as of now.
  
  

Changed:
  A   zope.interface/branches/regebro-python3/build_ext_3.py
  U   zope.interface/branches/regebro-python3/setup.py

-=-
Added: zope.interface/branches/regebro-python3/build_ext_3.py
===================================================================
--- zope.interface/branches/regebro-python3/build_ext_3.py	                        (rev 0)
+++ zope.interface/branches/regebro-python3/build_ext_3.py	2009-12-05 07:47:32 UTC (rev 106211)
@@ -0,0 +1,40 @@
+import os
+import sys
+from distutils.errors import (CCompilerError, DistutilsExecError, 
+                              DistutilsPlatformError)
+try:
+    from setuptools.command.build_ext import build_ext
+    from pkg_resources import (normalize_path, working_set, 
+                               add_activation_listener, require)
+except ImportError:
+    from distutils.command.build_ext import build_ext
+    
+
+class optional_build_ext(build_ext):
+    """This class subclasses build_ext and allows
+       the building of C extensions to fail.
+    """
+    def run(self):
+        try:
+            build_ext.run(self)
+        
+        except DistutilsPlatformError as e:
+            self._unavailable(e)
+
+    def build_extension(self, ext):
+        try:
+            build_ext.build_extension(self, ext)
+        
+        except (CCompilerError, DistutilsExecError) as e:
+            self._unavailable(e)
+
+    def _unavailable(self, e):
+        print('*' * 80, file=sys.stderr)
+        print("""WARNING:
+
+        An optional code optimization (C extension) could not be compiled.
+
+        Optimizations for this package will not be available!""", file=sys.stderr)
+        print(file=sys.stderr)
+        print(e, file=sys.stderr)
+        print('*' * 80, file=sys.stderr)

Modified: zope.interface/branches/regebro-python3/setup.py
===================================================================
--- zope.interface/branches/regebro-python3/setup.py	2009-12-04 21:32:18 UTC (rev 106210)
+++ zope.interface/branches/regebro-python3/setup.py	2009-12-05 07:47:32 UTC (rev 106211)
@@ -89,8 +89,8 @@
     from build_ext_3 import optional_build_ext
     # This is Python 3. Setuptools is now required, and so is zope.fixers.
     extra['install_requires'] = ['setuptools', 'zope.fixers' ],
-    extra['run_2to3'] = True
-    extra['convert_doctests_2to3'] = [
+    extra['use_2to3'] = True
+    extra['convert_2to3_doctests'] = [
         'src/zope/interface/README.ru.txt',
         'src/zope/interface/README.txt',
         'src/zope/interface/adapter.ru.txt',
@@ -100,7 +100,7 @@
         'src/zope/interface/index.txt',
         'src/zope/interface/verify.txt',
         ]
-    extra['additional_2to3_fixers'] = ['zope.fixers']
+    extra['use_2to3_fixers'] = ['zope.fixers']
 
 except (ImportError, SyntaxError):
     from build_ext_2 import optional_build_ext



More information about the checkins mailing list