Commit 44912238 authored by Tres Seaver's avatar Tres Seaver

Merge branch 'master' of https://github.com/NextThought/zope.container into NextThought-master

parents 3e12e6f9 f4bc6d6f
......@@ -5,7 +5,7 @@ CHANGES
4.0.0a4 (unreleased)
--------------------
- Nothing changed yet.
- Support PyPy.
4.0.0a3 (2013-02-28)
......
......@@ -19,6 +19,8 @@
"""Setup for zope.container package
"""
import os
import platform
import sys
from setuptools import setup, find_packages, Extension
def read(*rnames):
......@@ -39,6 +41,22 @@ def alltests():
suites = list(zope.testrunner.find.find_suites(options))
return unittest.TestSuite(suites)
# PyPy cannot correctly build the C optimizations, and even if it
# could they would be 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'
if pure_python or is_pypy:
ext_modules = []
else:
ext_modules = [Extension("zope.container._zope_container_contained",
[os.path.join("src", "zope", "container",
"_zope_container_contained.c")
], include_dirs=['include']),
]
setup(name='zope.container',
version='4.0.0a4.dev0',
author='Zope Foundation and Contributors',
......@@ -66,6 +84,7 @@ setup(name='zope.container',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
......@@ -76,11 +95,7 @@ setup(name='zope.container',
packages=find_packages('src'),
package_dir = {'': 'src'},
namespace_packages=['zope'],
ext_modules=[Extension("zope.container._zope_container_contained",
[os.path.join("src", "zope", "container",
"_zope_container_contained.c")
], include_dirs=['include']),
],
ext_modules=ext_modules,
extras_require=dict(
test=['zope.testing', 'zope.testrunner'
],
......
This diff is collapsed.
......@@ -214,7 +214,7 @@ WrapperType_Lookup(PyTypeObject *type, PyObject *name)
base = PyTuple_GET_ITEM(mro, i);
if (((PyTypeObject *)base) != &ProxyType) {
#if PY_MAJOR_VERSION < 3
#if PY_MAJOR_VERSION < 3 && !defined(PYPY_VERSION)
if (PyClass_Check(base))
dict = ((PyClassObject *)base)->cl_dict;
else
......@@ -1253,4 +1253,3 @@ MOD_INIT(_zope_proxy_proxy)
return MOD_SUCCESS_VAL(m);
}
......@@ -29,8 +29,12 @@ from zope.location.interfaces import IContained
from zope.container.interfaces import INameChooser
from zope.container.interfaces import IReservedNames, NameReserved
from zope.container.interfaces import IContainerModifiedEvent
from zope.container._zope_container_contained import ContainedProxyBase
from zope.container._zope_container_contained import getProxiedObject
try:
from zope.container._zope_container_contained import ContainedProxyBase
from zope.container._zope_container_contained import getProxiedObject
except ImportError: # PyPy
from zope.container._proxy import py_getProxiedObject as getProxiedObject
from zope.container._proxy import PyContainedProxyBase as ContainedProxyBase
from zope.lifecycleevent import ObjectMovedEvent
from zope.lifecycleevent import ObjectAddedEvent
......@@ -956,4 +960,3 @@ class ContainedProxy(ContainedProxyBase):
DecoratedSecurityCheckerDescriptor())
ContainedProxy.__provides__ = ContainedProxyClassProvides(ContainedProxy, type)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment