pyproject.toml vs setup.cfg
Developers should use pyproject meets developers should use setup. Here's our take.
pyproject.toml
Developers should use pyproject
pyproject.toml
Nice PickDevelopers should use pyproject
Pros
- +toml when working on Python projects that require consistent build and dependency management, especially for packaging and distribution with tools like pip, Poetry, or Flit
- +Related to: python, poetry
Cons
- -Specific tradeoffs depend on your use case
setup.cfg
Developers should use setup
Pros
- +cfg when building Python packages to ensure consistent and reproducible builds, as it separates configuration from executable code, reducing errors and improving maintainability
- +Related to: python, setuptools
Cons
- -Specific tradeoffs depend on your use case
The Verdict
Use pyproject.toml if: You want toml when working on python projects that require consistent build and dependency management, especially for packaging and distribution with tools like pip, poetry, or flit and can live with specific tradeoffs depend on your use case.
Use setup.cfg if: You prioritize cfg when building python packages to ensure consistent and reproducible builds, as it separates configuration from executable code, reducing errors and improving maintainability over what pyproject.toml offers.
Developers should use pyproject
Disagree with our pick? nice@nicepick.dev