Skip to content

Commit 98f68c6

Browse files
committed
1.fix pyd in Linux err
1 parent 90dacac commit 98f68c6

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

AutoCython/AutoCython.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
from concurrent.futures import as_completed, ThreadPoolExecutor
1313
from typing import Union
1414

15+
sysstr = platform.system()
16+
if (sysstr == "Windows"):
17+
DLL_TYPE = "pyd"
18+
elif (sysstr == "Linux"):
19+
DLL_TYPE = "so"
20+
else:
21+
DLL_TYPE = "pyd"
22+
1523
class Container(object):
1624
def __setitem__(self, key, value):
1725
self.__setattr__(key, value)
@@ -308,7 +316,7 @@ def compile_th(delete):
308316
# 编译正确
309317
try:
310318
path, file_name = os.path.split(file_path)
311-
pyd_name = list(filter(lambda name : name.split('.')[-1] == 'pyd' and name.split('.')[0] == file_name[:-3], os.listdir(path)))[0]
319+
pyd_name = list(filter(lambda name : name.split('.')[-1] == DLL_TYPE and name.split('.')[0] == file_name[:-3], os.listdir(path)))[0]
312320
pyd_path = os.path.join(path, pyd_name)
313321
self.compile_result['OK_' + task_index_dict[file_path] + '_' + file_name[:-3]] = Popen_out(cython_popen, file_path, pyd_path)
314322
except Exception as err:

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ AutoCython类接受4个参数,默认为:compile_path='.', exclude=[], mode='
144144

145145
AutoCython -C D:/python_code/ProjectPath -E tmp.py;./ProjectPath/print_cy.py;./ProjectPath/data/tmp -M 8 -D bp
146146

147+
## 更新记录
148+
1.20220613 更新对Linux的支持,Linux下需要配置gcc&g++
149+
147150
![命令行][11]
148151

149152
[1]: https://raw.githubusercontent.com/EVA-JianJun/GitPigBed/master/blog_files/img/AutoCython_20210824.png

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name = 'AutoCython-jianjun',
10-
version = '1.2.9',
10+
version = '1.3.0',
1111
author = 'jianjun',
1212
author_email = '910667956@qq.com',
1313
url = 'https://github.com/EVA-JianJun/AutoCython',

0 commit comments

Comments
 (0)