可以使用sdist
参数将构建步骤添加到cmdclass
,例如,
# ./setup.py
from setuptools import setup
from setuptools.command.sdist import sdist
class CustomSdistCommand(sdist):
def run(self):
# Do some preprocessing...
super().run()
setup(
# ...
cmdclass={
'sdist': CustomSdistCommand,
}
)
使用bdist时是否可以做同样的事情?