Skip to content

Commit

Permalink
Add python 3.7 and fix deprecations.
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
jamadden committed Oct 19, 2018
1 parent f63b276 commit edff742
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
@@ -1,5 +1,5 @@
[run]
source = src
source = zope.app.localpermission

[report]
exclude_lines =
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,3 +9,4 @@ build/
dist/
*.egg-info/
.tox/
.coverage
9 changes: 8 additions & 1 deletion .travis.yml
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions CHANGES.txt → 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.
Expand All @@ -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.
1 change: 1 addition & 0 deletions MANIFEST.in
@@ -1,5 +1,6 @@
include *.py
include *.txt
include *.rst
include buildout.cfg
include tox.ini
include .coveragerc
Expand Down
File renamed without changes.
11 changes: 6 additions & 5 deletions setup.py
Expand Up @@ -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',
Expand All @@ -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=[
Expand All @@ -54,14 +54,15 @@ 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',
'Operating System :: OS Independent',
'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'},
Expand All @@ -81,4 +82,4 @@ def read(*rnames):
},
include_package_data=True,
zip_safe=False,
)
)
4 changes: 2 additions & 2 deletions src/zope/app/localpermission/configure.zcml
Expand Up @@ -28,13 +28,13 @@

<subscriber
for="zope.security.interfaces.IPermission
zope.component.interfaces.IRegistered"
zope.interface.interfaces.IRegistered"
handler=".permission.setIdOnActivation"
/>

<subscriber
for="zope.security.interfaces.IPermission
zope.component.interfaces.IUnregistered"
zope.interface.interfaces.IUnregistered"
handler=".permission.unsetIdOnDeactivation"
/>

Expand Down
14 changes: 7 additions & 7 deletions src/zope/app/localpermission/permission.py
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -52,8 +52,8 @@ def setIdOnActivation(permission, event):
>>> print(perm1.id)
<permission not activated>
>>> 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
Expand All @@ -73,16 +73,16 @@ 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
>>> 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
Expand Down
14 changes: 12 additions & 2 deletions 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

0 comments on commit edff742

Please sign in to comment.