Skip to content
Latchkey

python setup.py: Legacy Build Command Reference

The legacy build interface -- and what replaces it.

python setup.py invokes setuptools commands directly. Direct invocation is deprecated; modern CI uses python -m build and pip instead, but you still encounter setup.py in older projects.

Common flags / usage

  • setup.py sdist bdist_wheel -- legacy build (use python -m build)
  • setup.py install -- legacy install (use pip install .)
  • setup.py develop -- legacy editable (use pip install -e .)
  • setup.py --version -- print the project version

Example

shell
# Legacy (deprecated):
# python setup.py sdist bdist_wheel

# Modern replacements:
- run: python -m pip install build
- run: python -m build      # sdist + wheel
- run: pip install -e .     # editable install

In CI

Recent pip/setuptools warn on or refuse "setup.py install" and "setup.py develop". Prefer "python -m build" for artifacts and "pip install ." / "pip install -e ." for installs so your pipeline does not break on toolchain upgrades.

Key takeaways

  • Direct setup.py invocation is deprecated for builds and installs.
  • Use python -m build for artifacts and pip for installs instead.
  • You still meet setup.py in older projects; migrate when you can.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →