File: 01_add_missing_namespace_info.diff

package info (click to toggle)
python-jaraco.functools 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 192 kB
  • sloc: python: 335; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 1,133 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# turn jaraco.functools into a namespace package to avoid filename
# collisions with other jaraco subpackages such as .itertools
Index: python-jaraco.functools-2.0/setup.py
===================================================================
--- python-jaraco.functools-2.0.orig/setup.py
+++ python-jaraco.functools-2.0/setup.py
@@ -3,4 +3,4 @@
 import setuptools
 
 if __name__ == "__main__":
-    setuptools.setup(use_scm_version=True)
+    setuptools.setup(use_scm_version=True, namespace_packages=['jaraco'], packages=setuptools.find_packages())
Index: python-jaraco.functools-2.0/jaraco/__init__.py
===================================================================
--- python-jaraco.functools-2.0.orig/jaraco/__init__.py
+++ python-jaraco.functools-2.0/jaraco/__init__.py
@@ -1 +1,8 @@
+try:
+    # the pkg_resources stanza seems necessary for setuptools
+    # which errors out if it's missing, although the namespace
+    # mechanism should work just fine without it
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    pass
 __path__ = __import__('pkgutil').extend_path(__path__, __name__)