How does Python packaging fit into a CI pipeline (pip, venv, wheels)?
IntermediateConceptBuild Tools and Artifact Repositories
Answer
Create an isolated environment, install pinned dependencies (a requirements.txt with hashes via pip-compile --generate-hashes, or poetry.lock / uv.lock), run tests, then build with python -m build to get a wheel and sdist, and upload with twine or trusted publishing (OIDC to PyPI, no token). uv is now commonly used for fast installs.
python -m venv .venv && . .venv/bin/activate
pip install --require-hashes -r requirements.txt
python -m build && twine check dist/*
More on Build Tools and Artifact Repositories
What is Maven and what is its build lifecycle?BeginnerWhat is the difference between `mvn package`, `install` and `deploy`?BeginnerHow do Maven dependency scopes and transitive dependencies work?IntermediateWhat is `settings.xml` in Maven and how do CI builds use it?IntermediateWhat is the Maven Wrapper and why use it?BeginnerHow do you cache dependencies and speed up Maven builds in CI?Intermediate