Python 为sdist生成文件
我正在寻找一种方法来生成一个文件,并将其包含到由Python 为sdist生成文件,python,setuptools,Python,Setuptools,我正在寻找一种方法来生成一个文件,并将其包含到由sdist/wheel创建的包中 是否有某种方法可以连接到创建新文件的过程中,该文件将在生成过程中拾取。在生成过程中生成文件阶段覆盖cmdclass。见: 将非代码文件包括在MANIFEST或MANIFEST.in中的sdist列表中。看 要将非代码文件包括在控制盘中请在setup.py中将其列为package\u data。见: import distutils.command.build # Override build command cl
sdist
/wheel
创建的包中
是否有某种方法可以连接到创建新文件的过程中,该文件将在生成过程中拾取。在
生成过程中生成文件阶段覆盖cmdclass
。见:
将非代码文件包括在MANIFEST
或MANIFEST.in
中的sdist
列表中。看
要将非代码文件包括在控制盘中
请在setup.py
中将其列为package\u data
。见:
import distutils.command.build
# Override build command
class BuildCommand(distutils.command.build.build):
def run(self):
# Run the original build command
distutils.command.build.build.run(self)
# Custom build stuff goes here
# Replace the build command with ours
setup(...,
cmdclass={"build": BuildCommand})
setup(...,
packages=['mypkg'],
package_data={'mypkg': ['*.dat']},
)