Skip to content

Commit 3ab79fc

Browse files
delsimGibbsConsulting
authored andcommitted
Add better sourcing of version info (#83)
* Add better sourcing of version info * Improved import of version number into setup.py
1 parent affccd8 commit 3ab79fc

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

django_plotly_dash/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
SOFTWARE.
2727
'''
2828

29-
__version__ = "0.9.4"
29+
from .version import __version__
3030

3131
from .dash_wrapper import DjangoDash

django_plotly_dash/version.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'''
2+
Define version number for django-plotly-dash, in a form that can be used by setup.py without importing the package.
3+
4+
This addresses issue #81
5+
'''
6+
7+
__version__ = "0.9.4"

docs/development.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Release builds
120120
This section contains the recipe for building a release of the project.
121121

122122
First, update the version number appropriately
123-
in ``django_plotly_dash/__init__.py``, and then
123+
in ``django_plotly_dash/version.py``, and then
124124
ensure that the checks and tests have been run::
125125

126126
./check_code
@@ -140,7 +140,7 @@ first a snapshot of the development environment used for the build should be gen
140140
pip freeze > frozen_dev.txt
141141

142142
git add frozen_dev.txt
143-
git add django_plotly_dash/__init__.py
143+
git add django_plotly_dash/version.py
144144

145145
git commit -m" ... suitable commit message for this release ..."
146146

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
from setuptools import setup
44

5-
import django_plotly_dash as dpd
5+
#import django_plotly_dash as dpd
6+
#VERSION = dpd.__version__
67

7-
VERSION = dpd.__version__
8+
with open('django_plotly_dash/version.py') as f:
9+
exec(f.read())
810

911
with open('README.md') as f:
1012
long_description = f.read()
1113

1214
setup(
1315
name="django-plotly-dash",
14-
version=VERSION,
16+
version=__version__,
1517
url="https://github.com/GibbsConsulting/django-plotly-dash",
1618
description="Django use of plotly dash apps through template tags",
1719
long_description=long_description,

0 commit comments

Comments
 (0)