Skip to content

Commit be0c290

Browse files
committed
Adding Version Attribute to QuantEcon class
1 parent a7a0c60 commit be0c290

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

quantecon/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919
from .robustlq import RBLQ
2020
from .tauchen import approx_markov
2121
from . import quad as quad
22+
23+
#Add Version Attribute
24+
from .version import version as __version__

quantecon/version.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""
2+
This is a VERSION file and should NOT be manually altered
3+
"""
4+
version = '0.1.5'

setup.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
from distutils.core import setup
2+
import os
3+
4+
#-Write a versions.py file for class attribute-#
5+
6+
VERSION = '0.1.5'
7+
8+
def write_version_py(filename=None):
9+
doc = "\"\"\"\nThis is a VERSION file and should NOT be manually altered\n\"\"\""
10+
doc += "\nversion = '%s'" % VERSION
11+
12+
if not filename:
13+
filename = os.path.join(
14+
os.path.dirname(__file__), 'quantecon', 'version.py')
15+
16+
fl = open(filename, 'w')
17+
try:
18+
fl.write(doc)
19+
finally:
20+
fl.close()
21+
22+
write_version_py()
23+
24+
#-Setup-#
225

326
setup(name='quantecon',
427
packages=['quantecon', 'quantecon.models', "quantecon.tests"],
5-
version='0.1.5',
28+
version=VERSION,
629
description='Core package of the QuantEcon library',
730
author='Thomas J. Sargent and John Stachurski (Project coordinators)',
831
author_email='john.stachurski@gmail.com',

0 commit comments

Comments
 (0)