3 ms·
Of all the python packaging solutions, my favorite is pip-tools because it works with a standard venv setup. Poetry has some great features, but the additional
by yoyohello13 3y ago
Of all the python packaging solutions, my favorite is pip-tools because it works with a standard venv setup. Poetry has some great features, but the additional overhead of requiring devs to install and learn a new tool are just not worth it. Also now you need to install poetry in your Docker images and/or production environments.
- lwhsiao 3y agoTypically you use poetry to generate a requirements.txt and make your docker image as usual. You do not need poetry in your docker or prod environments, but still benefit from actual dependency resolution.
- yoyohello13 3y agoThanks for the clarification. It's been a while since I've looked at Poetry. I recall seeing people pull down the binary in their Docker builds and that rubbed me the wrong way. Good to know you don't have to do that.
- Yusu 3y agoWhat we do instead if to install poetry using pip in the local/builder stage and use the virtualenvs.in-project option: https://python-poetry.org/docs/configuration/#virtualenvsin-project https://python-poetry.org/docs/configuration/#virtualenvsin-... Then in the final stage we copy the virtualenv folder from the builder stage. So in the final image poetry is not installed and everything is still in a virtualenv. It's definitely more complex than a requirements.txt, but this way we can have everything in the container, skip generating a requirements.txt and also not mix our application dependencies with the system ones. Note that poetry now has recommendations for CI which also apply to docker builds. https://python-poetry.org/docs/#ci-recommendations https://python-poetry.org/docs/#ci-recommendations