Is `setup.cfg` deprecated?

I’d like to add a few notes on recent developments:

PEP 518, first drafted in 2016, was marked as final in April of 2020. I’m interpreting it as an invitation to use pyproject.toml instead of setup.cfg. Quoting from the PEP:

There are two issues with setup.cfg used by setuptools as a general
format. One is that they are .ini files which have issues as mentioned
in the configparser discussion above. The other is that the schema for
that file has never been rigorously defined and thus it’s unknown
which format would be safe to use going forward without potentially
confusing setuptools installations.

From black’s documentation:

PEP 518 defines pyproject.toml as a configuration file to store build
system requirements for Python projects. With the help of tools like
Poetry or Flit it can fully replace the need for setup.py and
setup.cfg files.

pip 19.0 (2019-01-22) implemented PEP 517 to allow projects to specify a build backend via pyproject.toml.

PEP 621 which specifies a a standard way of storing project metadata in pyproject.toml, was marked as final on March 3, 2021.

setuptools has an open issue titled “Eventually deprecate setup.cfg with automatic conversion to pyproject.toml“.

Disclaimer: I feel totally lost in Python’s packaging jungle myself.

Recommended further reading: Why you shouldn’t invoke setup.py directly by Paul Ganssle.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)