|
|
|
|
|
by oblvious-earth
1274 days ago
|
|
I know there's a large part of the Python community that loves Poetry but I've never understood why. It adds a lot of complexity and I've never found it does a good job of solving complex problems, where as requirements and constraints offered by Pip are simple and when you have complex problems provide just enough (and no more) functionality to solve them. For very simply requirements you can just have a simple requirements file or setup.cfg that lists what packages you need and use pip install. As your requirements get bigger you can start putting sensible lower bounds on everything. This can be achieved manually or if you're struggling to extend an existing environment run pip freeze and replace all the == with >=. When you start wanting to have reproducible environments or you're having to keep multiple requirements in sync with each other such as prod requirements and development requirements you use a constraints file. Install all your requirements at once, run pip freeze and save the output as a constraints file, now always specify -c constraints.txt when you pip install in any environment unless you are updating the dependencies in your environment. Better still, you want to add 1 package without changing an of your other dependencies, just run pip install new_package -c constraints.txt and you either install it or find out what it's not compatible with. It's not perfect but in my experience other tools have always seemed to add a lot of complexity but only solve a narrow set of problems, which I can usually just workaround in some other way with Pip. |
|