Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just use Poetry [1]. It's popular and works well.

[1] https://python-poetry.org/



Huge thumbs up to Poetry. It's drastically simplified package management for me and replaced Pipenv (which I simply dreaded working with due to performance and DX issues).

I no longer start Python projects without Poetry. It's really good.

EDIT: Also, it's being integrated to most PaaS as well. I deploy to Render.com with Poetry now.


That's a 72MB download, and yet another way to fragment the ecosystem. Not something I'd get just to make a package when a default Python setup has recommended tools and everything I need to make and/or install packages.


> a default Python setup has recommended tools and everything I need to make and/or install packages

No it doesn't. Neither setuptools nor pip are part of the standard library. Yes, they are installed by default in many cases, but they are still "extra tools".


On the list of priorities for any package manager, download size should be #100 on the list.

If you've solved 1-99 and download size is an issue, you're in heaven already.


72MB? On a development machine? Are you on dialup?

Poetry doesn't fragment the ecosystem. Unlike setuptools it uses pyproject.toml, which can be read by other tools, and is the correct way of storing package configuration.

A package built using Poetry is installable without Poetry in the exact same way as one built using setuptools.


Last time I tried poetry it was so broken that it was not even usable. I may try again later.


I had a tough time with it ~3 years ago, but now it works great for me


I think it's the right direction, and I look forward to Poetry maturing. But right now it has a lot of gotchas, and I would only recommend it for people who are serious about dependency management/compliance/reproducibility.

See details upthread https://news.ycombinator.com/item?id=26739234


Default way is pip freeze which I feel is too verbose, is tracking every dependency of django worth it?


That's if you want to pin transitive dependencies, which is the de facto standard in JS world but not always true in Python world, depending on your context.


Yes. Also, check pip-tools by jazzband.


Which, like any jazzband project, you must not use for a commercial project, as stated by their CoC, the Contributor Covenant with a vague & bizarre modification about ethical use at the end. You are simply not allowed to contribute in any way on any kind of paid time, nor are you allowed to pay someone to contribute. This is of course not advertised for when they tell you to give them your OSS projects, for which you have already chosen a license and maybe even a CoC for. For this reason, despite the many non profit projects I maintain, I stay away from jazzband.


Do you mean

> Other unethical or unprofessional conduct

from https://jazzband.co/about/conduct ? Or something else?


There are at least 5 comments in this thread saying "just use the tool I use"



+1 for poetry. It also includes deterministic dependency resolution with a lock file.

I just published a repo today[0] using Poetry and it didn’t take me more than 5 minutes. Poetry build && poetry publish

[0] https://github.com/santiagobasulto/hyper-inspector


This looks cool. I had never come across rich[0] before.

[0] https://github.com/willmcgugan/rich


Yup, was surprised to see no mention of Poetry. Hands down, the best package manager for Python.


Holy crap, for some reason I never thought to consider another package manager than Pip, which I loathe.


`poetry` and `pipenv` are both so much slower than `pip-compile` for me (there are many open issues for both complaining about lock speed), and manage to update locked dependencies half the time despite me asking them not to with e.g. `poetry lock --no-update`.


Do any big projects actually use it?


It's only three years old, I can't think of many big projects created in that timespan.


Unless Instagram found migrating to it valuable enough to fund the effort


How does it compare to pipenv?


Pipenv only targets applications; Poetry targets both applications and libraries. Pipenv has quite some drama behind it that I do not want to get into; in contrast, Poetry's development has been quite professional. Pipenv enjoys better tool support, e.g. it is recognized and supported by VS Code; but Poetry does not have the same level of support.


I don't know anything about pipenv drama, so by morbid curiosity I looked for it and this is the first thing I found:

https://github.com/pypa/pipenv/issues/2228

This is one of the most ridiculous issues I've read. If the rest of the "drama" is like that, then eh.


The drama was surrounding false advertising so to speak. Pipenv promised a lot but did not quite deliver, much like the earlier days of MongoDB. But more importantly, it pretended or at least heavily implied it was an official PSF-affiliated project, when it was not. How that claim was substantiated was also subject to drama.


It also had no releases for over a year, even though the master branch was getting frequent updates and the performance of the last release was atrocious (and I'm not sure if it has improved much).

I did like the emojis in the logs though.


FWIW here's VSCode's issue for supporting Poetry[1] and here's their plan to support it[2]:

[1] https://github.com/microsoft/vscode-python/issues/8372

[2] https://github.com/microsoft/vscode-python/wiki/Support-poet...


From memory, there was a whole thing where pipenv, created by Kenneth Reitz of requests fame, was misaccurately portrayed as the official successor to pip when that wasn't true


I recall this, but I wasn’t quite clear on what the issue was with pipenv itself (other than questionable behaviour from the author)


It was buggy. It was slow. It didn't even try to support developing libraries.


Now it’s all coming back to me. I remember it half supporting in-house pip repositories but not quite


I just moved a project from pipenv to poetry at work. My biggest issue with pipenv is that you can't selectively upgrade dependencies. Trying to `pipenv update xyz` basically blows away your lockfile and updates everything. There's a command line flag to be more selective but it doesn't work. I found an open GitHub issue about it that's years old.

Poetry by contrast works pretty much like any modern dependency system you'd be familiar with from another language like cargo, npm, or hex.


In addition to everything else already said, pipenv is mind-bogglingly slow and buggy. Like 30 minutes and a timeout error to install pyspark.


Poetry is better.


Well that settles it


I think pipenv is better for managing non-published Python environments, so there.


pipenv has slightly better support in vscode


> Support for poetry environments is currently our highest upvoted feature request on GitHub.

https://github.com/microsoft/vscode-python/wiki/Support-poet...


For poetry, it makes sense to use `poetry self update --preview` — I often come across weird bugs that take too long to get fixed in the current release.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: