Do not use requirements.txt - quanttype
To me, the first one is a no-brainer. The second one is more tentative: Poetry is a great option, but it’s hardly the only option worth considering. I’ll explain below. pip is a tool that you can use to install packages from The Python Package Index (PyPI). It comes with Python and if you’re a Python developer, you have probably used it many times. The traditional way to manage dependencies for a Python project was to list them in a file called requirements.txt and use pip install -r requirements.txt to install. However, pip was designed to be a package installer and not a full-fledged project workflow tool. pip lacks two essential features, dependency lockfiles and automatic management of virtualenvs. If you want to get same behavier in all environments - your laptop, CI, production - you need to pin the versions of your dependencies and their transitive dependencies. You can pin the versions of your direct dependencies in a requirements.txt by specifying for example requests==2.31.0
Are you developing a backend service in Python? I have two pieces of advice for you: Do not use pip and requirements.txt to manage Python dependencies. They lack crucial features that should be built-in. Use Poetry instead. To me, the first one is a no-brainer. The second one is more tentative: Poetry is a great option, but it's hardly the only option worth considering. I'll explain below. Nota bene: If you use Python for something else than building backend services, then the advice in this post may not apply to you. For example, if you're a library developer migrating off setup.py , it's not
Explore this link on the map →related reading
- Niels Cautaerts - Python dependency management is a dumpster firenielscautaerts.xyz
- Mediumitnext.io
- The Architecture of Open Source Applications (Volume 1)Python Packagingaosabook.org
- Managing environments | Documentation | Poetry - Python dependency management and packaging made easypython-poetry.org
- uv: An In-Depth Guide to Python's Fast and Ambitious New Package Managersaaspegasus.com
- uv: An extremely Fast Python Package Manager :: Jane Streetjanestreet.com
- uvdocs.astral.sh
- Get Startedpytorch.org
- mildbyte.xyz • Solving Wordle with uv's dependency resolvermildbyte.xyz
- Why you shouldn't invoke setup.py directlyblog.ganssle.io
- Behind The Scenes of Bun Install | Bun Blogbun.com
- Python Monorepo: an Example. Part 1: Structure and Tooling - Tweagtweag.io