Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Jul 10, 2013
2 parents 0f4f872 + 4adf0bc commit 296f0b5
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 47 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
@@ -0,0 +1,13 @@
language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- pypy
install:
- pip install . --use-mirrors
script:
- python setup.py test -q
notifications:
email: false
17 changes: 16 additions & 1 deletion CHANGES.rst
Expand Up @@ -2,11 +2,26 @@
CHANGES
=======

4.0.1 (unreleased)
4.0.3 (unreleased)
------------------

- Updated ``boostrap.py`` to version 2.2.


4.0.2 (2013-03-11)
------------------

- Changed the behavior of ``LocationProxy``'s ``__setattr__()`` to correctly
behave when dealing with the pure Python version of the ``ProxyBase``
class. Also added a test suite that fully tests the pure Python proxy
version of the ``LocationProxy`` class.


4.0.1 (2013-02-19)
------------------

- Added Python 3.3 support.

4.0.0 (2012-06-07)
------------------

Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Expand Up @@ -4,6 +4,10 @@ include *.txt
recursive-include docs *
recursive-include src *

exclude .coverage
exclude nosetests.xml
exclude src/coverage.xml

global-exclude *.dll
global-exclude *.pyc
global-exclude *.pyo
Expand Down
2 changes: 1 addition & 1 deletion buildout.cfg
@@ -1,5 +1,5 @@
[buildout]
develop = .
develop = .
parts = test coverage-test coverage-report

[test]
Expand Down
15 changes: 8 additions & 7 deletions setup.py
Expand Up @@ -26,7 +26,7 @@ def read(*rnames):
return text

