Interview frequency: …
Short answer
Installing the package so it points directly at the source files (pip install -e .), so your edits show up immediately without reinstalling.
Explanation
It is used during development with the src layout, and works according to PEP 660 through the build backend specified in pyproject.toml. But it is not a deployment tool: a successful editable install does not guarantee that the built wheel contains all the files. So build the package and test it in CI the way users will receive it. Note that changing metadata such as entry points or dependencies requires reinstalling.
Code example
python -m pip install -e ".[dev]"
# In CI: test the built package, not the source
python -m build
python -m pip install dist/*.whl
pytestCommon mistakes
- Relying on an editable install in CI, so missing files in the package go undetected.
- Changing entry points without reinstalling, then being surprised the command does not appear.
Follow-up questions
- What is the difference between a wheel and a source distribution (sdist)?
- What is the benefit of the src layout for organizing packages?