diff --git a/django_plotly_dash/__init__.py b/django_plotly_dash/__init__.py index e9e95703..3f097d81 100644 --- a/django_plotly_dash/__init__.py +++ b/django_plotly_dash/__init__.py @@ -26,6 +26,6 @@ SOFTWARE. ''' -__version__ = "0.9.4" +from .version import __version__ from .dash_wrapper import DjangoDash diff --git a/django_plotly_dash/version.py b/django_plotly_dash/version.py new file mode 100644 index 00000000..04c308e6 --- /dev/null +++ b/django_plotly_dash/version.py @@ -0,0 +1,7 @@ +''' +Define version number for django-plotly-dash, in a form that can be used by setup.py without importing the package. + +This addresses issue #81 +''' + +__version__ = "0.9.4" diff --git a/docs/development.rst b/docs/development.rst index 4f575784..43288f82 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -120,7 +120,7 @@ Release builds This section contains the recipe for building a release of the project. First, update the version number appropriately -in ``django_plotly_dash/__init__.py``, and then +in ``django_plotly_dash/version.py``, and then ensure that the checks and tests have been run:: ./check_code @@ -140,7 +140,7 @@ first a snapshot of the development environment used for the build should be gen pip freeze > frozen_dev.txt git add frozen_dev.txt - git add django_plotly_dash/__init__.py + git add django_plotly_dash/version.py git commit -m" ... suitable commit message for this release ..." diff --git a/setup.py b/setup.py index 54b389fa..4f3e457f 100644 --- a/setup.py +++ b/setup.py @@ -2,16 +2,18 @@ from setuptools import setup -import django_plotly_dash as dpd +#import django_plotly_dash as dpd +#VERSION = dpd.__version__ -VERSION = dpd.__version__ +with open('django_plotly_dash/version.py') as f: + exec(f.read()) with open('README.md') as f: long_description = f.read() setup( name="django-plotly-dash", - version=VERSION, + version=__version__, url="https://github.com/GibbsConsulting/django-plotly-dash", description="Django use of plotly dash apps through template tags", long_description=long_description,