你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Improved 'cleanall' option to remove Cython files.
这个提交包含在:
38
setup.py
38
setup.py
@@ -64,22 +64,28 @@ for root, dirs, files in os.walk(os.path.join(os.getcwd(), 'user_libs')):
|
|||||||
if 'cleanall' in sys.argv:
|
if 'cleanall' in sys.argv:
|
||||||
USE_CYTHON = False
|
USE_CYTHON = False
|
||||||
print('Deleting Cython files...')
|
print('Deleting Cython files...')
|
||||||
for file in cythonfiles:
|
for entry in os.scandir(os.path.join(os.getcwd(), packagename)):
|
||||||
tmp = os.path.splitext(file)
|
for file in cythonfiles:
|
||||||
cfile = tmp[0] + '.c'
|
tmp = os.path.splitext(file)
|
||||||
if sys.platform == 'win32':
|
if entry.name.startswith(tmp[0]):
|
||||||
libfile = tmp[0] + '.pyd'
|
# Remove Cython C files
|
||||||
else:
|
try:
|
||||||
libfile = tmp[0] + '.so'
|
os.remove(tmp[0] + '.c')
|
||||||
try:
|
except OSError:
|
||||||
os.remove(cfile)
|
print('Could not remove: {}'.format(tmp[0] + '.c'))
|
||||||
except OSError:
|
# Remove compiled Cython modules
|
||||||
print('Could not remove: {}'.format(cfile))
|
libfilename = entry.name.split('.')[0]
|
||||||
try:
|
if sys.platform == 'win32':
|
||||||
os.remove(libfile)
|
libfile = libfilename + '.pyd'
|
||||||
except OSError:
|
else:
|
||||||
print('Could not remove: {}'.format(libfile))
|
libfile = libfilename + '.so'
|
||||||
shutil.rmtree('build', ignore_errors=True)
|
|
||||||
|
try:
|
||||||
|
os.remove(libfile)
|
||||||
|
except OSError:
|
||||||
|
print('Could not remove: {}'.format(libfile))
|
||||||
|
# Remove build directory
|
||||||
|
shutil.rmtree(os.path.join(os.getcwd(), 'build'), ignore_errors=True)
|
||||||
# Now do a normal clean
|
# Now do a normal clean
|
||||||
sys.argv[1] = 'clean' # this is what distutils understands
|
sys.argv[1] = 'clean' # this is what distutils understands
|
||||||
|
|
||||||
|
在新工单中引用
屏蔽一个用户