Pipfile -
This section is a game-changer. In the requirements.txt world, developers often manage a requirements-dev.txt manually, which imports requirements.txt . With a Pipfile , you keep them separate but in the same file. Tools like pytest , black , mypy , and sphinx go here. When you deploy to production, you run pipenv install --deploy — which ignores dev-packages entirely, resulting in a leaner, safer container image.
[packages] requests = "*" django = "==4.2" flask = ">=2.0,<3.0" Pipfile
You can specify the Python version your project requires directly in the Pipfile . This section is a game-changer
A Pipfile is the modern, recommended replacement for the traditional requirements.txt file in Python. Introduced by , it aims to bring the dependency management capabilities of other ecosystems (like Gemfile in Ruby or package.json in Node.js) into Python. Tools like pytest , black , mypy , and sphinx go here
Pipfile provides a more robust and flexible way to manage dependencies in your Python projects. Its support for multiple environments, hash checking, and improved dependency management make it a great alternative to traditional requirements.txt files. Give Pipfile a try in your next project and see how it can simplify your dependency management.
: You can use * to always get the latest version in the Pipfile while relying on the Pipfile.lock to handle the exact pinning for stability.
Example: