Search code examples
pythonsetuptoolspypi

Does description-file in setup.cfg, section "metadata" have any effect?


I recently downloaded 208,492 of Python packages from PyPI. 18,844 of them had a setup.cfg with a metadata section which contained the key description-file. Does that key have any effect on setuptools or PyPI? It is mentioned in the setuptools docs, but I don't understand it.

Example setup.cfg

[metadata]
description-file = README.md
name = foopackage
long_description = file: README.md
long_description_content_type = text/markdown

Solution

  • It's not mentioned in the code, neither in distutils nor in setuptools:

    distutils $ grep -Frw description-file .
    distutils $ cd ../setuptools
    setuptools $ grep -Frw description-file .
    

    If you want to publish long description from a file via setup.cfg use

    long_description = file: README.rst
    

    trick. See the very setuptools' setup.cfg. It's handled in setuptools/config.py.