[Checkins] SVN: BTrees/trunk/ Provide local fallback for persistent C header inclusion if the persistent distribution isn't installed. This makes the winbot happy.

Hano Schlichting cvs-admin at zope.org
Sun Oct 21 12:51:34 UTC 2012


Log message for revision 128089:
  Provide local fallback for persistent C header inclusion if the persistent distribution isn't installed. This makes the winbot happy.
  

Changed:
  U   BTrees/trunk/CHANGES.txt
  A   BTrees/trunk/include/
  U   BTrees/trunk/setup.py

-=-
Modified: BTrees/trunk/CHANGES.txt
===================================================================
--- BTrees/trunk/CHANGES.txt	2012-10-21 04:28:07 UTC (rev 128088)
+++ BTrees/trunk/CHANGES.txt	2012-10-21 12:51:29 UTC (rev 128089)
@@ -5,7 +5,8 @@
 4.0.1 (unreleased)
 ------------------
 
-- TBD
+- Provide local fallback for persistent C header inclusion if the
+  persistent distribution isn't installed. This makes the winbot happy.
 
 
 4.0.0 (2012-10-20)


Property changes on: BTrees/trunk/include
___________________________________________________________________
Added: svn:ignore
   + *

Added: svn:externals
   + persistent svn://svn.zope.org/repos/main/persistent/tags/4.0.2/persistent


Modified: BTrees/trunk/setup.py
===================================================================
--- BTrees/trunk/setup.py	2012-10-21 04:28:07 UTC (rev 128088)
+++ BTrees/trunk/setup.py	2012-10-21 12:51:29 UTC (rev 128089)
@@ -29,8 +29,10 @@
           open(os.path.join(here, 'CHANGES.txt')).read())
 
 # Include directories for C extensions
-# Sniff the location of the headers in 'persistent'.
+# Sniff the location of the headers in 'persistent' or fall back
+# to local headers in the include sub-directory
 
+
 class ModuleHeaderDir(object):
 
     def __init__(self, require_spec, where='..'):
@@ -44,9 +46,13 @@
     def __str__(self):
         from pkg_resources import require
         from pkg_resources import resource_filename
-        require(self._require_spec)
-        return os.path.abspath(
-                    resource_filename(self._require_spec, self._where))
+        from pkg_resources import DistributionNotFound
+        try:
+            require(self._require_spec)
+            path = resource_filename(self._require_spec, self._where)
+        except DistributionNotFound:
+            path = os.path.join(here, 'include')
+        return os.path.abspath(path)
 
 include = [ModuleHeaderDir('persistent')]
 



More information about the checkins mailing list