提交 86aae00b authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Merge pull request #331 from josharian/theano-version-refactor

Make theano.version functional regardless of whether setup.py has been run
...@@ -29,8 +29,8 @@ html ...@@ -29,8 +29,8 @@ html
pdf pdf
pull.sh pull.sh
setuptools-*.egg setuptools-*.egg
theano/version.py theano/generated_version.py
theano/version.py.out theano/generated_version.py.out
distribute-*.egg distribute-*.egg
distribute-*.tar.gz distribute-*.tar.gz
Theano.suo Theano.suo
...@@ -86,7 +86,7 @@ def git_version(): ...@@ -86,7 +86,7 @@ def git_version():
git_revision = "unknown-git" git_revision = "unknown-git"
return git_revision return git_revision
def write_version_py(filename='theano/version.py'): def write_version_py(filename='theano/generated_version.py'):
cnt = """ cnt = """
# THIS FILE IS GENERATED FROM THEANO SETUP.PY # THIS FILE IS GENERATED FROM THEANO SETUP.PY
short_version = '%(version)s' short_version = '%(version)s'
......
...@@ -42,13 +42,8 @@ import configparser, configdefaults ...@@ -42,13 +42,8 @@ import configparser, configdefaults
config = configparser.TheanoConfigParser() config = configparser.TheanoConfigParser()
# Version information. # Version information.
# Note that the version must be defined before imports below as it is used by import theano.version
# some of these imports. __version__ = theano.version.version
try:
import theano.version
__version__ = theano.version.version
except ImportError:
__version__ = "unknown"
import gof import gof
......
try:
from theano.generated_version import *
except ImportError:
short_version = 'unknown'
version = 'unknown'
git_revision = 'unknown'
full_version = 'unknown'
release = False
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论