Skip to content

Commit

Permalink
Add support for Python 3.7. (#11)
Browse files Browse the repository at this point in the history
* Add support for Python 3.7.

* Drop support for `python setup.py test`.

* Fix a resource warning.
  • Loading branch information
Michael Howitz committed Nov 3, 2018
1 parent e67eacf commit c38fc85
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 29 deletions.
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ python:
- 3.6
- pypy
- pypy3
matrix:
include:
- python: "3.7"
dist: xenial
sudo: true
install:
- pip install tox-travis
- pip install -U pip setuptools
- pip install -U zope.testrunner coverage coveralls
- pip install -U -e .[test,buildout]
script:
- tox
- coverage run -m zope.testrunner --test-path=src
after_success:
- coveralls
notifications:
email: false
cache: pip
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Changelog
1.1 (unreleased)
----------------

- Nothing changed yet.
- Add support for Python 3.7.

- Drop support for `python setup.py test`.


1.0 (2018-05-23)
Expand Down
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,6 @@ Run tests

Uncompress the archive, then run::

$ python setup.py test
$ virtualenv .
$ bin/pip install tox
$ tox
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@
'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 :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Libraries :: Python Modules',
'Framework :: Buildout',
'Framework :: Zope',
'Framework :: Zope :: 2',
'Framework :: Zope :: 3',
'Framework :: Zope :: 4',
'Framework :: Zope2',
'Framework :: Zope3',
],
keywords='version, buildout, packages, upgrade, zope, ztk',
author='Zope Foundation and Contributors',
author_email='zope-dev@zope.org',
url='http://pypi.python.org/pypi/z3c.checkversions',
url='https://github.com/zopefoundation/z3c.checkversions',
license='ZPL 2.1',
packages=find_packages('src'),
package_dir={'': 'src'},
Expand All @@ -58,8 +58,6 @@
extras_require={
'buildout': ['zc.buildout'],
},
tests_require=['zc.buildout'],
test_suite='z3c.checkversions.test.test_suite',
entry_points="""
[console_scripts]
checkversions = z3c.checkversions.main:main
Expand Down
8 changes: 1 addition & 7 deletions src/z3c/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__import__('pkg_resources').declare_namespace(__name__) # pragma: nocover
9 changes: 6 additions & 3 deletions src/z3c/checkversions/buildout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ file:///.../testindex
We create a buildout with a [versions] section and a custom index:

>>> import os
>>> from z3c.checkversions.test import write_temp_file
>>> from z3c.checkversions.tests import write_temp_file
>>> buildout_path = write_temp_file("""
... [buildout]
... index = %s
Expand Down Expand Up @@ -57,7 +57,7 @@ zope.interface=3.6.2

The verbose mode gives the current and previous versions.
This is useful to find out which packages in your buildout can be updated by
using grep (``bin/checkversions -v | grep was``)
using grep (``bin/checkversions -v | grep was``)

>>> checker = buildout.Checker(filename=buildout_path, verbose=True)
>>> checker.check(level=2)
Expand Down Expand Up @@ -88,7 +88,7 @@ We can provide a blacklist file, containing versions to not suggest.
This file may come from a buildbot remembering failures.

>>> blacklist_path = write_temp_file("""
... zope.component =3.9.4
... zope.component =3.9.4
... zope.component = 3.9.3""")

>>> checker = buildout.Checker(filename=buildout_path,
Expand Down Expand Up @@ -128,8 +128,11 @@ We are using it directly here:
... stdout=PIPE, stdin=PIPE, stderr=PIPE)

# the "usage" attribute of optparse is inconsistent between python versions

>>> p.stdout.read().lower().startswith(b'usage: ')
True
>>> p.wait()
0


explicitly unpinned versions
Expand Down
File renamed without changes.
22 changes: 12 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
[tox]
envlist =
py27,py34,py35,py36,pypy,pypy3,coverage
py27,py34,py35,py36,py37,pypy,pypy3,coverage

[testenv]
use_develop = true
deps =
zc.buildout
usedevelop = true
commands =
python setup.py -q test
zope-testrunner --test-path=src []
extras = test,buildout
deps = zope.testrunner

[testenv:coverage]
basepython = python3.6
usedevelop = true
basepython =
python3.7
commands =
coverage run -m zope.testrunner --test-path=src []
coverage report --fail-under=77
deps =
{[testenv]deps}
zope.testrunner
coverage
commands =
coverage run --source=z3c.checkversions setup.py -q test
coverage report -m --fail-under=77

0 comments on commit c38fc85

Please sign in to comment.