From 66b82e5798794fe3da702fc9feecedd7420a7755 Mon Sep 17 00:00:00 2001 From: Jason Madden Date: Fri, 23 Jun 2017 16:45:57 -0500 Subject: Add Python 3.6 and coveralls Fixes #6 --- .coveragerc | 8 ++++++++ .gitignore | 2 ++ .travis.yml | 32 ++++++++++++++++++++++---------- CHANGES.rst | 35 +++++++++++++++++++---------------- README.rst | 7 ++++--- setup.py | 23 ++++++++++++++--------- src/zope/__init__.py | 2 +- src/zope/event/tests.py | 2 +- tox.ini | 32 +++++++++++++++++++------------- 9 files changed, 90 insertions(+), 53 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..2f30b70 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,8 @@ +[run] +source = zope.event + +[report] +exclude_lines = + pragma: no cover + if __name__ == '__main__': + raise NotImplementedError diff --git a/.gitignore b/.gitignore index cf27ddc..6391126 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ __pycache__ build docs/_build .coverage +.coverage.* +htmlcov nosetests.xml coverage.xml .installed.cfg diff --git a/.travis.yml b/.travis.yml index 4847904..dcaac77 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,27 @@ language: python sudo: false python: - - 2.7 - - 3.3 - - 3.4 - - 3.5 - - pypy - - pypy3 -install: - - pip install . + - 2.7 + - 3.4 + - 3.5 + - 3.6 + - pypy-5.6.0 + - pypy3.3-5.5-alpha script: - - python setup.py -q test -q + - coverage run -m zope.testrunner --test-path=src + +after_success: + - coveralls notifications: - email: false + email: false + +install: + - pip install -U pip setuptools + - pip install -U coveralls coverage + - pip install -U -e ".[test]" + + +cache: pip + +before_cache: + - rm -f $HOME/.cache/pip/log/debug.log diff --git a/CHANGES.rst b/CHANGES.rst index fee495b..c3b3176 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,14 +1,17 @@ -``zope.event`` Changelog -======================== +========================== + ``zope.event`` Changelog +========================== -4.2.1 (unreleased) ------------------- +4.3.0 (unreleased) +================== -- TBD +- Add support for Python 3.6. + +- Drop support for Python 3.3. 4.2.0 (2016-02-17) ------------------- +================== - Add support for Python 3.5. @@ -16,7 +19,7 @@ 4.1.0 (2015-10-18) ------------------- +================== - Require 100% branch (as well as statement) coverage. @@ -24,7 +27,7 @@ 4.0.3 (2014-03-19) ------------------- +================== - Add support for Python 3.4. @@ -32,7 +35,7 @@ 4.0.2 (2012-12-31) ------------------- +================== - Flesh out PyPI Trove classifiers. @@ -40,13 +43,13 @@ 4.0.1 (2012-11-21) ------------------- +================== - Add support for Python 3.3. 4.0.0 (2012-05-16) ------------------- +================== - Automate build of Sphinx HTML docs and running doctest snippets via tox. @@ -56,7 +59,7 @@ 3.5.2 (2012-03-30) ------------------- +================== - This release is the last which will maintain support for Python 2.4 / Python 2.5. @@ -70,13 +73,13 @@ 3.5.1 (2011-08-04) ------------------- +================== - Add Sphinx documentation. 3.5.0 (2010-05-01) ------------------- +================== - Add change log to ``long-description``. @@ -84,12 +87,12 @@ 3.4.1 (2009-03-03) ------------------- +================== - A few minor cleanups. 3.4.0 (2007-07-14) ------------------- +================== - Initial release as a separate project. diff --git a/README.rst b/README.rst index 2249fba..0bf1ccb 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,6 @@ -``zope.event`` README -===================== +======================= + ``zope.event`` README +======================= .. image:: https://img.shields.io/pypi/v/zope.event.svg :target: https://pypi.python.org/pypi/zope.event/ @@ -22,4 +23,4 @@ The ``zope.event`` package provides a simple event system, including: event dispatching system that builds on ``zope.event`` can be found in ``zope.component``. -Please see http://zopeevent.rtfd.org/ for the documentation. +Please see http://zopeevent.readthedocs.io/ for the documentation. diff --git a/setup.py b/setup.py index 87fdf29..af7c1f3 100644 --- a/setup.py +++ b/setup.py @@ -23,12 +23,13 @@ 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.event', version='4.2.1.dev0', - url='http://pypi.python.org/pypi/zope.event', + url='http://github.com/zopefoundation/zope.event', license='ZPL 2.1', description='Very basic event publishing system', author='Zope Foundation and Contributors', @@ -37,7 +38,7 @@ setup( read('README.rst') + '\n' + read('CHANGES.rst') - ), + ), classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -47,16 +48,15 @@ setup( "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 :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: Jython", "Programming Language :: Python :: Implementation :: PyPy", "Framework :: Zope3", "Topic :: Software Development :: Libraries :: Python Modules", - ], - + ], packages=find_packages('src'), package_dir={'': 'src'}, namespace_packages=['zope',], @@ -64,7 +64,12 @@ setup( install_requires=['setuptools'], zip_safe=False, test_suite='zope.event.tests.test_suite', - extras_require={'docs': ['Sphinx'], - 'testing': ['nose', 'coverage'], - }, + extras_require={ + 'docs': [ + 'Sphinx', + ], + 'test': [ + 'zope.testrunner', + ], + }, ) diff --git a/src/zope/__init__.py b/src/zope/__init__.py index de40ea7..2cdb0e4 100644 --- a/src/zope/__init__.py +++ b/src/zope/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover diff --git a/src/zope/event/tests.py b/src/zope/event/tests.py index eed5562..740a1ac 100644 --- a/src/zope/event/tests.py +++ b/src/zope/event/tests.py @@ -53,7 +53,7 @@ def tearDownClassHandlers(test): def test_suite(): return unittest.TestSuite(( - unittest.makeSuite(Test_notify), + unittest.defaultTestLoader.loadTestsFromName(__name__), doctest.DocTestSuite( 'zope.event.classhandler', setUp=setUpClassHandlers, tearDown=tearDownClassHandlers) diff --git a/tox.ini b/tox.ini index 6b186ee..0bc7616 100644 --- a/tox.ini +++ b/tox.ini @@ -1,29 +1,35 @@ [tox] -envlist = +envlist = # Jython 2.7b1 support pending fix for Jython incompat. w/ pip's vendored-in # requests -> html5 libraries. See # https://github.com/html5lib/html5lib-python/pull/150 # py27,py33,py34,pypy,pypy3,jython,coverage,docs - py27,py33,py34,py35,pypy,pypy3,coverage,docs + py27,py34,py35,py36,pypy,pypy3,coverage,docs [testenv] -commands = - python setup.py -q test -q - -[testenv:coverage] -basepython = - python2.7 -commands = - nosetests --with-xunit --with-xcoverage +commands = + coverage run -m zope.testrunner --test-path=src [] deps = - nose + .[test] coverage - nosexcover +setenv = + COVERAGE_FILE=.coverage.{envname} + +[testenv:coverage] +setenv = + COVERAGE_FILE=.coverage +skip_install = true +commands = + coverage erase + coverage combine + coverage report + coverage html + coverage xml [testenv:docs] basepython = python2.7 -commands = +commands = sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest deps = -- cgit v1.2.1