65 lines
2.1 KiB
Diff
65 lines
2.1 KiB
Diff
From 4ed25e968600406364a037ce00cb8c2b2a56628f Mon Sep 17 00:00:00 2001
|
|
From: Carl Smedstad <carl.smedstad@protonmail.com>
|
|
Date: Fri, 23 Aug 2024 07:10:47 +0200
|
|
Subject: [PATCH 1/2] Modernize setuptools usage to fix warnings
|
|
|
|
Remove explicit declaration of namespace via the parameter namespace_packages,
|
|
deprecated in favor of implicit namespaces. Fixes warning:
|
|
|
|
> SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
|
|
|
|
Declare all packages by using package discovery function
|
|
find_namespace_packages. Fixes warning:
|
|
|
|
> _Warning: Package 'zope.testrunner.tests' is absent from the `packages` configuration.
|
|
|
|
See documentation at: https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#native-namespace-packages
|
|
---
|
|
setup.py | 7 ++-----
|
|
src/zope/__init__.py | 1 -
|
|
2 files changed, 2 insertions(+), 6 deletions(-)
|
|
delete mode 100644 src/zope/__init__.py
|
|
|
|
diff --git a/setup.py b/setup.py
|
|
index 9d2925c..44822fc 100644
|
|
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -18,6 +18,7 @@
|
|
##############################################################################
|
|
import os
|
|
|
|
+from setuptools import find_namespace_packages
|
|
from setuptools import setup
|
|
|
|
|
|
@@ -90,10 +91,7 @@ setup(
|
|
long_description=long_description,
|
|
author='Zope Foundation and Contributors',
|
|
author_email='zope-dev@zope.dev',
|
|
- packages=[
|
|
- "zope",
|
|
- "zope.testrunner",
|
|
- ],
|
|
+ packages=find_namespace_packages(where='src'),
|
|
package_dir={'': 'src'},
|
|
classifiers=[
|
|
"Development Status :: 5 - Production/Stable",
|
|
@@ -116,7 +114,6 @@ setup(
|
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
"Topic :: Software Development :: Testing",
|
|
],
|
|
- namespace_packages=['zope'],
|
|
python_requires='>=3.7',
|
|
install_requires=INSTALL_REQUIRES,
|
|
tests_require=TESTS_REQUIRE,
|
|
diff --git a/src/zope/__init__.py b/src/zope/__init__.py
|
|
deleted file mode 100644
|
|
index de40ea7..0000000
|
|
--- a/src/zope/__init__.py
|
|
+++ /dev/null
|
|
@@ -1 +0,0 @@
|
|
-__import__('pkg_resources').declare_namespace(__name__)
|
|
--
|
|
2.46.0
|
|
|