[HN Gopher] A Poetic Apology: Or Why Should You Use Poetry to Ma...
___________________________________________________________________
A Poetic Apology: Or Why Should You Use Poetry to Manage Python
Dependencies
Author : juanpampliega
Score : 41 points
Date : 2021-02-10 20:02 UTC (2 hours ago)
(HTM) web link (muttdata.ai)
(TXT) w3m dump (muttdata.ai)
| kbd wrote:
| Poetry has been great, for both local development and for
| deployment. I recommend using direnv (which has a Poetry recipe)
| to automatically activate your Poetry virtualenvs locally.
| grawp wrote:
| Poetry is for Python kinda what Cargo is for Rust.
| memco wrote:
| Does anyone here have recommendations for using poetry or a
| similar tool for nested projects? We have a suite of separate
| repos that all have separate requirements but are really sub-
| repos of the larger project. It would be nice to have a way to
| poetry install and manage them for development from a single
| place while still being able to install the separate components
| when we deploy.
| arusahni wrote:
| I personally still find Poetry and Pipenv to be a little heavy-
| handed for my preferred workflows. To that end, pip-tools [1] is
| what I recommend to those who feel similarly. It balances pinning
| and dependency management with common Python practices (e.g.,
| requirements.txt).
|
| 1: https://github.com/jazzband/pip-tools
| scrollaway wrote:
| The only reason to use pip-tools is because you already know it
| and you don't want to switch (yet). pip-tools is squarely worse
| than using Poetry.
|
| Poetry is not perfect, mind you, but it's the absolute best we
| have in the Python world. Whenever I jump into a new project,
| switching it to Poetry is one of the first things I do so I
| have a sane working environment for it.
| arusahni wrote:
| I'm glad tools like Poetry exist, as they're filling pretty
| horrible gaps in the Python ecosystem.
|
| > The only reason to use pip-tools is because you already
| know it and you don't want to switch (yet).
|
| Actually, I settled on pip-tools _after_ trying Poetry :-)
|
| > pip-tools is squarely worse than using Poetry.
|
| News to me. Like I said in my original comment: "I personally
| still find Poetry and Pipenv to be a little heavy-handed for
| my preferred workflows." A tool that gets out of my way and
| lets me achieve my goals is a better tool for me. Since
| Poetry can't meet me where I am, pip-tools is better _for
| me_.
| ksm1717 wrote:
| These are bold and absolute claims in response to proposing
| that an alternative may be better for a given user's
| preferences.
|
| "I prefer pepsi because coke is too sugary."
|
| "The only reason you should drink Pepsi is if you already
| have some. It's a squarely worse drink than coke."
| joshbuddy wrote:
| How is it strictly worse?
| koolk3ychain wrote:
| I still use pipenv and it's great. Python version management is a
| hell hole when sharing a project with other devs, pipenv solves
| this issue and is easy enough to containerize.
| ehutch79 wrote:
| I'm not sure why pip installing the dependency at the pinned
| version is an issue. Isn't that the point?
|
| I feel like a lot of the issues people put forth as a reason for
| poetry and pip alternatives are a bit contrived, and more this is
| how npm|yarn|whatever do it expectations.
| asplake wrote:
| Because it's now down to you to manage which versions of which
| packages go with what versions of what other packages. When you
| really need to upgrade one and it fails for version
| compatibility reasons, it can be a genuinely difficult problem.
| Isinlor wrote:
| One thing I fail to understand is why poetry is installing
| everything all over the system instead of keeping code contained
| to the project directory. If I delete my project I want get rid
| of everything related instead tracking down where what was
| installed.
|
| But that seems to be an issue with every other tool in Python
| too.
| scrollaway wrote:
| You can set virtualenvs.in-project to use a local .venv folder
| instead (like you would have in the JS world). I use that a lot
| in CI and Docker images.
|
| https://python-poetry.org/docs/configuration/#virtualenvsin-...
___________________________________________________________________
(page generated 2021-02-10 23:01 UTC)