Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d5fdf626
提交
d5fdf626
authored
10月 23, 2012
作者:
abalkin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added Python 3 support to setup.py. When running under Python 3, setup.py build…
Added Python 3 support to setup.py. When running under Python 3, setup.py build will now invoke 2to3.
上级
66126fc3
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
36 行增加
和
14 行删除
+36
-14
setup.py
setup.py
+36
-14
没有找到文件。
setup.py
浏览文件 @
d5fdf626
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
# * Add download_url
# * Add download_url
import
os
import
os
import
sys
import
subprocess
import
subprocess
from
fnmatch
import
fnmatchcase
from
fnmatch
import
fnmatchcase
from
distutils.util
import
convert_path
from
distutils.util
import
convert_path
...
@@ -12,6 +13,11 @@ try:
...
@@ -12,6 +13,11 @@ try:
from
setuptools
import
setup
from
setuptools
import
setup
except
ImportError
:
except
ImportError
:
from
distutils.core
import
setup
from
distutils.core
import
setup
try
:
from
distutils.command.build_py
import
build_py_2to3
\
as
build_py
except
ImportError
:
from
distutils.command.build_py
import
build_py
CLASSIFIERS
=
"""
\
CLASSIFIERS
=
"""
\
...
@@ -102,6 +108,29 @@ def git_version():
...
@@ -102,6 +108,29 @@ def git_version():
git_revision
=
"unknown-git"
git_revision
=
"unknown-git"
return
git_revision
return
git_revision
# Python 2.4 compatibility: Python versions 2.6 and later support new
# exception syntax, but for now we have to resort to exec.
if
sys
.
hexversion
>=
0x2070000
:
exec
(
"""
\
def write_text(filename, text):
with open(filename, 'w') as a:
try:
a.write(text)
except Exception as e:
print(e)
"""
)
else
:
exec
(
"""
\
def write_text(filename, text):
a = open(filename, 'w')
try:
try:
a.write(text)
except Exception, e:
print e
finally:
a.close()
"""
)
def
write_version_py
(
filename
=
os
.
path
.
join
(
'theano'
,
'generated_version.py'
)):
def
write_version_py
(
filename
=
os
.
path
.
join
(
'theano'
,
'generated_version.py'
)):
cnt
=
"""
cnt
=
"""
...
@@ -126,19 +155,11 @@ if not release:
...
@@ -126,19 +155,11 @@ if not release:
GIT_REVISION
=
"unknown-git"
GIT_REVISION
=
"unknown-git"
FULL_VERSION
+=
'.dev-'
+
GIT_REVISION
FULL_VERSION
+=
'.dev-'
+
GIT_REVISION
text
=
cnt
%
{
'version'
:
VERSION
,
a
=
open
(
filename
,
'w'
)
'full_version'
:
FULL_VERSION
,
try
:
'git_revision'
:
GIT_REVISION
,
try
:
'isrelease'
:
str
(
ISRELEASED
)}
a
.
write
(
cnt
%
{
'version'
:
VERSION
,
write_text
(
filename
,
text
)
'full_version'
:
FULL_VERSION
,
'git_revision'
:
GIT_REVISION
,
'isrelease'
:
str
(
ISRELEASED
)})
except
Exception
,
e
:
print
e
finally
:
a
.
close
()
def
do_setup
():
def
do_setup
():
write_version_py
()
write_version_py
()
...
@@ -163,7 +184,8 @@ def do_setup():
...
@@ -163,7 +184,8 @@ def do_setup():
keywords
=
' '
.
join
([
keywords
=
' '
.
join
([
'theano'
,
'math'
,
'numerical'
,
'symbolic'
,
'blas'
,
'theano'
,
'math'
,
'numerical'
,
'symbolic'
,
'blas'
,
'numpy'
,
'gpu'
,
'autodiff'
,
'differentiation'
'numpy'
,
'gpu'
,
'autodiff'
,
'differentiation'
])
]),
cmdclass
=
{
'build_py'
:
build_py
}
)
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
do_setup
()
do_setup
()
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论