Skip to content

Commit

Permalink
Python 3 support.
Browse files Browse the repository at this point in the history
- Update travis.yml
- Add tox.ini
- Enable coverage.
  • Loading branch information
jamadden committed Apr 20, 2017
1 parent 70e85a0 commit 4a233cd
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 25 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
@@ -0,0 +1,6 @@
[run]
source = src

[report]
exclude_lines =
pragma: no cover
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -9,3 +9,5 @@ build/
dist/
*.egg-info/
.tox/
htmlcov/
.coverage
15 changes: 13 additions & 2 deletions .travis.yml
@@ -1,9 +1,20 @@
language: python
sudo: false
python:
- 2.7
- pypy-5.4.1
- 3.5
- 3.6
install:
- pip install .
- pip install -U pip setuptools
- pip install -U coverage coveralls
- pip install -U -e .[test]
script:
- python setup.py test -q
- coverage run -m zope.testrunner --test-path=src --auto-color --auto-progress
notifications:
email: false
after_success:
- coveralls
cache: pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
5 changes: 3 additions & 2 deletions CHANGES.txt
Expand Up @@ -2,10 +2,11 @@
CHANGES
=======

3.5.2 (unreleased)
4.0.0 (unreleased)
------------------

- Nothing changed yet.
- Add support for Python 3.5 and 3.6.
- Add support for PyPy.


3.5.1 (2010-09-25)
Expand Down
25 changes: 17 additions & 8 deletions setup.py
Expand Up @@ -18,13 +18,14 @@
##############################################################################
"""Setup for zope.app.basicskin package
"""
version = '3.5.2dev'
version = '4.0.0.dev0'

import os
from setuptools import setup, find_packages

def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
with open(os.path.join(os.path.dirname(__file__), *rnames)) as f:
return f.read()

setup(name='zope.app.basicskin',
version = version,
Expand All @@ -36,21 +37,27 @@ def read(*rnames):
+ '\n\n' +
read('CHANGES.txt')
),
keywords = "zope3 skin zmi",
classifiers = [
keywords="zope3 skin zmi",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Zope Public License',
'Programming Language :: Python',
'Programming Language :: Python:: 2.7',
'Programming Language :: Python:: 3.5',
'Programming Language :: Python:: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Framework :: Zope3'],
'Framework :: Zope3'
],
url='http://pypi.python.org/pypi/zope.app.basicskin',
license='ZPL 2.1',
packages=find_packages('src'),
package_dir = {'': 'src'},
package_dir={'': 'src'},
namespace_packages=['zope', 'zope.app'],
install_requires=['setuptools',
'zope.component',
Expand All @@ -60,7 +67,9 @@ def read(*rnames):
extras_require=dict(
test=[
'zope.component [test]',
'zope.testrunner',
]),
include_package_data = True,
zip_safe = False,
include_package_data=True,
zip_safe=False,
test_suite='zope.app.basicskin.tests',
)
11 changes: 8 additions & 3 deletions src/zope/app/basicskin/standardmacros.py
Expand Up @@ -15,16 +15,21 @@
The macros are drawn from various different page templates.
"""
from __future__ import print_function, absolute_import, division

__docformat__ = 'restructuredtext'
import zope.interface

from zope.interface import implementer
from zope.interface.common.mapping import IItemMapping

from zope.component import getMultiAdapter
from zope.publisher.browser import BrowserView

@implementer(IItemMapping)
class Macros(object):
zope.interface.implements(zope.interface.common.mapping.IItemMapping)

macro_pages = ()

macro_pages = ()
aliases = {
'view': 'page',
'dialog': 'page',
Expand Down
16 changes: 6 additions & 10 deletions src/zope/app/basicskin/tests/test_standardmacros.py
Expand Up @@ -17,22 +17,21 @@

from zope.component import getGlobalSiteManager
from zope.component.testing import PlacelessSetup
from zope.interface import implements, Interface
from zope.interface import implementer, Interface
from zope.publisher.browser import TestRequest
from zope.publisher.interfaces.browser import IBrowserView
from zope.publisher.interfaces.browser import IDefaultBrowserLayer

from zope.app.basicskin.standardmacros import Macros


@implementer(IBrowserView)
class ViewWithMacros(object):
implements(IBrowserView)

def __init__(self, context, request):
self.context = context
self.request = request

def __call__(self):
def __call__(self): # pragma: no cover
pass

def __getitem__(self, key):
Expand All @@ -42,8 +41,9 @@ def __getitem__(self, key):

class I(Interface): pass

@implementer(I)
class C(object):
implements(I)
pass

class page1(ViewWithMacros):
pages = {'foo':'page1_foo',
Expand Down Expand Up @@ -111,8 +111,4 @@ def testMacroAliases(self):


def test_suite():
loader = unittest.TestLoader()
return loader.loadTestsFromTestCase(Test)

if __name__=='__main__':
unittest.TextTestRunner().run(test_suite())
return unittest.defaultTestLoader.loadTestsFromName(__name__)
9 changes: 9 additions & 0 deletions tox.ini
@@ -0,0 +1,9 @@
[tox]
envlist =
py27, pypy, py35, py36

[testenv]
commands =
zope-testrunner --test-path=src
deps =
.[test]

0 comments on commit 4a233cd

Please sign in to comment.