python - 使用 python setup.py sdist 包含空目录

标签 python installation

我有一个 Python 包,我想在其中包含一个空目录作为源代码分发的一部分。我尝试添加

include empty_directory

MANIFEST.in 文件,但是当我运行时

python setup.py sdist

空目录仍然不包括在内。有关如何执行此操作的任何提示?

最佳答案

根据 the docs :

  • include pat1 pat2 - include all files matching any of the listed patterns
  • exclude pat1 pat2 - exclude all files matching any of the listed patterns
  • recursive-include dir pat1 pat2 - include all files under dir matching any of the listed patterns
  • recursive-exclude dir pat1 pat2 - exclude all files under dir matching any of the listed patterns
  • global-include pat1 pat2 - include all files anywhere in the source tree matching — & any of the listed patterns
  • global-exclude pat1 pat2 - exclude all files anywhere in the source tree matching — & any of the listed patterns
  • prune dir - exclude all files under dir
  • graft dir - include all files under dir

看来你想要graft,而不是include。 另外,您似乎不能包含空目录。您必须在目录中创建一个“empty.txt”文件或类似的文件以强制包含它。

关于python - 使用 python setup.py sdist 包含空目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2640378/

相关文章:

python - 为什么在 dask 中运行 .compute() 导致 "Fatal Python error: GC object already tracked"

apache-flex - Adobe AIR 1.5-将AIR安装程序打包为 native Windows可执行文件(.EXE)

python-3.x - SKLearn 0.20.2 - RandomizedPCA 的导入错误?

ios - 在iOS Simulator XCode上自动重新部署

Python - 将类型分配给字典中的值

python - 类型错误 : unsupported operand type(s) for -: 'str' and 'str' Simpleton

python - Python 中 NOT、AND、OR 的逻辑运算符的优先级(运算顺序)

python - 使用 pip 安装 Mayavi - 没有名为 vtk 的模块

java - 我的 Maven 安装应该可以工作,但是却不能

python - 如何在 SSL 下制作网站的一部分而其余部分不?