Dynamic
pyproject.toml vs setup.py
Developers should use pyproject meets developers should use setup. Here's our take.
🧊Nice Pick
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.py
Developers should use setup
Pros
- +py when building Python libraries or applications that need to be shared, installed, or deployed, as it standardizes packaging and dependency management
- +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.py if: You prioritize py when building python libraries or applications that need to be shared, installed, or deployed, as it standardizes packaging and dependency management over what pyproject.toml offers.
🧊
The Bottom Line
pyproject.toml wins
Developers should use pyproject
Disagree with our pick? nice@nicepick.dev