如果需要包含数据文件需要先设置 https://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files
参数描述include_package_dataAccept all data files and directories matched by MANIFEST.in.package_dataSpecify additional patterns to match files that may or may not be matched by MANIFEST.in or found in source control.exclude_package_dataSpecify patterns for data files and directories that should not be included when a package is installed, even if they would otherwise have been included due to the use of the preceding options. from setuptools import setup, find_packages setup( ... include_package_data=True )然后加入MANIFEST.in文件
MANIFEST.in在package外,所以路径是相对于MANIFEST.in而不是相对于package的
graft ./package/data
https://packaging.python.org/guides/using-manifest-in/ https://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files