Commit 8a77d12c authored by Tres Seaver's avatar Tres Seaver

Merge branch 'pypy-py3k' of git://github.com/NextThought/Acquisition into NextThought-pypy-py3k

parents 2667b34d ba35cf6f
...@@ -3,6 +3,8 @@ sudo: false ...@@ -3,6 +3,8 @@ sudo: false
python: python:
- 2.6 - 2.6
- 2.7 - 2.7
- 3.4
- pypy
install: install:
- python bootstrap.py - python bootstrap.py
- bin/buildout - bin/buildout
......
Changelog Changelog
========= =========
4.2 (unreleased)
----------------
- Add support for PyPy and Python 3.
4.1 (2014-12-18) 4.1 (2014-12-18)
---------------- ----------------
...@@ -62,7 +67,7 @@ Changelog ...@@ -62,7 +67,7 @@ Changelog
- Add ``aq_explicit`` to ``IAcquisitionWrapper``. - Add ``aq_explicit`` to ``IAcquisitionWrapper``.
- Fixed bug: ``unicode(wrapped)`` was not calling a ``__unicode__`` - Fixed bug: ``unicode(wrapped)`` was not calling a ``__unicode__``
method on wrapped objects. method on wrapped objects.
2.13.5 (2010-09-29) 2.13.5 (2010-09-29)
...@@ -133,7 +138,7 @@ Changelog ...@@ -133,7 +138,7 @@ Changelog
2.12.2 (2009-08-02) 2.12.2 (2009-08-02)
------------------- -------------------
- Fixed 64-bit compatibility issues for Python 2.5.x / 2.6.x. See - Fixed 64-bit compatibility issues for Python 2.5.x / 2.6.x. See
http://www.python.org/dev/peps/pep-0353/ for details. http://www.python.org/dev/peps/pep-0353/ for details.
2.12.1 (2009-04-15) 2.12.1 (2009-04-15)
......
...@@ -34,7 +34,7 @@ class. For example:: ...@@ -34,7 +34,7 @@ class. For example::
>>> class A(Acquisition.Implicit): >>> class A(Acquisition.Implicit):
... def report(self): ... def report(self):
... print self.color ... print(self.color)
... ...
>>> a = A() >>> a = A()
>>> c = C() >>> c = C()
...@@ -107,7 +107,7 @@ When explicit acquisition is used, attributes are not automatically ...@@ -107,7 +107,7 @@ When explicit acquisition is used, attributes are not automatically
obtained from the environment. Instead, the method aq_acquire must be obtained from the environment. Instead, the method aq_acquire must be
used. For example:: used. For example::
>>> print c.a.aq_acquire('color') >>> print(c.a.aq_acquire('color'))
red red
To support explicit acquisition, your class should inherit from the To support explicit acquisition, your class should inherit from the
...@@ -178,7 +178,7 @@ Here's an example:: ...@@ -178,7 +178,7 @@ Here's an example::
>>> class E(Explicit, HandyForTesting): pass >>> class E(Explicit, HandyForTesting): pass
... ...
>>> class Nice(HandyForTesting): >>> class Nice(HandyForTesting):
... isNice = 1 ... isNice = 1
... def __str__(self): ... def __str__(self):
... return HandyForTesting.__str__(self)+' and I am nice!' ... return HandyForTesting.__str__(self)+' and I am nice!'
... __repr__ = __str__ ... __repr__ = __str__
...@@ -192,7 +192,7 @@ Here's an example:: ...@@ -192,7 +192,7 @@ Here's an example::
>>> def find_nice(self, ancestor, name, object, extra): >>> def find_nice(self, ancestor, name, object, extra):
... return hasattr(object,'isNice') and object.isNice ... return hasattr(object,'isNice') and object.isNice
>>> print a.b.c.aq_acquire('p', find_nice) >>> print(a.b.c.aq_acquire('p', find_nice))
spam(Nice) and I am nice! spam(Nice) and I am nice!
The filtered acquisition in the last line skips over the first The filtered acquisition in the last line skips over the first
...@@ -221,7 +221,7 @@ method. For example:: ...@@ -221,7 +221,7 @@ method. For example::
>>> a = C() >>> a = C()
>>> b = C() >>> b = C()
>>> a.color = "red" >>> a.color = "red"
>>> print b.__of__(a).color >>> print(b.__of__(a).color)
red red
In this case, ``a`` does not contain ``b``, but it is put in ``b``'s In this case, ``a`` does not contain ``b``, but it is put in ``b``'s
...@@ -241,7 +241,7 @@ acquisition context that includes non-container objects:: ...@@ -241,7 +241,7 @@ acquisition context that includes non-container objects::
>>> a.b.color = "red" >>> a.b.color = "red"
>>> a.x = C("x") >>> a.x = C("x")
>>> print a.b.x.color >>> print(a.b.x.color)
red red
Even though ``b`` does not contain ``x``, ``x`` can acquire the color Even though ``b`` does not contain ``x``, ``x`` can acquire the color
...@@ -262,7 +262,7 @@ If in the example above suppose both a and b have an color attribute:: ...@@ -262,7 +262,7 @@ If in the example above suppose both a and b have an color attribute::
>>> a.b.color = "red" >>> a.b.color = "red"
>>> a.x = C("x") >>> a.x = C("x")
>>> print a.b.x.color >>> print(a.b.x.color)
green green
Why does ``a.b.x.color`` acquire color from ``a`` and not from ``b``? Why does ``a.b.x.color`` acquire color from ``a`` and not from ``b``?
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
"""Setup for the Acquisition distribution """Setup for the Acquisition distribution
""" """
import os import os
import platform
import sys
from setuptools import setup, find_packages, Extension from setuptools import setup, find_packages, Extension
with open('README.rst') as f: with open('README.rst') as f:
...@@ -22,9 +24,24 @@ with open('README.rst') as f: ...@@ -22,9 +24,24 @@ with open('README.rst') as f:
with open('CHANGES.rst') as f: with open('CHANGES.rst') as f:
CHANGES = f.read() CHANGES = f.read()
# PyPy won't build the extension.
py_impl = getattr(platform, 'python_implementation', lambda: None)
is_pypy = py_impl() == 'PyPy'
is_pure = 'PURE_PYTHON' in os.environ
py3k = sys.version_info >= (3, )
if is_pypy or is_pure or py3k:
ext_modules = []
else:
ext_modules=[Extension("Acquisition._Acquisition",
[os.path.join('src', 'Acquisition',
'_Acquisition.c')],
include_dirs=['include', 'src']),
]
setup( setup(
name='Acquisition', name='Acquisition',
version='4.1', version='4.2.dev0',
url='https://github.com/zopefoundation/Acquisition', url='https://github.com/zopefoundation/Acquisition',
license='ZPL 2.1', license='ZPL 2.1',
description="Acquisition is a mechanism that allows objects to obtain " description="Acquisition is a mechanism that allows objects to obtain "
...@@ -41,18 +58,17 @@ setup( ...@@ -41,18 +58,17 @@ setup(
"License :: OSI Approved :: Zope Public License", "License :: OSI Approved :: Zope Public License",
"Operating System :: OS Independent", "Operating System :: OS Independent",
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 2 :: Only", "Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7", "Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
], ],
ext_modules=[Extension("Acquisition._Acquisition", ext_modules=ext_modules,
[os.path.join('src', 'Acquisition',
'_Acquisition.c')],
include_dirs=['include', 'src']),
],
install_requires=[ install_requires=[
'ExtensionClass >= 4.1a1', 'ExtensionClass >= 4.1.1',
'zope.interface', 'zope.interface',
], ],
include_package_data=True, include_package_data=True,
......
This diff is collapsed.
This diff is collapsed.
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