gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 22:20:30 24 4
gpt4 key购买 nike

我有一个 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com