向bdist添加自定义构建步骤

时间:2018-10-05 07:12:49

标签: python python-3.x python-3.6 setup.py

可以使用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时是否可以做同样的事情?

0 个答案:

没有答案