Live data from Hacker News

Pipenv: Python Dev Workflow for Humans

pipenv.pypa.io

21–30 of 64 posts

Re: Pipenv: Python Dev Workflow for Humans

#22
post #3
post #2

What does this tool provide over an in-project .venv/ directory created by venv and populated by pip from an etc/pip/requirement.txt file containing all the packages by version? There seems to be a lot of activity in this area for a seemingly solved problem. Having solved it, people appear to wish to expand the problem to something bigger (such as multiple interpreter versions, for example) I believe the most-common…

The consensus among non-Python developers is that that is not good enough. The problems are: requirements.txt is way too flexible, so users want a lock file to freeze stuff in place. You can use pip freeze to generate a sort-of-lockfile but it's more manual than tools like Cargo/npm/bundler which do it automatically. And more adhoc as to what you call it. Combined with needing to mange venvs and sourcing etc. people…

Pipenv and poetry help, but, even with them, it's still not good enough. setup.py is a real challenge. Packages being able to execute arbitrary code at install time can make it very difficult to get a truly reproducible python build. Details of how pip (which pipenv and poetry still use) handles packages means that doing anything that even hints of a monorepo is a delicate subject on the best of days.

Re: Pipenv: Python Dev Workflow for Humans

#23
post #11
post #2

What does this tool provide over an in-project .venv/ directory created by venv and populated by pip from an etc/pip/requirement.txt file containing all the packages by version? There seems to be a lot of activity in this area for a seemingly solved problem. Having solved it, people appear to wish to expand the problem to something bigger (such as multiple interpreter versions, for example) I believe the most-common…

It is a solved problem for other languages. Pip has soooo many issues. The biggest IMO is pip doesn't provide a way to pin indirect dependencies, so there is no good way to ensure that other people working on a project are also using the same dependency versions. You can do it with extra tooling of course - and that's what poetry and pipenv do.

Even worse-- there's no simple way for pip to print out the full dependency tree (including transitive dependencies). This makes it a nightmare when it complains about some transitive dependency version conflict and you have no idea what's causing it to be pulled in

Re: Pipenv: Python Dev Workflow for Humans

#24
Honest experience: I switched to this early on because at the time PyPA was pushing it really heavy, and Kenneth's past experience at Heroku meant it was added to their Python buildpacks far too soon.

At the time, it was unusable and community responses wildly swung between "its not official", its "PyPA endorsed", "don't like it build your own". Which are fine responses beta version of software, not when you convince the community and several companies that its a stable production ready, langauge endorsed package manager. Ultimately, pipenv in Heroku python buildpack was broken for a long time because of it.

Despite being assured it was stable, there were daily Pipenv releases at times, until they stopped for some reason for months.

In summary: avoid pipenv unless you really have to use it, otherwise - use poetry.

Re: Pipenv: Python Dev Workflow for Humans

#25
post #8

About a year ago or so I moved to pyenv and poetry. I have used python for over 10 years it was a game changer. I recommend this guide if your still using pip and venv. https://cjolowicz.github.io/posts/hypermodern-python-01-setu...

is it not venv under the hood?

Re: Pipenv: Python Dev Workflow for Humans

#26
post #8

About a year ago or so I moved to pyenv and poetry. I have used python for over 10 years it was a game changer. I recommend this guide if your still using pip and venv. https://cjolowicz.github.io/posts/hypermodern-python-01-setu...

Very much seconded. You don't really want to use Pipenv, Poetry works much better and AFAIK is more popular.

Re: Pipenv: Python Dev Workflow for Humans

#28
post #8

About a year ago or so I moved to pyenv and poetry. I have used python for over 10 years it was a game changer. I recommend this guide if your still using pip and venv. https://cjolowicz.github.io/posts/hypermodern-python-01-setu...

is it not venv under the hood?

It uses venv under the hood. But a car is more than just its transmission.

Re: Pipenv: Python Dev Workflow for Humans

#29

Honest experience: I switched to this early on because at the time PyPA was pushing it really heavy, and Kenneth's past experience at Heroku meant it was added to their Python buildpacks far too soon. At the time, it was unusable and community responses wildly swung between "its not official", its "PyPA endorsed", "don't like it build your own". Which are fine responses beta version of software, not when you convince…

I had the same experience. I got an error message that seemed incorrect, and I opened an issue about it, only to get a sarcastic response:

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

I switched to Poetry after that, as Poetry did meet my expectations.

Re: Pipenv: Python Dev Workflow for Humans

#30
post #27

There is also Pdm now I recently learned, which is supposed to be a more modern alternative. As an alternative to poetry that is; pipenv is yesterday’s solution. https://pdm.fming.dev/

Ah, that uses PEP-582-style package directories, that's interesting! Though I don't know if we need an alternative to Poetry, I'd rather we just standardized on one tool at this point.
Post reply on HN