如果需要包含数据文件需要先设置
https://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files
参数 | 描述 |
---|---|
include_package_data | Accept all data files and directories matched by MANIFEST.in. |
package_data | Specify additional patterns to match files that may or may not be matched by MANIFEST.in or found in source control. |
exclude_package_data | Specify 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