Dynamic

setup.py vs pyproject.toml

Developers should use setup meets developers should use pyproject. Here's our take.

🧊Nice Pick

setup.py

Developers should use setup

setup.py

Nice Pick

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

pyproject.toml

Developers 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

The Verdict

Use setup.py if: You want py when building python libraries or applications that need to be shared, installed, or deployed, as it standardizes packaging and dependency management and can live with specific tradeoffs depend on your use case.

Use pyproject.toml if: You prioritize 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 over what setup.py offers.

🧊
The Bottom Line
setup.py wins

Developers should use setup

Disagree with our pick? nice@nicepick.dev