Rev 5037: Require pyrex 0.9.6.3 as the minimum version to build the static_tuple extensions. in http://bazaar.launchpad.net/~jameinel/bzr/2.2.0b1-minimum-pyrex

John Arbash Meinel john at arbash-meinel.com
Wed Feb 17 16:52:31 GMT 2010


At http://bazaar.launchpad.net/~jameinel/bzr/2.2.0b1-minimum-pyrex

------------------------------------------------------------
revno: 5037
revision-id: john at arbash-meinel.com-20100217165203-z0gek2k0nk9uhxrz
parent: pqm at pqm.ubuntu.com-20100216005304-1p8xafkhiizh6ugi
fixes bug(s): https://launchpad.net/bugs/449776
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.2.0b1-minimum-pyrex
timestamp: Wed 2010-02-17 10:52:03 -0600
message:
  Require pyrex 0.9.6.3 as the minimum version to build the static_tuple extensions.
  
  bug #449776
-------------- next part --------------
=== modified file 'setup.py'
--- a/setup.py	2010-01-29 10:36:23 +0000
+++ b/setup.py	2010-02-17 16:52:03 +0000
@@ -186,6 +186,7 @@
     from distutils.command.build_ext import build_ext
 else:
     have_pyrex = True
+    pyrex_version_info = map(int, pyrex_version.split('.'))
 
 
 class build_ext_if_possible(build_ext):
@@ -282,7 +283,7 @@
     add_pyrex_extension('bzrlib._walkdirs_win32')
     z_lib = 'zdll'
 else:
-    if have_pyrex and pyrex_version.startswith('0.9.4'):
+    if have_pyrex and pyrex_version_info[:3] == (0,9,4):
         # Pyrex 0.9.4.1 fails to compile this extension correctly
         # The code it generates re-uses a "local" pointer and
         # calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
@@ -301,9 +302,19 @@
 add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
 ext_modules.append(Extension('bzrlib._patiencediff_c',
                              ['bzrlib/_patiencediff_c.c']))
-add_pyrex_extension('bzrlib._simple_set_pyx')
-ext_modules.append(Extension('bzrlib._static_tuple_c',
-                             ['bzrlib/_static_tuple_c.c']))
+if have_pyrex and pyrex_version_info < (0, 9, 6, 3):
+    print
+    print 'Your Pyrex/Cython version %s is too old to build the simple_set' % (
+        pyrex_version)
+    print 'and static_tuple extensions.'
+    print 'Please upgrade to at least Pyrex 0.9.6.3'
+    print
+else:
+    # We only need 0.9.6.3 to build _simple_set_pyx, but static_tuple depends
+    # on simple_set
+    add_pyrex_extension('bzrlib._simple_set_pyx')
+    ext_modules.append(Extension('bzrlib._static_tuple_c',
+                                 ['bzrlib/_static_tuple_c.c']))
 add_pyrex_extension('bzrlib._btree_serializer_pyx')
 
 



More information about the bazaar-commits mailing list