Skip to content

Commit

Permalink
Fix deprecation warnings and add Python 3.7
Browse files Browse the repository at this point in the history
Also drop Python 3.3

Fixes #16
  • Loading branch information
jamadden committed Oct 16, 2018
1 parent 32ccb72 commit 94394e8
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 26 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Expand Up @@ -2,11 +2,15 @@ language: python
sudo: false
python:
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- pypy-5.4.1
- pypy
matrix:
include:
- python: "3.7"
dist: xenial
sudo: true
install:
- pip install -U pip setuptools zope.testrunner
- pip install -U coveralls coverage
Expand Down
39 changes: 21 additions & 18 deletions CHANGES.rst
@@ -1,14 +1,17 @@
Changes
=======
=========
Changes
=========

4.6.1 (unreleased)
------------------
4.7.0 (unreleased)
==================

- Nothing changed yet.
- Add support for Python 3.7 and drop support for Python 3.3.

- Fix a DeprecationWarning from ``zope.annotation.attribute``. See
`issue 16 <https://github.com/zopefoundation/zope.annotation/issues/16>`_.

4.6.0 (2017-09-22)
------------------
==================

- Make ``AttributeAnnotations`` have a ``__parent__``. The
``__parent__`` is the object that it stores ``__annotations__`` on.
Expand All @@ -18,7 +21,7 @@ Changes


4.5 (2017-06-03)
----------------
================

- Drop support for Python 2.6.

Expand All @@ -31,14 +34,14 @@ Changes
``UserDict.DictMixin``.

4.4.1 (2015-01-09)
------------------
==================

- Convert doctests to Sphinx documentation. Doctest snippets are still
tested via ``tox -e docs``.


4.4.0 (2015-01-09)
------------------
==================

- LP #98462: add additional "iterable mapping" methods to ``IAnnotations``.

Expand All @@ -52,27 +55,27 @@ Changes
using ``dict`` for attribute storage if ``BTrees`` is not importable.

4.3.0 (2014-12-26)
------------------
==================

- Add support for Python 3.4.

4.2.0 (2013-03-18)
------------------
==================

- Don't make AttributeAnnotations available as a view.

4.1.0 (2013-02-24)
------------------
==================

- Add ``__bool__`` method to ``IAnnotations`` API for Python 3 compatibility.

4.0.1 (2013-02-11)
------------------
==================

- Add `tox.ini`.

4.0.0 (2013-02-11)
------------------
==================

- Add support for Python 3.3 and PyPy.

Expand All @@ -88,7 +91,7 @@ Changes
via a zcml extra, added tests for zcml.

3.5.0 (2009-09-07)
------------------
==================

- Add ZODB3 to install_requires, because it's a true requirement of this
package, not just a testing requirement, as BTrees are in use.
Expand All @@ -97,7 +100,7 @@ Changes
a mistake.

3.4.2 (2009-03-09)
------------------
==================

- Clean up package description and documentation a bit.

Expand All @@ -107,14 +110,14 @@ Changes
- Remove old zpkg-related files.

3.4.1 (2008-08-26)
------------------
==================

- Annotation factories take care not to store proxies in the database,
so adapting an object wrapped in a ``LocationProxy`` works correctly.
Fixes https://bugs.launchpad.net/zope3/+bug/261620

3.4.0 (2007-08-29)
------------------
==================

- Annotation factories are no longer containing the factored object.
Instead the objects are located using ``zope.location``. This removes
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -35,7 +35,7 @@ def read(*rnames):

setup(
name='zope.annotation',
version='4.6.1.dev0',
version='4.7.0.dev0',
url='https://github.com/zopefoundation/zope.annotation',
license='ZPL 2.1',
description='Object annotation mechanism',
Expand All @@ -49,10 +49,10 @@ def read(*rnames):
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
Expand Down
7 changes: 6 additions & 1 deletion src/zope/annotation/attribute.py
Expand Up @@ -13,7 +13,12 @@
##############################################################################
"""Attribute Annotations implementation"""
import logging
from collections import MutableMapping as DictMixin

try:
from collections.abc import MutableMapping as DictMixin
except ImportError:
# Python 2
from collections import MutableMapping as DictMixin

try:
from BTrees.OOBTree import OOBTree as _STORAGE
Expand Down
7 changes: 5 additions & 2 deletions src/zope/annotation/tests/test_factory.py
Expand Up @@ -40,9 +40,12 @@ class Context(dict):

class TestFactory(unittest.TestCase):

assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex',
getattr(unittest.TestCase, 'assertRaisesRegexp'))

def test_no_adapts(self):
self.assertRaisesRegexp(TypeError, "Missing.*on annotation",
factory, TestFactory)
self.assertRaisesRegex(TypeError, "Missing.*on annotation",
factory, TestFactory)

def test_factory_no_location(self):

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,10 +1,10 @@
[tox]
envlist =
py27,
py33,
py34,
py35,
py36,
py37,
pypy,
pypy3,
nobtree,
Expand Down

0 comments on commit 94394e8

Please sign in to comment.