Skip to content

Commit

Permalink
Python3.7support (#9)
Browse files Browse the repository at this point in the history
* _p_repr for LocalSiteManager

* Added support for Python 3.7

* Moved _p_repr

* Added information on _p_repr in CHANGES.rst
  • Loading branch information
vernans committed Oct 6, 2018
1 parent b8725fd commit 8e1f9ac
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Expand Up @@ -6,7 +6,12 @@ python:
- 3.5
- 3.6
- pypy
- pypy3.5-5.8.0
- pypy3
matrix:
include:
- python: "3.7"
dist: xenial
sudo: true
install:
- pip install -U pip setuptools
- pip install -U coverage coveralls
Expand Down
5 changes: 4 additions & 1 deletion CHANGES.rst
Expand Up @@ -5,7 +5,7 @@
4.1.1 (unreleased)
==================

- Nothing changed yet.
- Add support for Python 3.7.


4.1.0 (2017-08-08)
Expand All @@ -20,6 +20,9 @@
with ``zope.deprecation``. These will be removed in version 5.0.
They all have replacements in ``zope.component``.

- Added implementation for _p_repr in LocalSiteManager.
For further information see github issue #8.

- Reach 100% test coverage and ensure we remain there.


Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -75,6 +75,7 @@ def alltests():
'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
3 changes: 3 additions & 0 deletions src/zope/site/site.py
Expand Up @@ -173,6 +173,9 @@ def _init_registries(self):
self.adapters.__name__ = u'adapters'
self.utilities.__name__ = u'utilities'

def _p_repr(self):
return zope.component.persistentregistry.PersistentComponents.__repr__(self)

def addSub(self, sub):
"""See interfaces.registration.ILocatedRegistry"""
self.subs += (sub, )
Expand Down
8 changes: 4 additions & 4 deletions src/zope/site/tests/folder.txt
Expand Up @@ -42,17 +42,17 @@ The site folder now contains the new folder:
>>> list(fs_folder.keys())
[u'test', '++etc++site']
>>> fs_folder.get('test')
<zope.site.folder.Folder object at 0x...>
<...Folder object at 0x...>
>>> fs_folder['test']
<zope.site.folder.Folder object at 0x...>
<...Folder object at 0x...>
>>> list(fs_folder.__iter__())
[u'test', '++etc++site']
>>> list(fs_folder.values())
[<zope.site.folder.Folder object at 0x...>, <LocalSiteManager ++etc++site>]
[...Folder object at 0x...>, <LocalSiteManager ++etc++site>]
>>> len(fs_folder)
2
>>> list(fs_folder.items())
[(u'test', <zope.site.folder.Folder object at 0x...>),
[(u'test', ...Folder object at 0x...>),
('++etc++site', <LocalSiteManager ++etc++site>)]
>>> 'test' in fs_folder
True
4 changes: 2 additions & 2 deletions tox.ini
@@ -1,6 +1,6 @@
[tox]
envlist =
py27,py34,py35,py36,pypy,pypy3,coverage
py27,py34,py35,py36,py37,pypy,pypy3,coverage

[testenv]
commands =
Expand All @@ -12,7 +12,7 @@ deps =
[testenv:coverage]
usedevelop = true
basepython =
python2.7
python3.7
commands =
coverage run -m zope.testrunner --test-path=src
coverage report --fail-under=100
Expand Down

0 comments on commit 8e1f9ac

Please sign in to comment.