setup(name='zope.location',
version='4.0.1dev',
version='4.0.3.dev0',
author='Zope Corporation and Contributors',
author_email='zope-dev@zope.org',
description='Zope Location',
Expand All @@ -48,6 +48,7 @@ def read(*rnames):
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
Expand All @@ -59,18 +60,18 @@ def read(*rnames):
package_dir = {'': 'src'},
namespace_packages=['zope',],
install_requires=['setuptools',
'zope.interface',
'zope.schema>=3.6',
'zope.proxy>3.3',
'zope.interface>=4.0.2',
'zope.schema>=4.2.2',
'zope.proxy>=4.0.1',
],
extras_require={
'zcml': ['zope.configuration'],
'component': ['zope.component>=3.8'],
'component': ['zope.component>=4.0.1'],
'testing': [
'nose',
'coverage',
'zope.configuration',
'zope.copy',
'zope.configuration>=4.0',
'zope.copy>=4.0',
],
'docs': ['Sphinx', 'repoze.sphinx.autointerface'],
},
Expand Down
4 changes: 2 additions & 2 deletions src/zope/location/location.py
Expand Up @@ -113,9 +113,9 @@ def __setattr__(self, name, value):
if name in self.__slots__ + getattr(ProxyBase, '__slots__', ()):
#('_wrapped', '__parent__', '__name__'):
try:
return ProxyBase.__setattr__(self, name, value)
except AttributeError: #pragma NO COVER PyPy
return object.__setattr__(self, name, value)
except TypeError: #pragma NO COVER C Optimization
return ProxyBase.__setattr__(self, name, value)
return ProxyBase.__setattr__(self, name, value)

@non_overridable
Expand Down
46 changes: 46 additions & 0 deletions src/zope/location/tests/test_location.py
Expand Up @@ -366,6 +366,50 @@ class Context(object):
self.assertEqual(list(providedBy(proxy)), [IContext, IProxy, ILocation])


class LocationPyProxyTests(LocationProxyTests):

def setUp(self):
import sys
for mod in ('zope.location.location',
'zope.proxy.decorator'):
try:
del sys.modules[mod]
except KeyError:
pass
import zope.proxy
self.orig = (zope.proxy.ProxyBase,
zope.proxy.getProxiedObject,
zope.proxy.setProxiedObject,
zope.proxy.isProxy,
zope.proxy.sameProxiedObjects,
zope.proxy.queryProxy,
zope.proxy.queryInnerProxy,
zope.proxy.removeAllProxies,
zope.proxy.non_overridable)
zope.proxy.ProxyBase = zope.proxy.PyProxyBase
zope.proxy.getProxiedObject = zope.proxy.py_getProxiedObject
zope.proxy.setProxiedObject = zope.proxy.py_setProxiedObject
zope.proxy.isProxy = zope.proxy.py_isProxy
zope.proxy.sameProxiedObjects = zope.proxy.py_sameProxiedObjects
zope.proxy.queryProxy = zope.proxy.py_queryProxy
zope.proxy.queryInnerProxy = zope.proxy.py_queryInnerProxy
zope.proxy.removeAllProxies = zope.proxy.py_removeAllProxies
zope.proxy.non_overridable = zope.proxy.PyNonOverridable


def tearDown(self):
import zope.proxy
(zope.proxy.ProxyBase,
zope.proxy.getProxiedObject,
zope.proxy.setProxiedObject,
zope.proxy.isProxy,
zope.proxy.sameProxiedObjects,
zope.proxy.queryProxy,
zope.proxy.queryInnerProxy,
zope.proxy.removeAllProxies,
zope.proxy.non_overridable) = self.orig


def test_suite():
return unittest.TestSuite((
unittest.makeSuite(LocationTests),
Expand All @@ -374,5 +418,7 @@ def test_suite():
unittest.makeSuite(Test_inside),
unittest.makeSuite(Test_LocationIterator),
unittest.makeSuite(ClassAndInstanceDescrTests),
# In case of Python-only version, tests are simply run twice.
unittest.makeSuite(LocationProxyTests),
unittest.makeSuite(LocationPyProxyTests),
))
60 changes: 24 additions & 36 deletions tox.ini
@@ -1,75 +1,63 @@
[tox]
envlist =
envlist =
# Jython support pending 2.7 support, due 2012-07-15 or so. See:
# http://fwierzbicki.blogspot.com/2012/03/adconion-to-fund-jython-27.html
# py26,py27,py32,jython,pypy,coverage
# py32 support pending zope.component
# py26,py27,py32,pypy,coverage,docs
py26,py27,pypy,coverage,docs
py26,py27,py32,py33,pypy,coverage,docs

[testenv]
commands =
commands =
python setup.py test -q
deps =
zope.configuration>=4.0
zope.configuration
zope.copy
zope.interface>=4.0
zope.proxy>=4.0
zope.schema>=4.0
zope.interface
zope.proxy
zope.schema

[testenv:jython]
commands =
commands =
jython setup.py test -q
deps =
zope.configuration>=4.0
zope.configuration
zope.copy
zope.interface>=4.0
zope.proxy>=4.0
zope.schema>=4.0

[testenv:py32]
commands =
python setup.py test -q
deps =
zope.configuration>=4.0
# zope.copy>=4.0 not yet ported
zope.interface>=4.0
zope.proxy>=4.0
zope.schema>=4.0
zope.interface
zope.proxy
zope.schema

[testenv:coverage]
basepython =
python2.6
commands =
commands =
# The installed version messes up nose's test discovery / coverage reporting
# So, we uninstall that from the environment, and then install the editable
# version, before running nosetests.
pip uninstall -y zope.location
pip install -e .
nosetests --with-xunit --with-xcoverage
deps =
zope.configuration>=4.0
zope.configuration
zope.copy
zope.interface>=4.0
zope.proxy>=4.0
zope.schema>=4.0
zope.component>=3.8
zope.interface
zope.proxy
zope.schema
zope.component
nose
coverage
nosexcover

[testenv:docs]
basepython =
python2.6
commands =
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
deps =
zope.configuration>=4.0
zope.configuration
zope.copy
zope.interface>=4.0
zope.proxy>=4.0
zope.schema>=4.0
zope.component>=3.8
zope.interface
zope.proxy
zope.schema
zope.component
Sphinx
repoze.sphinx.autointerface

0 comments on commit 296f0b5

Please sign in to comment.