From 54b6ad3869ed2d49ea4b8b3562f11fc674699956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jason=20K=C3=B6lker?= Date: Thu, 9 Feb 2012 12:00:43 -0600 Subject: [PATCH] declare the namespace with setuptools Also graft tools so it is included in pypi Change-Id: I6b7efee4585fc22cedff4da5f54b877f6a936b0e --- MANIFEST.in | 1 + melange/__init__.py | 9 +++++---- setup.py | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 330de3f..6f9ead8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,3 +3,4 @@ include openstack-common.conf include README.rst include tox.ini include melange/client/views/*.tpl +graft tools diff --git a/melange/__init__.py b/melange/__init__.py index 7d0d297..2e34742 100644 --- a/melange/__init__.py +++ b/melange/__init__.py @@ -14,7 +14,8 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -import pkgutil - - -__path__ = pkgutil.extend_path(__path__, __name__) +try: + __import__('pkg_resources').declare_namespace(__name__) +except ImportError: + from pkgutil import extend_path + __path__ = extend_path(__path__, __name__) diff --git a/setup.py b/setup.py index 5b02de5..6c97258 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ from melange.client.openstack.common.setup import write_git_changelog from setuptools.command.sdist import sdist import setuptools -version = "0.2" +version = "0.2.2" class local_sdist(sdist): @@ -33,6 +33,7 @@ class local_sdist(sdist): sdist.run(self) cmdclass = {'sdist': local_sdist} +install_requires = parse_requirements() if sys.version_info < (2, 6): install_requires.append("simplejson") @@ -67,7 +68,7 @@ setuptools.setup(name="python-melangeclient", author_email="openstack@lists.launchpad.net", include_package_data=True, packages=setuptools.find_packages(exclude=["tests"]), - install_requires=parse_requirements(), + install_requires=install_requires, dependency_links=parse_dependency_links(), entry_points={"console_scripts": console_scripts}, zip_safe=False,