Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ef7d8bb8
提交
ef7d8bb8
authored
7月 12, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
7月 12, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace distutils with setuptools
上级
d69eaabd
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
20 行增加
和
16 行删除
+20
-16
configdefaults.py
aesara/configdefaults.py
+2
-2
cmodule.py
aesara/link/c/cmodule.py
+16
-13
exceptions.py
aesara/link/c/exceptions.py
+1
-1
setup.py
setup.py
+1
-0
没有找到文件。
aesara/configdefaults.py
浏览文件 @
ef7d8bb8
import
distutils.spawn
import
errno
import
logging
import
os
...
...
@@ -9,6 +8,7 @@ import sys
import
textwrap
import
numpy
as
np
from
setuptools._distutils.spawn
import
find_executable
import
aesara
import
aesara.configparser
...
...
@@ -437,7 +437,7 @@ def add_compile_configvars():
# Try to find the full compiler path from the name
if
param
!=
""
:
newp
=
distutils
.
spawn
.
find_executable
(
param
)
newp
=
find_executable
(
param
)
if
newp
is
not
None
:
param
=
newp
del
newp
...
...
aesara/link/c/cmodule.py
浏览文件 @
ef7d8bb8
...
...
@@ -3,7 +3,6 @@ Generate and compile C modules for Python.
"""
import
atexit
import
distutils.sysconfig
import
importlib
import
logging
import
os
...
...
@@ -23,6 +22,12 @@ from io import BytesIO, StringIO
from
typing
import
Callable
,
Dict
,
List
,
Optional
,
Set
,
Tuple
,
cast
import
numpy.distutils
from
setuptools._distutils.sysconfig
import
(
get_config_h_filename
,
get_config_var
,
get_python_inc
,
get_python_lib
,
)
from
typing_extensions
import
Protocol
# we will abuse the lockfile mechanism when reading and writing the registry
...
...
@@ -254,9 +259,9 @@ class DynamicModule:
def
_get_ext_suffix
():
"""Get the suffix for compiled extensions"""
dist_suffix
=
distutils
.
sysconfig
.
get_config_var
(
"EXT_SUFFIX"
)
dist_suffix
=
get_config_var
(
"EXT_SUFFIX"
)
if
dist_suffix
is
None
:
dist_suffix
=
distutils
.
sysconfig
.
get_config_var
(
"SO"
)
dist_suffix
=
get_config_var
(
"SO"
)
return
dist_suffix
...
...
@@ -1666,8 +1671,8 @@ def get_gcc_shared_library_arg():
def
std_include_dirs
():
numpy_inc_dirs
=
numpy
.
distutils
.
misc_util
.
get_numpy_include_dirs
()
py_inc
=
distutils
.
sysconfig
.
get_python_inc
()
py_plat_spec_inc
=
distutils
.
sysconfig
.
get_python_inc
(
plat_specific
=
True
)
py_inc
=
get_python_inc
()
py_plat_spec_inc
=
get_python_inc
(
plat_specific
=
True
)
python_inc_dirs
=
(
[
py_inc
]
if
py_inc
==
py_plat_spec_inc
else
[
py_inc
,
py_plat_spec_inc
]
)
...
...
@@ -1681,7 +1686,7 @@ def std_lib_dirs_and_libs() -> Optional[Tuple[List[str], ...]]:
# this method is called many times.
if
std_lib_dirs_and_libs
.
data
is
not
None
:
return
std_lib_dirs_and_libs
.
data
python_inc
=
distutils
.
sysconfig
.
get_python_inc
()
python_inc
=
get_python_inc
()
if
sys
.
platform
==
"win32"
:
# Obtain the library name from the Python version instead of the
# installation directory, in case the user defined a custom
...
...
@@ -1755,7 +1760,7 @@ def std_lib_dirs_and_libs() -> Optional[Tuple[List[str], ...]]:
# get the name of the python library (shared object)
libname
=
str
(
distutils
.
sysconfig
.
get_config_var
(
"LDLIBRARY"
))
libname
=
str
(
get_config_var
(
"LDLIBRARY"
))
if
libname
.
startswith
(
"lib"
):
libname
=
libname
[
3
:]
...
...
@@ -1766,7 +1771,7 @@ def std_lib_dirs_and_libs() -> Optional[Tuple[List[str], ...]]:
elif
libname
.
endswith
(
".a"
):
libname
=
libname
[:
-
2
]
libdir
=
str
(
distutils
.
sysconfig
.
get_config_var
(
"LIBDIR"
))
libdir
=
str
(
get_config_var
(
"LIBDIR"
))
std_lib_dirs_and_libs
.
data
=
[
libname
],
[
libdir
]
...
...
@@ -1774,9 +1779,7 @@ def std_lib_dirs_and_libs() -> Optional[Tuple[List[str], ...]]:
# explicitly where it is located this returns
# somepath/lib/python2.x
python_lib
=
str
(
distutils
.
sysconfig
.
get_python_lib
(
plat_specific
=
True
,
standard_lib
=
True
)
)
python_lib
=
str
(
get_python_lib
(
plat_specific
=
True
,
standard_lib
=
True
))
python_lib
=
os
.
path
.
dirname
(
python_lib
)
if
python_lib
not
in
std_lib_dirs_and_libs
.
data
[
1
]:
std_lib_dirs_and_libs
.
data
[
1
]
.
append
(
python_lib
)
...
...
@@ -2364,7 +2367,7 @@ class GCC_compiler(Compiler):
# The following nullifies that redefinition, if it is found.
python_version
=
sys
.
version_info
[:
3
]
if
(
3
,)
<=
python_version
<
(
3
,
7
,
3
):
config_h_filename
=
distutils
.
sysconfig
.
get_config_h_filename
()
config_h_filename
=
get_config_h_filename
()
try
:
with
open
(
config_h_filename
)
as
config_h
:
if
any
(
...
...
@@ -2539,7 +2542,7 @@ class GCC_compiler(Compiler):
if
platform
.
python_implementation
()
==
"PyPy"
:
suffix
=
"."
+
get_lib_extension
()
dist_suffix
=
distutils
.
sysconfig
.
get_config_var
(
"SO"
)
dist_suffix
=
get_config_var
(
"SO"
)
if
dist_suffix
is
not
None
and
dist_suffix
!=
""
:
suffix
=
dist_suffix
...
...
aesara/link/c/exceptions.py
浏览文件 @
ef7d8bb8
from
distutils.errors
import
CompileError
as
BaseCompileError
from
setuptools._
distutils.errors
import
CompileError
as
BaseCompileError
class
MissingGXX
(
Exception
):
...
...
setup.py
浏览文件 @
ef7d8bb8
...
...
@@ -53,6 +53,7 @@ install_requires = [
"miniKanren"
,
"cons"
,
"typing_extensions"
,
"setuptools>=45.0.0"
,
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论