Re:Python Best Practices for a New Project in 2021
by EamonnMR on Monday July 05, 2021 @09:06AM
(#27737545)
Agreed, Pip isn't to blame, treating `pip install -r requirements.txt` as one's sole dependency management is.
You can choose to build your own dependency management practice around pip, or use one someone else has already created. I think that it is easier to get a team on the same page with something like Poetry, especially if they're used to bundler or npm.
You're right about the docker containers as well, but upstream does what it wants and downstream has a strong tendency to not mess with upstream's choices.
* if your code is under src/ and your tests under test/, you use a requirements-test (or better, tox.ini) your tests including the dependencies like pytest dont end up in a wheel
* if a container depends on 'latest' and not some semver major number, it's 100% the containers fault when they blindly update to a new major version
* 'pip freeze' is your friend