File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 17
17
import os
18
18
import shlex
19
19
20
+ import pymc3
21
+
20
22
# If extensions (or modules to document with autodoc) are in another directory,
21
23
# add these directories to sys.path here. If the directory is relative to the
22
24
# documentation root, use os.path.abspath to make it absolute, like shown here.
79
81
# built documents.
80
82
#
81
83
# The short X.Y version.
82
- version = '3.4'
84
+ version = pymc3 . __version__
83
85
# The full version, including alpha/beta/rc tags.
84
- release = '3.4rc1'
86
+ release = version
85
87
86
88
# The language for content autogenerated by Sphinx. Refer to documentation
87
89
# for a list of supported languages.
Original file line number Diff line number Diff line change 3
3
from os .path import realpath , dirname , join
4
4
from setuptools import setup , find_packages
5
5
import sys
6
-
6
+ import re
7
7
8
8
DISTNAME = 'pymc3'
9
9
DESCRIPTION = "Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Theano"
10
10
AUTHOR = 'PyMC Developers'
11
11
AUTHOR_EMAIL = '[email protected] '
12
12
URL = "http://github.com/pymc-devs/pymc3"
13
13
LICENSE = "Apache License, Version 2.0"
14
- VERSION = "3.4rc1"
15
14
16
15
classifiers = ['Development Status :: 5 - Production/Stable' ,
17
16
'Programming Language :: Python' ,
45
44
if sys .version_info [0 ] == 2 : # py3 has mock in stdlib
46
45
test_reqs .append ('mock' )
47
46
47
+ def get_version ():
48
+ VERSIONFILE = join ('pymc3' , '__init__.py' )
49
+ lines = open (VERSIONFILE , 'rt' ).readlines ()
50
+ version_regex = r"^__version__ = ['\"]([^'\"]*)['\"]"
51
+ for line in lines :
52
+ mo = re .search (version_regex , line , re .M )
53
+ if mo :
54
+ return mo .group (1 )
55
+ raise RuntimeError ('Unable to find version in %s.' % (VERSIONFILE ,))
48
56
49
57
if __name__ == "__main__" :
50
58
setup (name = DISTNAME ,
51
- version = VERSION ,
59
+ version = get_version () ,
52
60
maintainer = AUTHOR ,
53
61
maintainer_email = AUTHOR_EMAIL ,
54
62
description = DESCRIPTION ,
You can’t perform that action at this time.
0 commit comments