From edff742bd51cd01db0e4980a5f1e0b9e8978f898 Mon Sep 17 00:00:00 2001 From: Jason Madden Date: Fri, 19 Oct 2018 10:50:11 -0500 Subject: [PATCH] Add python 3.7 and fix deprecations. Fixes #2 --- .coveragerc | 2 +- .gitignore | 1 + .travis.yml | 9 ++++++++- CHANGES.txt => CHANGES.rst | 20 ++++++++++---------- MANIFEST.in | 1 + README.txt => README.rst | 0 setup.py | 11 ++++++----- src/zope/app/localpermission/configure.zcml | 4 ++-- src/zope/app/localpermission/permission.py | 14 +++++++------- tox.ini | 14 ++++++++++++-- 10 files changed, 48 insertions(+), 28 deletions(-) rename CHANGES.txt => CHANGES.rst (73%) rename README.txt => README.rst (100%) diff --git a/.coveragerc b/.coveragerc index af40312..b3111d3 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,5 @@ [run] -source = src +source = zope.app.localpermission [report] exclude_lines = diff --git a/.gitignore b/.gitignore index 5149542..e8ebc2b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ build/ dist/ *.egg-info/ .tox/ +.coverage diff --git a/.travis.yml b/.travis.yml index f9678cd..61759db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,17 @@ language: python sudo: false python: - 2.7 - - pypy-5.4.1 - 3.4 - 3.5 - 3.6 + - pypy + - pypy3 +matrix: + include: + - python: "3.7" + dist: xenial + sudo: true + install: - pip install -U pip setuptools - pip install -U coverage coveralls diff --git a/CHANGES.txt b/CHANGES.rst similarity index 73% rename from CHANGES.txt rename to CHANGES.rst index 07044fb..568e26b 100644 --- a/CHANGES.txt +++ b/CHANGES.rst @@ -1,15 +1,15 @@ -======= -CHANGES -======= +========= + CHANGES +========= -4.0.1 (unreleased) ------------------- +4.1.0 (unreleased) +================== -- Nothing changed yet. +- Add support for Python 3.7. 4.0.0 (2017-04-23) ------------------- +================== - Add support for PyPy. - Add support for Python 3.4, 3.5, and 3.6. @@ -18,17 +18,17 @@ CHANGES 3.7.2 (2010-03-21) ------------------- +================== - Added missing i18n domain to ``browser.zcml``. 3.7.1 (2010-02-22) ------------------- +================== - The zope.app namespace wasn't declared correctly. 3.7.0 (2009-03-14) ------------------- +================== Initial release. This package was extracted from zope.app.security to separate the functionality without additional dependencies. diff --git a/MANIFEST.in b/MANIFEST.in index 8e515ff..1a13a52 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ include *.py include *.txt +include *.rst include buildout.cfg include tox.ini include .coveragerc diff --git a/README.txt b/README.rst similarity index 100% rename from README.txt rename to README.rst diff --git a/setup.py b/setup.py index db95945..ef116a3 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def read(*rnames): with open(os.path.join(os.path.dirname(__file__), *rnames)) as f: return f.read() -version = '4.0.1.dev0' +version = '4.1.0.dev0' tests_require = [ 'zope.annotation', @@ -37,9 +37,9 @@ def read(*rnames): author_email='zope-dev@zope.org', description='Local Persistent Permissions for zope.security', long_description=( - read('README.txt') + read('README.rst') + '\n\n' + - read('CHANGES.txt') + read('CHANGES.rst') ), keywords="zope security persistent local permission", classifiers=[ @@ -54,6 +54,7 @@ def read(*rnames): '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', @@ -61,7 +62,7 @@ def read(*rnames): 'Topic :: Internet :: WWW/HTTP', 'Framework :: Zope :: 3', ], - url='http://github.org/zopefoundation/zope.app.localpermission', + url='https://github.org/zopefoundation/zope.app.localpermission', license='ZPL 2.1', packages=find_packages('src'), package_dir={'': 'src'}, @@ -81,4 +82,4 @@ def read(*rnames): }, include_package_data=True, zip_safe=False, - ) +) diff --git a/src/zope/app/localpermission/configure.zcml b/src/zope/app/localpermission/configure.zcml index 54af0e5..032a158 100644 --- a/src/zope/app/localpermission/configure.zcml +++ b/src/zope/app/localpermission/configure.zcml @@ -28,13 +28,13 @@ diff --git a/src/zope/app/localpermission/permission.py b/src/zope/app/localpermission/permission.py index cd7c487..a5773d7 100644 --- a/src/zope/app/localpermission/permission.py +++ b/src/zope/app/localpermission/permission.py @@ -17,7 +17,7 @@ from persistent import Persistent from zope.component import adapter -from zope.component.interfaces import IRegistered, IUnregistered +from zope.interface.interfaces import IRegistered, IUnregistered from zope.i18nmessageid import MessageFactory from zope.interface import implementer from zope.location import Location @@ -43,7 +43,7 @@ def setIdOnActivation(permission, event): Let's see how this notifier can be used. First we need to create an event using the permission instance and a registration stub: - >>> class Registration: + >>> class Registration(object): ... def __init__(self, obj, name): ... self.component = obj ... self.name = name @@ -52,8 +52,8 @@ def setIdOnActivation(permission, event): >>> print(perm1.id) - >>> import zope.component.interfaces - >>> event = zope.component.interfaces.Registered( + >>> import zope.interface.interfaces + >>> event = zope.interface.interfaces.Registered( ... Registration(perm1, 'perm1')) Now we pass the event into this function, and the id of the permission @@ -73,7 +73,7 @@ def unsetIdOnDeactivation(permission, event): Let's see how this notifier can be used. First we need to create an event using the permission instance and a registration stub: - >>> class Registration: + >>> class Registration(object): ... def __init__(self, obj, name): ... self.component = obj ... self.name = name @@ -81,8 +81,8 @@ def unsetIdOnDeactivation(permission, event): >>> perm1 = LocalPermission('Permission 1', 'A first permission') >>> perm1.id = 'perm1' - >>> import zope.component.interfaces - >>> event = zope.component.interfaces.Unregistered( + >>> import zope.interface.interfaces + >>> event = zope.interface.interfaces.Unregistered( ... Registration(perm1, 'perm1')) Now we pass the event into this function, and the id of the permission diff --git a/tox.ini b/tox.ini index 695f359..acc3a20 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,19 @@ [tox] envlist = - py27, pypy, py34, py35, py36 + py27, pypy, py34, py35, py36, py37 [testenv] commands = zope-testrunner --test-path=src +extras = test + + +[testenv:coverage] +usedevelop = true +basepython = + python3.6 +commands = + coverage run -m zope.testrunner --test-path=src + coverage report --fail-under=100 deps = - .[test] + coverage