Commit eaf73ab7 authored by Tres Seaver's avatar Tres Seaver

Add support for PyPy.

parent 6ecf9838
...@@ -5,6 +5,8 @@ CHANGES ...@@ -5,6 +5,8 @@ CHANGES
4.0.0 (unreleased) 4.0.0 (unreleased)
------------------ ------------------
- Added support for PyPy.
- Added a pure-Python fallback implementations of ``zope.proxy.ProxyBase`` - Added a pure-Python fallback implementations of ``zope.proxy.ProxyBase``
and the proxy module API functions. and the proxy module API functions.
......
...@@ -18,12 +18,35 @@ ...@@ -18,12 +18,35 @@
############################################################################## ##############################################################################
"""Setup for zope.proxy package """Setup for zope.proxy package
""" """
import os, sys import os
from setuptools import setup, Extension import platform
from setuptools import setup, Extension, Feature
def read(*rnames): def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read() return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
Cwrapper = Feature(
"C wrapper",
standard = True,
ext_modules=[Extension("zope.proxy._zope_proxy_proxy",
[os.path.join('src', 'zope', 'proxy',
"_zope_proxy_proxy.c")
],
extra_compile_args=['-g']),
],
)
# PyPy won't build the extension.
py_impl = getattr(platform, 'python_implementation', lambda: None)
is_pypy = py_impl() == 'PyPy'
if is_pypy:
features = {}
headers = []
else:
features = {'Cwrapper': Cwrapper}
headers=[os.path.join('src', 'zope', 'proxy', 'proxy.h')],
setup(name='zope.proxy', setup(name='zope.proxy',
version = '4.0.0dev', version = '4.0.0dev',
author='Zope Foundation and Contributors', author='Zope Foundation and Contributors',
...@@ -46,20 +69,16 @@ setup(name='zope.proxy', ...@@ -46,20 +69,16 @@ setup(name='zope.proxy',
'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English', 'Natural Language :: English',
'Operating System :: OS Independent'], 'Operating System :: OS Independent'],
keywords='proxy generic transparent', keywords='proxy generic transparent',
packages=['zope', 'zope.proxy'], packages=['zope', 'zope.proxy'],
package_dir = {'': 'src'}, package_dir = {'': 'src'},
namespace_packages=['zope',], namespace_packages=['zope',],
features=features,
headers=[os.path.join('src', 'zope', 'proxy', 'proxy.h')], headers=headers,
ext_modules=[Extension("zope.proxy._zope_proxy_proxy",
[os.path.join('src', 'zope', 'proxy',
"_zope_proxy_proxy.c")
]),
],
test_suite = 'zope.proxy', test_suite = 'zope.proxy',
install_requires=[ install_requires=[
'zope.interface', 'zope.interface',
......
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