Skip to content

Commit

Permalink
Add support for Python 3.4, 3.5, 3.6, PyPy2, PyPy3. (#4)
Browse files Browse the repository at this point in the history
Add support for Python 3.4, 3.5, 3.6, PyPy2, PyPy3. Drop support for 3.3.
  • Loading branch information
Michael Howitz committed Jul 20, 2017
1 parent 043dcab commit 686eef9
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 59 deletions.
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[run]
branch = True
source = zope.generations

[report]
precision = 2

[paths]
source =
src/
.tox/*/lib/python*/site-packages/
.tox/pypy*/site-packages/
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
*.dll
*.pyc
*.so
*.dll
__pycache__
src/*.egg-info

.coverage
.coverage.*
.installed.cfg
.tox
__pycache__
bin
build
coverage.xml
develop-eggs
htmlcov/
parts
src/*.egg-info
23 changes: 17 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
language: python
sudo: false
env:
- TOXENV=py27
- TOXENV=py33
python:
- 2.7
- 3.4
- 3.5
- 3.6
- pypy-5.6.0
- pypy3.3-5.5-alpha
install:
- travis_retry pip install tox
- pip install -U pip setuptools zope.testrunner
- pip install -U coveralls coverage
- pip install -U -e ".[test]"
script:
- tox
- coverage run -m zope.testrunner --test-path=src --auto-color
after_success:
- coveralls
notifications:
email: false
email: false
cache: pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
4 changes: 3 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ CHANGES
4.0.0a2 (unreleased)
--------------------

- Dropped support for Python 2.6.
- Dropped support for Python 2.6 and 3.3.

- Added support for Python 3.4, 3.5, 3.6, PyPy2 and PyPy3.


4.0.0a1 (2013-02-25)
Expand Down
20 changes: 1 addition & 19 deletions buildout.cfg
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
[buildout]
develop = .
parts = test coverage-test coverage-report
parts = test
versions = versions

[test]
recipe = zc.recipe.testrunner
eggs = zope.generations [test]

[coverage-test]
recipe = zc.recipe.testrunner
eggs = ${test:eggs}
defaults = ['--tests-pattern', '^f?tests$', '-v', '--coverage', '../../coverage']

[coverage-report]
recipe = zc.recipe.egg
eggs = z3c.coverage
scripts = coverage=coverage-report
arguments = ('coverage', 'coverage/report')

[versions]
ZODB = >=4.0.0dev
zope.container = >=4.0.0a2
zope.publisher = >=4.0.0a2
zope.site = >=4.0.0a1
zope.traversing = >=4.0.0a2
23 changes: 4 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@ def read(*rnames):
return f.read()


def alltests():
import os
import sys
import unittest
# use the zope.testrunner machinery to find all the
# test suites we've put under ourselves
import zope.testrunner.find
import zope.testrunner.options
here = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src'))
args = sys.argv[:]
defaults = ["--test-path", here]
options = zope.testrunner.options.get_options(args, defaults)
suites = list(zope.testrunner.find.find_suites(options))
return unittest.TestSuite(suites)


setup(name='zope.generations',
version='4.0.0a2.dev0',
author='Zope Corporation and Contributors',
Expand All @@ -67,11 +51,13 @@ def alltests():
'License :: OSI Approved :: Zope Public License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'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 :: PyPy',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
Expand Down Expand Up @@ -99,7 +85,6 @@ def alltests():
'zope.testing',
'zope.testrunner',
],
test_suite='__main__.alltests',
include_package_data=True,
zip_safe=False,
)
6 changes: 5 additions & 1 deletion src/zope/generations/tests/test_generations.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
r"\1"),
(re.compile('b(".*?")'),
r"\1"),
])
(re.compile('ModuleNotFoundError:'), 'ImportError:'),
(re.compile(
"No module named '?zope.nonexistingmodule'?"),
'No module named nonexistingmodule'),
])


def tearDownREADME(test):
Expand Down
32 changes: 23 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,35 @@
envlist =
flake8,
py27,
py33,
py34,
py35,
py36,
pypy,
pypy3,
coverage

[testenv]
commands =
python setup.py test -q
coverage run -m zope.testrunner --test-path=src {posargs:-vc}
setenv =
COVERAGE_FILE=.coverage.{envname}
deps =
ZODB
transaction
zope.component
zope.interface
zope.processlifetime
zope.site
zope.testing
coverage
.[test]
zope.testrunner

[testenv:coverage]
deps = coverage
setenv =
COVERAGE_FILE=.coverage
skip_install = true
commands =
coverage erase
coverage combine
coverage report
coverage html
coverage xml

[testenv:flake8]
basepython = python2.7
skip_install = true
Expand Down

0 comments on commit 686eef9

Please sign in to comment.