Configure with meta/config. (#243)

* Add support for Python 3.9.
* Improve coverage.
This commit is contained in:
Michael Howitz 2021-06-02 14:35:12 +02:00 committed by GitHub
parent 077ff5b322
commit d18b5478f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 390 additions and 187 deletions

View File

@ -1,14 +1,29 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
[run]
branch = True
source = zope.interface
# New in 5.0; required for the GHA coveralls submission.
relative_files = True
branch = true
[paths]
source =
src/
.tox/*/lib/python*/site-packages/
.tox/pypy*/site-packages/
[report]
show_missing = true
precision = 2
exclude_lines =
except ImportError:
if __name__ == '__main__':
pragma: no cover
class I[A-Z]\w+\((Interface|I[A-Z].*)\):
raise NotImplementedError
pragma: nocover
raise AssertionError
self\.fail
raise NotImplementedError
raise unittest.Skip
self.fail\(
[html]
directory = parts/htmlcov

39
.editorconfig Normal file
View File

@ -0,0 +1,39 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
#
# EditorConfig Configuration file, for more details see:
# http://EditorConfig.org
# EditorConfig is a convention description, that could be interpreted
# by multiple editors to enforce common coding conventions for specific
# file types
# top-most EditorConfig file:
# Will ignore other EditorConfig files in Home directory or upper tree level.
root = true
[*] # For All Files
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Set default charset
charset = utf-8
# Indent style default
indent_style = space
# Max Line Length - a hard line wrap, should be disabled
max_line_length = off
[*.{py,cfg,ini}]
# 4 space indentation
indent_size = 4
[*.{yml,zpt,pt,dtml}]
# 2 space indentation
indent_size = 2
[{Makefile,.gitmodules}]
# Tab indentation (no size specified, but view as 4 spaces)
indent_style = tab
indent_size = unset
tab_width = unset

View File

@ -1,7 +1,9 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
###
# Initially copied from
# https://github.com/actions/starter-workflows/blob/main/ci/python-package.yml
# And later based on the version I (jamadden) updated at
# And later based on the version jamadden updated at
# gevent/gevent, and then at zodb/relstorage and zodb/perfmetrics
#
# Original comment follows.
@ -35,14 +37,14 @@
name: tests
# Triggers the workflow on push or pull request events
on: [push, pull_request]
# Limiting to particular branches might be helpful to conserve minutes.
#on:
# push:
# branches: [ $default-branch ]
# pull_request:
# branches: [ $default-branch ]
# Triggers the workflow on push or pull request events and periodically
on:
push:
pull_request:
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:
env:
# Weirdly, this has to be a top-level key, not ``defaults.env``
@ -72,7 +74,6 @@ env:
###
jobs:
# Because sharing code/steps is so hard, and because it can be
# extremely valuable to be able to get binary wheels without
@ -86,13 +87,21 @@ jobs:
# This division is time-saving for projects that take awhile to
# build, but somewhat less of a clear-cut win given how quick this
# is to compile (at least at this writing).
build-zope_interface:
build-package:
# Sigh. Note that the matrix must be kept in sync
# with `test`, and `docs` must use a subset.
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [2.7, pypy-2.7, pypy-3.6, 3.5, 3.6, 3.7, 3.8, 3.9]
python-version:
- 2.7
- 3.5
- pypy-2.7
- pypy-3.6
- 3.6
- 3.7
- 3.8
- 3.9
os: [ubuntu-20.04, macos-latest]
exclude:
- os: macos-latest
@ -131,7 +140,7 @@ jobs:
- name: Install Build Dependencies
run: |
pip install -U pip
pip install -U setuptools wheel twine
pip install -U setuptools wheel twine cffi
pip install -U coveralls coverage
- name: Build zope.interface
@ -165,11 +174,19 @@ jobs:
twine upload --skip-existing dist/*
test:
needs: build-zope_interface
needs: build-package
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [2.7, pypy-2.7, pypy-3.6, 3.5, 3.6, 3.7, 3.8, 3.9]
python-version:
- 2.7
- 3.5
- pypy-2.7
- pypy-3.6
- 3.6
- 3.7
- 3.8
- 3.9
os: [ubuntu-20.04, macos-latest]
exclude:
- os: macos-latest
@ -186,6 +203,12 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
###
# Caching.
# This actually *restores* a cache and schedules a cleanup action
# to save the cache. So it must come before the thing we want to use
# the cache.
###
- name: Get pip cache dir
id: pip-cache
run: |
@ -225,7 +248,7 @@ jobs:
coverage run -p -m unittest discover -s src
PURE_PYTHON=1 coverage run -p -m unittest discover -s src
coverage combine
coverage report -i
coverage report --ignore-errors --show-missing
- name: Submit to Coveralls
# This is a container action, which only runs on Linux.
if: ${{ startsWith(runner.os, 'Linux') }}
@ -243,7 +266,7 @@ jobs:
parallel-finished: true
docs:
needs: build-zope_interface
needs: build-package
runs-on: ${{ matrix.os }}
strategy:
matrix:
@ -257,6 +280,12 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
###
# Caching.
# This actually *restores* a cache and schedules a cleanup action
# to save the cache. So it must come before the thing we want to use
# the cache.
###
- name: Get pip cache dir
id: pip-cache
run: |
@ -279,8 +308,9 @@ jobs:
run: |
pip install -U wheel
pip install -U coverage
pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"'
pip install -U "`ls dist/zope.interface-*.whl`[docs]"
# Until repoze.sphinx.autointerface supports Sphinx 4.x we cannot use it:
pip install -U "Sphinx < 4"
- name: Build docs
env:
ZOPE_INTERFACE_STRICT_IRO: 1
@ -290,7 +320,7 @@ jobs:
lint:
needs: build-zope_interface
needs: build-package
runs-on: ${{ matrix.os }}
strategy:
matrix:
@ -304,7 +334,12 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
###
# Caching.
# This actually *restores* a cache and schedules a cleanup action
# to save the cache. So it must come before the thing we want to use
# the cache.
###
- name: Get pip cache dir
id: pip-cache
run: |
@ -351,6 +386,12 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
###
# Caching.
# This actually *restores* a cache and schedules a cleanup action
# to save the cache. So it must come before the thing we want to use
# the cache.
###
- name: Get pip cache dir
id: pip-cache
run: |
@ -408,16 +449,3 @@ jobs:
password: ${{ secrets.TWINE_PASSWORD }}
skip_existing: true
packages_dir: wheelhouse/
# TODO:
# * Use YAML syntax to share snippets, like the old .travis.yml did
# Sadly, as of 2021-02-01, Github Actions does not support anchors at
# all. Just having an anchor results in an error:
#
# The workflow is not valid. .github/workflows/tests.yml: Anchors
# are not currently supported. Remove the anchor 'an-strategy'
#
# The alternative of using composite actions doesn't work either,
# because composite actions are limited to running shell scripts.
# Steps in them can't call other actions with `uses:`, and nor can
# they be conditional with `if:`.

29
.gitignore vendored
View File

@ -1,24 +1,29 @@
*.egg-info
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
*.egg-info/
*.profraw
*.pyc
*.pyo
*.so
*.swp
__pycache__
.coverage
.coverage.*
.installed.cfg
default.profraw
nosetests.xml
coverage.xml
pyvenv.cfg
.eggs/
.installed.cfg
.mr.developer.cfg
.tox/
.vscode/
__pycache__/
bin/
build/
eggs/
coverage.xml
develop-eggs/
docs/_build/
develop/
dist/
docs/_build
eggs/
etc/
lib/
lib64
log/
parts/
htmlcov/
pyvenv.cfg
var/

117
.meta.toml Normal file
View File

@ -0,0 +1,117 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
[meta]
template = "c-code"
commit-id = "3ddccc7a1430600364f48f37e4f24a275e1bbb85"
[python]
with-appveyor = true
with-pypy = true
with-legacy-python = true
with-docs = false
with-sphinx-doctests = false
[tox]
use-flake8 = false
additional-envlist = [
"docs",
]
testenv-commands = [
"coverage run -p -m unittest discover -s src",
]
testenv-deps = [
]
testenv-setenv = [
"ZOPE_INTERFACE_STRICT_IRO=1",
]
testenv-additional = [
"",
"[testenv:docs]",
"basepython = python3",
"# Until repoze.sphinx.autointerface supports Sphinx 4.x we cannot use it:",
"deps =",
" Sphinx < 4",
" coverage",
"extras = docs",
"commands =",
" sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html",
" coverage run -p -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctest",
]
coverage-command = "coverage combine"
coverage-additional = [
"depends = py27,py27-pure,py35,py35-pure,py36,py36-pure,py37,py37-pure,py38,py38-pure,py39,py39-pure,pypy,pypy3,docs",
"parallel_show_output = true",
]
[coverage]
fail-under = 99
[manifest]
additional-rules = [
"include *.cmd",
"include *.sh",
"include *.yml",
"include .coveragerc",
"recursive-include benchmarks *.py",
"recursive-include docs *.bat",
"recursive-include docs *.py",
"recursive-include docs *.rst",
"recursive-include docs Makefile",
]
[check-manifest]
additional-ignores = [
"docs/_build/doctest/output.txt",
"docs/_build/html/_sources/*",
"docs/_build/html/_sources/api/*",
]
[github-actions]
additional-install = [
"- name: Install zope.interface",
" # ``python -m unittest discover`` only works with editable",
" # installs, so we have to duplicate some work and can't",
" # install the built wheel. (zope.testrunner",
" # works fine with non-editable installs.)",
" run: |",
" pip install -U wheel",
" pip install -U coverage",
" pip install -U 'faulthandler; python_version == \"2.7\" and platform_python_implementation == \"CPython\"'",
" # Unzip into src/ so that testrunner can find the .so files",
" # when we ask it to load tests from that directory. This",
" # might also save some build time?",
" unzip -n dist/zope.interface-*whl -d src",
" pip install -U -e .[test]",
"- name: Run tests and report coverage",
" # Once with C extensions, once without. Yes, this runs them",
" # twice on PyPy.",
" run: |",
" coverage run -p -m unittest discover -s src",
" PURE_PYTHON=1 coverage run -p -m unittest discover -s src",
" coverage combine",
" coverage report --ignore-errors --show-missing",
]
[appveyor]
global-env-vars = [
"global:",
" TWINE_USERNAME: zope.wheelbuilder",
" TWINE_PASSWORD:",
" secure: UcdTh6W78cRLVGfKRFoa5A==",
]
build-script = [
"- python -W ignore setup.py -q bdist_wheel",
]
test-steps = [
"- python -m unittest discover -s src",
]
additional-lines = [
"artifacts:",
" - path: 'dist\\*.whl'",
" name: wheel",
"",
"deploy_script:",
" - ps: if ($env:APPVEYOR_REPO_TAG -eq $TRUE) { pip install twine; twine upload --skip-existing dist/* }",
"",
"deploy: on",
]

View File

@ -5,7 +5,7 @@
5.4.1 (unreleased)
==================
- Nothing changed yet.
- Add missing Trove classifier showing support for Python 3.9.
5.4.0 (2021-04-15)

View File

@ -1,21 +1,19 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
include *.rst
include *.txt
include *.py
include *.sh
include .coveragerc
include build.cmd
include buildout.cfg
include tox.ini
include appveyor.yml
include .coveragerc
recursive-include docs *
recursive-include src *
global-exclude *.dll
global-exclude *.pyc
global-exclude *.pyo
global-exclude *.so
global-exclude coverage.xml
global-exclude appveyor.yml
prune docs/_build
prune benchmarks
recursive-include src *.py
include *.cmd
include *.sh
include *.yml
include .coveragerc
recursive-include benchmarks *.py
recursive-include docs *.bat
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs Makefile

View File

@ -1,4 +1,7 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
environment:
global:
TWINE_USERNAME: zope.wheelbuilder
TWINE_PASSWORD:
@ -19,6 +22,7 @@ environment:
- python: 39-x64
install:
- "SET PYTHONVERSION=%PYTHON%"
- "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%"
- ps: |
$env:PYTHON = "C:\\Python${env:PYTHON}"
@ -28,8 +32,12 @@ install:
}
- ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" }
- echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
- python -m pip install -U pip setuptools wheel
- python -m pip install -U -e ".[test]"
- python -m pip install -U pip
- pip install -U setuptools wheel
- pip install -U -e .[test]
matrix:
fast_finish: true
build_script:
- python -W ignore setup.py -q bdist_wheel
@ -37,6 +45,8 @@ build_script:
test_script:
- python -m unittest discover -s src
on_success:
- echo Build succesful!
artifacts:
- path: 'dist\*.whl'
name: wheel

View File

@ -1,21 +1,15 @@
[nosetests]
nocapture=1
cover-package=zope.interface
cover-erase=1
cover-min-percentage=100
cover-branches=1
with-doctest=0
where=src
[aliases]
dev = develop easy_install zope.interface[testing]
docs = easy_install zope.interface[docs]
[metadata]
license_file = LICENSE.txt
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
[bdist_wheel]
universal = 0
universal = 1
[zest.releaser]
create-wheel = no
[flake8]
doctests = 1
[check-manifest]
ignore =
.editorconfig
.meta.toml
docs/_build/doctest/output.txt
docs/_build/html/_sources/*
docs/_build/html/_sources/api/*

View File

@ -120,6 +120,7 @@ setup(name='zope.interface',
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Framework :: Zope :: 3",

View File

@ -124,7 +124,7 @@ class Test_asStructuredText(unittest.TestCase):
""" This interface has a method.
"""
def aMethod():
pass
pass # pragma: no cover
self.assertEqual(self._callFUT(IHasMethod), EXPECTED)
@ -142,7 +142,7 @@ class Test_asStructuredText(unittest.TestCase):
""" This interface has a method.
"""
def aMethod(first, second):
pass
pass # pragma: no cover
self.assertEqual(self._callFUT(IHasMethod), EXPECTED)
@ -160,7 +160,7 @@ class Test_asStructuredText(unittest.TestCase):
""" This interface has a method.
"""
def aMethod(first, second, *rest):
pass
pass # pragma: no cover
self.assertEqual(self._callFUT(IHasMethod), EXPECTED)
@ -178,7 +178,7 @@ class Test_asStructuredText(unittest.TestCase):
""" This interface has a method.
"""
def aMethod(first, second, **kw):
pass
pass # pragma: no cover
self.assertEqual(self._callFUT(IHasMethod), EXPECTED)
@ -221,9 +221,9 @@ class Test_asStructuredText(unittest.TestCase):
class IBase(Interface):
def method1():
pass
"""docstring"""
def method2():
pass
"""docstring"""
class IDerived(IBase):
"IDerived doc"
@ -233,7 +233,7 @@ class Test_asStructuredText(unittest.TestCase):
def method3():
"method3 doc"
def method4():
pass
pass # pragma: no cover
def method5():
"method5 doc"
@ -348,7 +348,7 @@ class Test_asReStructuredText(unittest.TestCase):
""" This interface has a method.
"""
def aMethod():
pass
pass # pragma: no cover
self.assertEqual(self._callFUT(IHasMethod), EXPECTED)
@ -366,7 +366,7 @@ class Test_asReStructuredText(unittest.TestCase):
""" This interface has a method.
"""
def aMethod(first, second):
pass
pass # pragma: no cover
self.assertEqual(self._callFUT(IHasMethod), EXPECTED)
@ -384,7 +384,7 @@ class Test_asReStructuredText(unittest.TestCase):
""" This interface has a method.
"""
def aMethod(first, second, *rest):
pass
pass # pragma: no cover
self.assertEqual(self._callFUT(IHasMethod), EXPECTED)
@ -402,7 +402,7 @@ class Test_asReStructuredText(unittest.TestCase):
""" This interface has a method.
"""
def aMethod(first, second, **kw):
pass
pass # pragma: no cover
self.assertEqual(self._callFUT(IHasMethod), EXPECTED)
@ -445,9 +445,9 @@ class Test_asReStructuredText(unittest.TestCase):
class IBase(Interface):
def method1():
pass
pass # pragma: no cover
def method2():
pass
pass # pragma: no cover
class IDerived(IBase):
"IDerived doc"
@ -457,7 +457,7 @@ class Test_asReStructuredText(unittest.TestCase):
def method3():
"method3 doc"
def method4():
pass
pass # pragma: no cover
def method5():
"method5 doc"

View File

@ -1177,9 +1177,9 @@ class InterfaceTests(unittest.TestCase):
class ICurrent(Interface):
def method1(a, b):
pass
"""docstring"""
def method2(a, b):
pass
"""docstring"""
class IOther(Interface):
pass
@ -1207,7 +1207,7 @@ class InterfaceTests(unittest.TestCase):
from zope.interface import providedBy
class IBase(Interface):
def method():
pass
"""docstring"""
class IDerived(IBase):
pass
class Current():
@ -1230,7 +1230,7 @@ class InterfaceTests(unittest.TestCase):
class IBase(Interface):
def method():
pass
"""docstring"""
class IDerived(IBase):
pass
@ -1258,7 +1258,7 @@ class InterfaceTests(unittest.TestCase):
class ILeft(Interface):
def method():
pass
"""docstring"""
class IRight(ILeft):
pass
@ -1292,7 +1292,7 @@ class InterfaceTests(unittest.TestCase):
class ILeft(Interface):
def method():
pass
"""docstring"""
class IRight(ILeft):
pass
@ -1405,7 +1405,7 @@ class InterfaceTests(unittest.TestCase):
attr = Attribute(u'My attr')
def method():
pass
"""docstring"""
self.assertEqual(sorted(ISimple.names()), ['attr', 'method'])
@ -1418,16 +1418,16 @@ class InterfaceTests(unittest.TestCase):
attr = Attribute(u'My attr')
def method():
pass
"""docstring"""
class IDerived(IBase):
attr2 = Attribute(u'My attr2')
def method():
pass
"""docstring"""
def method2():
pass
"""docstring"""
self.assertEqual(sorted(IDerived.names()),
['attr2', 'method', 'method2'])
@ -1753,7 +1753,7 @@ class InterfaceTests(unittest.TestCase):
class ITagMe(Interface):
def method():
pass
"""docstring"""
method.optional = 1
method = ITagMe['method']

View File

@ -69,7 +69,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method():
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -84,7 +84,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method():
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -101,7 +101,7 @@ class Test_verifyClass(unittest.TestCase):
class IBase(Interface):
def method():
pass
"""docstring"""
class IDerived(IBase):
pass
@ -119,7 +119,7 @@ class Test_verifyClass(unittest.TestCase):
class IBase(Interface):
def method():
pass
"""docstring"""
class IDerived(IBase):
pass
@ -140,7 +140,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -158,7 +158,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -177,7 +177,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(*args):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -196,7 +196,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(**kw):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -215,7 +215,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -233,7 +233,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -250,7 +250,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -268,7 +268,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -286,7 +286,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -303,7 +303,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -321,7 +321,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a, *args):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -339,7 +339,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a, *args):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -356,7 +356,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a, *args):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -373,7 +373,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(**kwargs):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -391,7 +391,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(*args):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -411,7 +411,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(**kwargs):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):
@ -446,7 +446,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method():
pass
"""docstring"""
@implementer(ICurrent)
class Current:
@ -519,7 +519,7 @@ class Test_verifyClass(unittest.TestCase):
class ICurrent(Interface):
def method(a):
pass
"""docstring"""
@implementer(ICurrent)
class Current(object):

102
tox.ini
View File

@ -1,67 +1,63 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
[tox]
minversion = 3.18
envlist =
py27,py27-pure,
py35,py35-pure,
py36,
py37,
py38,py38-cext,
py39,
pypy,
pypy3,
coverage,
lint
py27,py27-pure
py35,py35-pure
py36,py36-pure
py37,py37-pure
py38,py38-pure
py39,py39-pure
pypy
pypy3
coverage
docs
# NB: if you add new environments, please also add them to depends in
# testenv:coverage so that parallel runs (tox -p auto) will work correctly
[testenv]
# ``usedevelop`` is required otherwise unittest complains that it
# discovers a file in src/... but imports it from .tox/.../
# ``skip_install`` also basically works, but that causes the ``extras``
# not to be installed (though ``deps`` still are), and doesn't
# rebuild C extensions.
usedevelop = true
deps =
setenv =
pure: PURE_PYTHON=1
!pure-!pypy-!pypy3: PURE_PYTHON=0
ZOPE_INTERFACE_STRICT_IRO=1
commands =
coverage run -p -m unittest discover -s src
extras = test
setenv =
ZOPE_INTERFACE_STRICT_IRO=1
[testenv:py27-pure]
setenv =
PURE_PYTHON=1
[testenv:py35-pure]
setenv =
PURE_PYTHON=1
[testenv:py38-cext]
# Require the C extension
setenv =
PURE_PYTHON=0
[testenv:py]
commands =
python --version
{[testenv]commands}
[testenv:coverage]
# The -i/--ignore arg is necessary; we get
# No source for code: '//.tox/pypy/site-packages/zope/interface/__init__.py'
# without it.
commands =
coverage combine
coverage report -i
coverage html -i
coverage xml -i
depends = py27,py27-pure,py35,py35-pure,py36,py37,py38,py38-cext,py39,pypy,pypy3,docs
parallel_show_output = true
extras =
test
[testenv:docs]
basepython =
python3
basepython = python3
# Until repoze.sphinx.autointerface supports Sphinx 4.x we cannot use it:
deps =
Sphinx < 4
coverage
extras = docs
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
coverage run -p -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctest
[testenv:coverage]
basepython = python3
allowlist_externals =
mkdir
deps =
Sphinx
repoze.sphinx.autointerface
coverage
commands =
mkdir -p {toxinidir}/parts/htmlcov
coverage combine
coverage html -i
coverage report -i -m --fail-under=99
depends = py27,py27-pure,py35,py35-pure,py36,py36-pure,py37,py37-pure,py38,py38-pure,py39,py39-pure,pypy,pypy3,docs
parallel_show_output = true
[testenv:lint]
basepython = python3
skip_install = true
deps =
check-manifest
check-python-versions
commands =
check-manifest
check-python-versions