From 668023d36830865c6313c55b48ce9cfcb644ee3a Mon Sep 17 00:00:00 2001 From: j Date: Fri, 29 Sep 2017 13:34:44 +0200 Subject: [PATCH] declare shared namespace --- setup.py | 5 ++++- shared/__init__.py | 3 +-- shared/utils/__init__.py | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index bceaff0..9dd2c3f 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,8 @@ from io import open import os from setuptools import setup, find_packages +import shared.utils + def read(filename): path = os.path.join(os.path.dirname(__file__), filename) @@ -13,7 +15,7 @@ def read(filename): setup( name='django-shared-utils', - version=__import__('shared').__version__, + version=shared.utils.__version__, description=' Mix of Python and Django utility functions, classed etc.', long_description=read('README.md'), author='Erik Stein', @@ -24,6 +26,7 @@ setup( packages=find_packages( exclude=['tests', 'testapp'], ), + namespace_packages=['shared'], include_package_data=True, install_requires=[ # 'django<2', commented out to make `pip install -U` easier diff --git a/shared/__init__.py b/shared/__init__.py index a98a624..de40ea7 100644 --- a/shared/__init__.py +++ b/shared/__init__.py @@ -1,2 +1 @@ -VERSION = (0, 2, 1) -__version__ = '.'.join(map(str, VERSION)) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/shared/utils/__init__.py b/shared/utils/__init__.py index 9ced646..5b46ba4 100644 --- a/shared/utils/__init__.py +++ b/shared/utils/__init__.py @@ -2,6 +2,9 @@ from __future__ import unicode_literals # Erik Stein , 2007-2016 +VERSION = (0, 2, 1) +__version__ = '.'.join(map(str, VERSION)) + try: from django.utils.translation import ugettext_lazy as _