Poetry: Python Packaging and Dependency Management
github.com
github.com
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://chriswarrick.com/blog/2023/01/15/how-to-improve-pyth...
From that page: Poetry isn’t compatible with PEP621(metadata in pyproject.toml), or PEP508 (version markers for dependencies in pyproject.toml)
Just some additional context for the discussion. I use poetry, (and pipenv) depending on my use case.
[0]: https://rye-up.com/
So it should be fine as long as those are fine.
Hatchling doesn’t seem to currently allow c extensions.
I started using pipenv many years ago since it was the hot new thing, and then it kept happening over and over with new pipenv releases. And then poetry was the hot new thing, so I switched to poetry. And everything was good with poetry for some years... and then within the past few years, it started happening again. New poetry version, something breaks, Google it, set some config toggle, it works. Then another new version, something breaks again, some other config toggle is needed, etc. The least I'd expect of a dependency manager is very careful attention paid to backwards compatibility.
And now, based on this thread, I'm wondering if poetry is falling out of fashion and if these other recommendations, like PDM and rye, are going to be the hot new thing.
[1] https://github.com/mitsuhiko/rye/discussions/6 [2] https://beta.ruff.rs/docs/
I often find my self removing it from the later stages of the multistage Docker images I create just to decrease the amount of contextual overhead. Maybe I’m crazy but npm feels less intrusive for some reason.