Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ with-macos = false
use-flake8 = true
testenv-commands = [
"pip install -U -e .[test]",
"coverage run -p -m unittest discover -s src {posargs}",
"coverage run -p -m unittest discover -s src/zope {posargs}",
]
testenv-setenv = [
"ZOPE_INTERFACE_STRICT_IRO=1",
Expand Down Expand Up @@ -61,6 +61,9 @@ additional-ignores = [
"docs/_build/html/_static/scripts/*",
]

[coverage-run]
source = "src/zope"

[github-actions]
additional-install = [
"- name: Install zope.interface",
Expand Down
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
Changes
=========

7.3 (unreleased)
8.0 (unreleased)
================

- Replace ``pkg_resources`` namespace with PEP 420 native namespace.

- Drop support for Python 3.8.

- Allow using newer ``setuptools`` version.
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code

Expand All @@ -11,7 +10,7 @@ build-backend = "setuptools.build_meta"

[tool.coverage.run]
branch = true
source = ["zope.interface"]
source = ["src/zope"]
relative_files = true

[tool.coverage.report]
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
from distutils.errors import DistutilsPlatformError

from setuptools import Extension
from setuptools import find_packages
from setuptools import setup
from setuptools.command.build_ext import build_ext


version = '7.3.dev0'
version = '8.0.dev0'


class optional_build_ext(build_ext):
Expand Down Expand Up @@ -128,9 +127,10 @@ def read(*rnames):
"Framework :: Zope :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
],
packages=find_packages('src'),
# we need the following two parameters because we compile C code,
# otherwise only the shared library is installed:
package_dir={'': 'src'},
namespace_packages=["zope"],
packages=['zope.interface', 'zope.interface.common'],
cmdclass={
'build_ext': optional_build_ext,
},
Expand Down
1 change: 0 additions & 1 deletion src/zope/__init__.py

This file was deleted.

8 changes: 4 additions & 4 deletions src/zope/interface/tests/test_declarations.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def __call__(self):
foo.__name__ = 'foo'
spec = self._callFUT(foo)
self.assertEqual(spec.__name__,
'zope.interface.tests.test_declarations.foo')
'interface.tests.test_declarations.foo')
self.assertIs(spec.inherit, foo)
self.assertIs(foo.__implemented__, spec)
self.assertIs(
Expand All @@ -696,7 +696,7 @@ class Foo:

spec = self._callFUT(Foo)
self.assertEqual(spec.__name__,
'zope.interface.tests.test_declarations.Foo')
'interface.tests.test_declarations.Foo')
self.assertIs(spec.inherit, Foo)
self.assertIs(Foo.__implemented__, spec)
self.assertIsInstance(
Expand Down Expand Up @@ -1177,7 +1177,7 @@ class Foo:
self.assertIs(returned, foo)
spec = foo.__implemented__ # pylint:disable=no-member
self.assertEqual(
spec.__name__, 'zope.interface.tests.test_declarations.?'
spec.__name__, 'interface.tests.test_declarations.?'
)
self.assertIsNone(spec.inherit,)
self.assertIs(foo.__implemented__, spec) # pylint:disable=no-member
Expand Down Expand Up @@ -1436,7 +1436,7 @@ def test__repr__directlyProvides_module(self):
self.assertEqual(
repr(provides),
"directlyProvides(('zope.interface.tests.dummy', "
"'zope.interface.tests.test_declarations'), "
"'interface.tests.test_declarations'), "
"IFoo, IBar)"
)

Expand Down
12 changes: 6 additions & 6 deletions src/zope/interface/tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test___str__(self):
self.assertEqual(
str(dni),
"An object has failed to implement interface "
"zope.interface.tests.test_exceptions.IDummy: "
"interface.tests.test_exceptions.IDummy: "
"Does not declaratively implement the interface."
)

Expand All @@ -49,7 +49,7 @@ def test___str__w_candidate(self):
self.assertEqual(
str(dni),
"The object 'candidate' has failed to implement interface "
"zope.interface.tests.test_exceptions.IDummy: "
"interface.tests.test_exceptions.IDummy: "
"Does not declaratively implement the interface."
)

Expand All @@ -69,15 +69,15 @@ def test___str__(self):
self.assertEqual(
str(dni),
'An object has failed to implement interface '
'zope.interface.tests.test_exceptions.IDummy: '
'interface.tests.test_exceptions.IDummy: '
"The 'missing' attribute was not provided.")

def test___str__w_candidate(self):
dni = self._makeOne('candidate')
self.assertEqual(
str(dni),
'The object \'candidate\' has failed to implement interface '
'zope.interface.tests.test_exceptions.IDummy: '
'interface.tests.test_exceptions.IDummy: '
"The 'missing' attribute was not provided.")


Expand Down Expand Up @@ -166,7 +166,7 @@ def test__str__(self):
self.assertEqual(
str(dni),
"The object 'target' has failed to implement interface "
"zope.interface.tests.test_exceptions.IDummy:\n"
"interface.tests.test_exceptions.IDummy:\n"
" The contract of 'aMethod' is violated because I said so\n"
" Regular exception"
)
Expand All @@ -183,7 +183,7 @@ def test__repr__(self):
self.assertEqual(
repr(dni),
"MultipleInvalid("
"<InterfaceClass zope.interface.tests.test_exceptions.IDummy>,"
"<InterfaceClass interface.tests.test_exceptions.IDummy>,"
" 'target',"
" (BrokenMethodImplementation('aMethod', 'I said so'),"
" Exception('Regular', 'exception')))"
Expand Down
2 changes: 1 addition & 1 deletion src/zope/interface/tests/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ def test___hash___normal(self):
iface = self._makeOne('HashMe')
self.assertEqual(
hash(iface),
hash(('HashMe', 'zope.interface.tests.test_interface'))
hash(('HashMe', 'interface.tests.test_interface'))
)

def test___hash___missing_required_attrs(self):
Expand Down
22 changes: 11 additions & 11 deletions src/zope/interface/tests/test_ro.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,17 @@ def _check_handler_complex_diamond(self):

expected = """\
Object <InterfaceClass {name}> has different legacy and C3 MROs:
Legacy RO (len=7) C3 RO (len=7; inconsistent=no)
==================================================================
zope.interface.tests.test_ro.A zope.interface.tests.test_ro.A
zope.interface.tests.test_ro.B zope.interface.tests.test_ro.B
- zope.interface.tests.test_ro.E
zope.interface.tests.test_ro.C zope.interface.tests.test_ro.C
zope.interface.tests.test_ro.D zope.interface.tests.test_ro.D
+ zope.interface.tests.test_ro.E
zope.interface.tests.test_ro.F zope.interface.tests.test_ro.F
zope.interface.Interface zope.interface.Interface""".format(
name="zope.interface.tests.test_ro.A"
Legacy RO (len=7) C3 RO (len=7; inconsistent=no)
========================================================
interface.tests.test_ro.A interface.tests.test_ro.A
interface.tests.test_ro.B interface.tests.test_ro.B
- interface.tests.test_ro.E
interface.tests.test_ro.C interface.tests.test_ro.C
interface.tests.test_ro.D interface.tests.test_ro.D
+ interface.tests.test_ro.E
interface.tests.test_ro.F interface.tests.test_ro.F
zope.interface.Interface zope.interface.Interface""".format(
name="interface.tests.test_ro.A"
)

self.assertEqual(
Expand Down
3 changes: 3 additions & 0 deletions src/zope/interface/tests/test_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def test_w_equal_names(self):
# interfaces with equal names but different modules should sort by
# module name
from zope.interface.tests.m1 import I1 as m1_I1
# We need to import I1 again to get a module path starting with `zope`
# instead of `interfaces`.
from zope.interface.tests.test_sorting import I1
iface_list = [I1, m1_I1]
iface_list.sort()
self.assertEqual(iface_list, [m1_I1, I1])
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ setenv =
ZOPE_INTERFACE_STRICT_IRO=1
commands =
pip install -U -e .[test]
coverage run -p -m unittest discover -s src {posargs}
coverage run -p -m unittest discover -s src/zope {posargs}
sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest
extras =
test
Expand Down
Loading