[Checkins] SVN: zope.security/trunk/ Merge tseaver-no_svn_external branch.

Tres Seaver cvs-admin at zope.org
Wed Dec 19 20:59:49 UTC 2012


Log message for revision 128796:
  Merge tseaver-no_svn_external branch.

Changed:
  _U  zope.security/trunk/
  A   zope.security/trunk/.bzrignore
  U   zope.security/trunk/CHANGES.txt
  U   zope.security/trunk/buildout.cfg
  D   zope.security/trunk/include/
  U   zope.security/trunk/setup.py
  U   zope.security/trunk/src/zope/security/_proxy.c

-=-

Property changes on: zope.security/trunk
___________________________________________________________________
Added: svn:mergeinfo
   + /zope.security/branches/tseaver-no_svn_external:128791,128793-128795

Added: svk:merge
   + 62d5b8a3-27da-0310-9561-8e5933582275:/zope.security/branches/tseaver-no_svn_external:128795


Copied: zope.security/trunk/.bzrignore (from rev 128795, zope.security/branches/tseaver-no_svn_external/.bzrignore)
===================================================================
--- zope.security/trunk/.bzrignore	                        (rev 0)
+++ zope.security/trunk/.bzrignore	2012-12-19 20:59:47 UTC (rev 128796)
@@ -0,0 +1,8 @@
+.installed.cfg
+bin
+build
+develop-eggs
+eggs
+parts
+*.egg
+*.egg-info

Modified: zope.security/trunk/CHANGES.txt
===================================================================
--- zope.security/trunk/CHANGES.txt	2012-12-19 19:33:19 UTC (rev 128795)
+++ zope.security/trunk/CHANGES.txt	2012-12-19 20:59:47 UTC (rev 128796)
@@ -5,6 +5,9 @@
 4.0.0 (unreleased)
 ------------------
 
+- Enabled building extensions without the 'svn:external' of the ``zope.proxy``
+  headers into our 'include' dir.
+
 - Bumped ``zope.proxy`` dependency to ">= 4.1.0" to enable compilation
   on Py3k.
 

Modified: zope.security/trunk/buildout.cfg
===================================================================
--- zope.security/trunk/buildout.cfg	2012-12-19 19:33:19 UTC (rev 128795)
+++ zope.security/trunk/buildout.cfg	2012-12-19 20:59:47 UTC (rev 128796)
@@ -1,23 +1,34 @@
 [buildout]
 develop = .
-parts = test python coverage-test coverage-report
+parts =
+    test
+    python
+    coverage-test
+    coverage-report
 
 [test]
 recipe = zc.recipe.testrunner
-eggs = zope.security [test,untrustedpython,zcml,pytz]
+eggs =
+    zope.proxy >= 4.1.0
+    zope.security [test,untrustedpython,zcml,pytz]
 
 [python]
 recipe = zc.recipe.egg
-eggs = zope.security [untrustedpython]
+eggs =
+    zope.proxy >= 4.1.0
+    zope.security [untrustedpython]
 interpreter = python
 
 [coverage-test]
 recipe = zc.recipe.testrunner
-eggs = zope.security [test]
+eggs =
+    zope.proxy >= 4.1.0
+    zope.security [test]
 defaults = ['--coverage', '../../coverage']
 
 [coverage-report]
 recipe = zc.recipe.egg
-eggs = z3c.coverage
+eggs =
+    z3c.coverage
 scripts = coverage=coverage-report
 arguments = ('coverage', 'coverage/report')

Modified: zope.security/trunk/setup.py
===================================================================
--- zope.security/trunk/setup.py	2012-12-19 19:33:19 UTC (rev 128795)
+++ zope.security/trunk/setup.py	2012-12-19 20:59:47 UTC (rev 128796)
@@ -19,11 +19,65 @@
 """Setup for zope.security package
 """
 import os
-from setuptools import setup, find_packages, Extension
+import platform
+import sys
+from setuptools import setup, find_packages, Extension, Feature
 
+here = os.path.abspath(os.path.dirname(__file__))
 def read(*rnames):
     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 
+# Include directories for C extensions
+# 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='../..'):
+        # By default, assume top-level pkg has the same name as the dist.
+        # Also assume that headers are located in the package dir, and
+        # are meant to be included as follows:
+        #    #include "module/header_name.h"
+        self._require_spec = require_spec
+        self._where = where
+
+    def __str__(self):
+        from pkg_resources import require
+        from pkg_resources import resource_filename
+        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('zope.proxy')]
+
+# Jython cannot build the C optimizations, while on PyPy they are
+# anti-optimizations (the C extension compatibility layer is known-slow,
+# and defeats JIT opportunities).
+py_impl = getattr(platform, 'python_implementation', lambda: None)
+pure_python = os.environ.get('PURE_PYTHON', False)
+is_pypy = py_impl() == 'PyPy'
+is_jython = 'java' in sys.platform
+
+if pure_python or is_pypy or is_jython:
+    setup_requires = []
+    ext_modules = []
+else:
+    setup_requires = ['zope.proxy >= 4.1.0']
+    ext_modules = [
+        Extension("zope.security._proxy",
+                  [os.path.join('src', 'zope', 'security', "_proxy.c")],
+                  include_dirs=include,
+                 ),
+        Extension("zope.security._zope_security_checker",
+                  [os.path.join('src', 'zope', 'security',
+                                        "_zope_security_checker.c")]
+                 ),
+    ]
+
 setup(name='zope.security',
       version='4.0.0dev',
       author='Zope Foundation and Contributors',
@@ -54,15 +108,8 @@
       packages=find_packages('src'),
       package_dir = {'': 'src'},
       namespace_packages=['zope'],
-      ext_modules=[Extension("zope.security._proxy",
-                             [os.path.join('src', 'zope', 'security',
-                                           "_proxy.c")
-                              ], include_dirs=['include']),
-                   Extension("zope.security._zope_security_checker",
-                             [os.path.join('src', 'zope', 'security',
-                                           "_zope_security_checker.c")
-                              ]),
-                   ],
+      setup_requires=setup_requires,
+      ext_modules=ext_modules,
       install_requires=['setuptools',
                         'zope.component',
                         'zope.i18nmessageid',

Modified: zope.security/trunk/src/zope/security/_proxy.c
===================================================================
--- zope.security/trunk/src/zope/security/_proxy.c	2012-12-19 19:33:19 UTC (rev 128795)
+++ zope.security/trunk/src/zope/security/_proxy.c	2012-12-19 20:59:47 UTC (rev 128796)
@@ -15,7 +15,7 @@
 */
 
 #include <Python.h>
-#include "zope.proxy/proxy.h"
+#include "zope/proxy/proxy.h"
 
 static PyObject *__class__str = 0, *__name__str = 0, *__module__str = 0;
 



More information about the checkins mailing list