3 ms·
I find it's clearer to store all pinned dependencies in requirements.txt using pip-compile (or pip freeze). There's no finagling in trying to determine which fi
by cpburns2009 1y ago
I find it's clearer to store all pinned dependencies in requirements.txt using pip-compile (or pip freeze). There's no finagling in trying to determine which file contains the dependency snapshot for installing an application. High level dependencies can be defined in requirements.in or pyproject.toml.
- greener_grass 1y agoIf you write out `requirements.txt` by hand, do you also need to resolve deps and transitive deps by hand? This is what pushed me to use Poetry.
- jerrygenser 1y agoYou do not write requirements by hand. You write requirements.in and uv pip-compile to requirements.txt
- greener_grass 1y agoDoes `pip-compile` solve deps and transitive deps? I thought it only locks down hashes?
- jerrygenser 1y agoYes it does. And it will fail if there is a combination that is not resolvable.
- cpburns2009 1y agoI write my high level dependencies by hand in a "requirements.in" for applications, and in "pyproject.toml" for libraries. A simple "requirements.in" I did over this weekend was a single dependency: miniboss >=0.4, <0.5 And used pip-compile to pin all transitive dependencies: pip-compile -o requirements.txt requirements.in This generated a "requirements.txt" with 14 dependencies with pinned versions: attrs==25.3.0 ...13 more dependencies It's then only a matter of running "pip install -r requirements.txt" in the venv for my "application" (wrapper scripts for Docker). I've largely settled on this scheme for work and person projects because it's simple (only dev dependency is pip-tools or uv), and it doesn't tie me to a particular Python project management tool (pipenv, pdm, poetry, etc.).
- 0xbadcafebee 1y agoThat's what I meant, I just call my requirements.in requirements.txt, and the pinned versions go in requirements.txt.frozen or pyproject.toml. As long as there's one file with high level and one file with pinned