Skip to content

Commit 92dbbd9

Browse files
authored
Switch to PEP 420 native namespace. (#344)
* Bumped version for breaking release. * Replace ``pkg_resources`` namespace with PEP 420 native namespace. * Update to native namespace. Need to change tests because of changed discover path. (Using only `src` as before did not run any tests. discover does not seem to support PEP-420 namespace packages very well. :-( ) * Configuring for c-code * Switch back to original interface paths.
1 parent ef42bcd commit 92dbbd9

File tree

12 files changed

+75
-129
lines changed

12 files changed

+75
-129
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,10 @@ jobs:
341341
- name: Run tests with C extensions
342342
if: ${{ !startsWith(matrix.python-version, 'pypy') }}
343343
run: |
344-
coverage run -p -m unittest discover -s src
344+
coverage run -p -m unittest discover -s src/zope
345345
- name: Run tests without C extensions
346346
run: |
347-
coverage run -p -m unittest discover -s src
347+
coverage run -p -m unittest discover -s src/zope
348348
env:
349349
PURE_PYTHON: 1
350350
- name: Report Coverage

.meta.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ with-macos = false
1616
use-flake8 = true
1717
testenv-commands = [
1818
"pip install -U -e .[test]",
19-
"coverage run -p -m unittest discover -s src {posargs}",
19+
"coverage run -p -m unittest discover -s src/zope {posargs}",
2020
]
2121
testenv-setenv = [
2222
"ZOPE_INTERFACE_STRICT_IRO=1",
@@ -61,6 +61,9 @@ additional-ignores = [
6161
"docs/_build/html/_static/scripts/*",
6262
]
6363

64+
[coverage-run]
65+
source = "src/zope"
66+
6467
[github-actions]
6568
additional-install = [
6669
"- name: Install zope.interface",
@@ -79,10 +82,10 @@ additional-install = [
7982
"- name: Run tests with C extensions",
8083
" if: ${{ !startsWith(matrix.python-version, 'pypy') }}",
8184
" run: |",
82-
" coverage run -p -m unittest discover -s src",
85+
" coverage run -p -m unittest discover -s src/zope",
8386
"- name: Run tests without C extensions",
8487
" run: |",
85-
" coverage run -p -m unittest discover -s src",
88+
" coverage run -p -m unittest discover -s src/zope",
8689
" env:",
8790
" PURE_PYTHON: 1",
8891
"- name: Report Coverage",

CHANGES.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
Changes
33
=========
44

5-
7.3 (unreleased)
5+
8.0 (unreleased)
66
================
77

8+
- Replace ``pkg_resources`` namespace with PEP 420 native namespace.
9+
810
- Drop support for Python 3.8.
911

1012
- Allow using newer ``setuptools`` version.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#
21
# Generated from:
32
# https://github.com/zopefoundation/meta/tree/master/config/c-code
43

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

1211
[tool.coverage.run]
1312
branch = true
14-
source = ["zope.interface"]
13+
source = ["src/zope"]
1514
relative_files = true
1615

1716
[tool.coverage.report]

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@
2626
from distutils.errors import DistutilsPlatformError
2727

2828
from setuptools import Extension
29-
from setuptools import find_packages
3029
from setuptools import setup
3130
from setuptools.command.build_ext import build_ext
3231

3332

34-
version = '7.3.dev0'
33+
version = '8.0.dev0'
3534

3635

3736
class optional_build_ext(build_ext):
@@ -128,9 +127,10 @@ def read(*rnames):
128127
"Framework :: Zope :: 3",
129128
"Topic :: Software Development :: Libraries :: Python Modules",
130129
],
131-
packages=find_packages('src'),
130+
# we need the following two parameters because we compile C code,
131+
# otherwise only the shared library is installed:
132132
package_dir={'': 'src'},
133-
namespace_packages=["zope"],
133+
packages=['zope.interface', 'zope.interface.common'],
134134
cmdclass={
135135
'build_ext': optional_build_ext,
136136
},

src/zope/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)