【问题标题】:How to make setuptools fail if it can't find some of the files declared in MANIFEST.in?如果找不到 MANIFEST.in 中声明的某些文件,如何使 setuptools 失败?
【发布时间】:2021-01-18 16:53:28
【问题描述】:

MANIFEST.in 中声明了一些文件,其中一半从项目目录中丢失。当我运行python3 setup.py install 时,它复制了存在的文件,并且没有给出关于丢失文件的警告或错误。

当某些include_package_data 文件丢失时如何使其失败?

【问题讨论】:

    标签: python setuptools setup.py


    【解决方案1】:

    嗯,我发现的唯一想法是解析来自python setup.py dist_info 的输出:

    python setup.py dist_info 2>&1 >/dev/null |
        grep '^warning: no files found matching'
    

    可以用作条件:

    if python setup.py dist_info 2>&1 >/dev/null | grep '^warning: no files found matching'; then
        echo "Error: missing files" >&2
        exit 1
    fi
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-20
      • 2018-10-25
      • 2012-07-03
      • 2012-07-13
      相关资源
      最近更新 更多