Skip to content

Commit 8ce4920

Browse files
eric-wieserutensil
authored andcommitted
Add galgebra.__version__ for easy version inspection (#172)
This uses the same approach as clifford and pyganja
1 parent e40c7b0 commit 8ce4920

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

galgebra/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222

2323
from __future__ import absolute_import, division
2424
from __future__ import print_function
25+
from ._version import __version__

galgebra/_version.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Package versioning solution originally found here:
2+
# http://stackoverflow.com/q/458550
3+
4+
# Store the version here so:
5+
# 1) we don't load dependencies by storing it in __init__.py
6+
# 2) we can import it in setup.py for the same reason
7+
# 3) we can import it into your module
8+
__version__ = '0.4.4'

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
#!/usr/bin/env python
22
from setuptools import setup, find_packages
33
from distutils.core import Extension
4+
import os
5+
6+
version_path = os.path.join('galgebra', '_version.py')
7+
exec(open(version_path).read())
48

5-
VERSION = '0.4.4'
69
LONG_DESCRIPTION = """
710
Symbolic Geometric Algebra/Calculus package for SymPy. BSD License.
811
"""
912

1013
setup(name='galgebra',
11-
version=VERSION,
14+
version=__version__,
1215
description='Symbolic Geometric Algebra/Calculus package for SymPy.',
1316
author='Alan Bromborsky',
1417
author_email='[email protected]',

0 commit comments

Comments
 (0)