def get_cmdclass():
versioneer_cmds = versioneer.get_cmdclass()
sdist_class = versioneer_cmds['sdist']
class sdist(sdist_class):
"""ensure cython files are compiled to c, when distributing"""
def run(self):
# only run if .git is present
if not os.path.exists('.git'):
print("Not on git, can not create source distribution")
return
try:
from Cython.Build import cythonize
print("cythonizing sources")
cythonize(extensions())
except ImportError:
warnings.warn('sdist cythonize failed')
return sdist_class.run(self)
versioneer_cmds['sdist'] = sdist
return versioneer_cmds
评论列表
文章目录