From b8db1b1c529e4823a6c25fdd47d07ceac78bd669 Mon Sep 17 00:00:00 2001 From: Pavel Korshunov <pavel.korshunov@idiap.ch> Date: Thu, 19 Nov 2015 15:38:28 +0100 Subject: [PATCH] pkg_resources is replaces with pkgutil --- bob/__init__.py | 5 +++-- examples/bob.example.extension/bob/__init__.py | 5 +++-- examples/bob.example.extension/bob/example/__init__.py | 5 +++-- examples/bob.example.extension/setup.py | 5 +---- examples/bob.example.library/bob/__init__.py | 5 +++-- examples/bob.example.library/bob/example/__init__.py | 5 +++-- examples/bob.example.library/setup.py | 5 +---- examples/bob.example.project/bob/__init__.py | 5 +++-- examples/bob.example.project/bob/example/__init__.py | 5 +++-- examples/bob.example.project/setup.py | 5 +---- setup.py | 4 +--- 11 files changed, 25 insertions(+), 29 deletions(-) diff --git a/bob/__init__.py b/bob/__init__.py index 60381ea..2ab1e28 100644 --- a/bob/__init__.py +++ b/bob/__init__.py @@ -1,2 +1,3 @@ -#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages -__import__('pkg_resources').declare_namespace(__name__) +# see https://docs.python.org/3/library/pkgutil.html +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) diff --git a/examples/bob.example.extension/bob/__init__.py b/examples/bob.example.extension/bob/__init__.py index 60381ea..2ab1e28 100644 --- a/examples/bob.example.extension/bob/__init__.py +++ b/examples/bob.example.extension/bob/__init__.py @@ -1,2 +1,3 @@ -#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages -__import__('pkg_resources').declare_namespace(__name__) +# see https://docs.python.org/3/library/pkgutil.html +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) diff --git a/examples/bob.example.extension/bob/example/__init__.py b/examples/bob.example.extension/bob/example/__init__.py index 60381ea..2ab1e28 100644 --- a/examples/bob.example.extension/bob/example/__init__.py +++ b/examples/bob.example.extension/bob/example/__init__.py @@ -1,2 +1,3 @@ -#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages -__import__('pkg_resources').declare_namespace(__name__) +# see https://docs.python.org/3/library/pkgutil.html +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) diff --git a/examples/bob.example.extension/setup.py b/examples/bob.example.extension/setup.py index a99aa87..540aba4 100644 --- a/examples/bob.example.extension/setup.py +++ b/examples/bob.example.extension/setup.py @@ -96,10 +96,7 @@ setup( # Our database packages are good examples of namespace implementations # using several layers. You can check them out here: # https://github.com/idiap/bob/wiki/Satellite-Packages - namespace_packages = [ - 'bob', - 'bob.example', - ], + # In fact, we are defining two extensions here. In any case, you can define # as many extensions as you need. Each of them will be compiled diff --git a/examples/bob.example.library/bob/__init__.py b/examples/bob.example.library/bob/__init__.py index 60381ea..2ab1e28 100644 --- a/examples/bob.example.library/bob/__init__.py +++ b/examples/bob.example.library/bob/__init__.py @@ -1,2 +1,3 @@ -#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages -__import__('pkg_resources').declare_namespace(__name__) +# see https://docs.python.org/3/library/pkgutil.html +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) diff --git a/examples/bob.example.library/bob/example/__init__.py b/examples/bob.example.library/bob/example/__init__.py index 60381ea..2ab1e28 100644 --- a/examples/bob.example.library/bob/example/__init__.py +++ b/examples/bob.example.library/bob/example/__init__.py @@ -1,2 +1,3 @@ -#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages -__import__('pkg_resources').declare_namespace(__name__) +# see https://docs.python.org/3/library/pkgutil.html +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) diff --git a/examples/bob.example.library/setup.py b/examples/bob.example.library/setup.py index 14b5f18..fd3243c 100644 --- a/examples/bob.example.library/setup.py +++ b/examples/bob.example.library/setup.py @@ -94,10 +94,7 @@ setup( # Our database packages are good examples of namespace implementations # using several layers. You can check them out here: # https://github.com/idiap/bob/wiki/Satellite-Packages - namespace_packages = [ - 'bob', - 'bob.example', - ], + # In fact, we are defining two extensions here. In any case, you can define # as many extensions as you need. Each of them will be compiled diff --git a/examples/bob.example.project/bob/__init__.py b/examples/bob.example.project/bob/__init__.py index 60381ea..2ab1e28 100644 --- a/examples/bob.example.project/bob/__init__.py +++ b/examples/bob.example.project/bob/__init__.py @@ -1,2 +1,3 @@ -#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages -__import__('pkg_resources').declare_namespace(__name__) +# see https://docs.python.org/3/library/pkgutil.html +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) diff --git a/examples/bob.example.project/bob/example/__init__.py b/examples/bob.example.project/bob/example/__init__.py index 60381ea..2ab1e28 100644 --- a/examples/bob.example.project/bob/example/__init__.py +++ b/examples/bob.example.project/bob/example/__init__.py @@ -1,2 +1,3 @@ -#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages -__import__('pkg_resources').declare_namespace(__name__) +# see https://docs.python.org/3/library/pkgutil.html +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) diff --git a/examples/bob.example.project/setup.py b/examples/bob.example.project/setup.py index b1eea43..4192255 100644 --- a/examples/bob.example.project/setup.py +++ b/examples/bob.example.project/setup.py @@ -82,10 +82,7 @@ setup( # Our database packages are good examples of namespace implementations # using several layers. You can check them out here: # https://github.com/idiap/bob/wiki/Satellite-Packages - namespace_packages = [ - 'bob', - 'bob.example', - ], + # This entry defines which scripts you will have inside the 'bin' directory # once you install the package (or run 'bin/buildout'). The order of each diff --git a/setup.py b/setup.py index 5c389e3..75a1c72 100644 --- a/setup.py +++ b/setup.py @@ -31,9 +31,7 @@ setup( include_package_data=True, zip_safe=False, - namespace_packages=[ - "bob", - ], + install_requires=requiries, -- GitLab