【问题标题】:Python package contains both MANIFEST and MANIFEST.in - do I gitignore MANIFEST?Python 包同时包含 MANIFEST 和 MANIFEST.in - 我要 gitignore MANIFEST 吗?
【发布时间】:2015-07-02 10:07:50
【问题描述】:

在 python 包中包含外部文件时,我在 MANIFEST.in 中将其定义为

MANIFEST.in

include aikif/web_app/static/*

构建包会生成一个MANIFEST文件

#file GENERATED by distutils, do NOT edit
README.txt
setup.py
aikif\__init__.py
aikif\bias.py
aikif\cls_file_mapping.py
...

目前我将 MANIFEST 和 MANIFEST.in 都包含在 github 存储库中,但还没有看到其他存储库同时包含这两者。

我应该 git 忽略 MANIFEST,还是有更好的方法来构建包以便不需要它?

【问题讨论】:

    标签: python github manifest packages


    【解决方案1】:

    简短回答 - 是的,在您的 .gitignore 中包含 MANIFEST 文件

    Python 包页面没有提到忽略 MANIFEST (http://www.scotttorborg.com/python-packaging/everything.html)

    # Compiled python modules.
    *.pyc
    
    # Setuptools distribution folder.
    /dist/
    
    # Python egg metadata, regenerated from source files by setuptools.
    /*.egg-info
    /*.egg
    

    在 github ( pypa / pip ) https://github.com/pypa/pip/blob/develop/.gitignore 上找到了一个很好的例子,它确实在 .gitignore 中包含了 MANIFEST

    build/
    dist/
    docs/_build/
    pip.egg-info/
    MANIFEST
    .tox
    *.egg
    *.py[cod]
    *~
    .coverage
    coverage.xml
    

    github 上的许多其他包都没有忽略该文件,但它也不在存储库中,所以我假设人们只是在他们从本地 repo 执行 git status 时列出它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-03
      • 2021-04-13
      相关资源
      最近更新 更多