简体   繁体   English

如何告诉'setup.py'包含根目录中的文件以进行构建发行版?

[英]How can I tell 'setup.py' to include files from my root directory for the built distribution?

I have a typical project structure that looks like this: 我有一个典型的项目结构,如下所示:

/project/ 
  README.md
  CONTRIBUTING.md
  LICENSE
  setup.py
  requirements.txt
  project/
    some_project_file
  docs/
    some_docs_file
  tests/
    some_tests_file

When running python setup.py sdist bdisst_wheel , the resulting distribution in the created 'dist' folder contains everything but the 'CONTRIBUTING', 'LICENSE', and 'requirements.txt' files. 当运行python setup.py sdist bdisst_wheel ,创建的'dist'文件夹中的结果分发包含'CONTRIBUTING','LICENSE'和'requirements.txt'文件以外的所有内容。 Is it possible to have these files from my root directory included in the built distribution? 是否可以将我的根目录中的这些文件包含在内置发行版中?

Create a MANIFEST.in file with the content like: 创建一个MANIFEST.in文件,其内容如下:

include LICENSE
include CONTRIBUTING.md
include requirements.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM