Re:Black – Uncompromising Python code formatter
by epistasis on Friday May 17, 2019 @12:58PM
(#19941421)
Agree 100%, except for a minor quibble at the end. I've tried a few small projects with pipenv and black recently, and though I love black, I'm still struggling to accept pipenv as good. It's so slow so often, and I can't understand why.
Re:Black – Uncompromising Python code formatter
by AlexCoventry on Friday May 17, 2019 @03:31PM
(#19942748)
Re:Black – Uncompromising Python code formatter
by franey on Friday May 17, 2019 @04:07PM
(#19943073)
I've been meaning to update that post to mention that Poetry has been releasing fixes and improvements more frequently than Pipenv. Poetry is great for developing packages, too.
(Showing up in an HN thread is a neat little milestone for my blog and me. Thanks for sharing!)
Re:Black – Uncompromising Python code formatter
by jimbo1qaz on Saturday May 18, 2019 @05:39AM
(#19946547)
I use poetry. It has bugs (`poetry install/add/update` treats git-URL dev-dependencies as end-user dependencies). I sent a bug fix and it was not merged for months. I now use my own fork of Poetry with this fix added.
Re:Black – Uncompromising Python code formatter
by voidfunc on Friday May 17, 2019 @03:29PM
(#19942710)
I used pipenv on a few projects and my experience has been somewhere between "this is hot garbage" and "meh".
I'm no longer using it for Python projects.
Re:Black – Uncompromising Python code formatter
by Tenzer on Friday May 17, 2019 @03:03PM
(#19942478)
I've previously profiled pipenv and found it to be slowed down massively due to launching pip for each package it was working on. Unfortunately the maintainers think the progress bar is more important than performance: https://github.com/pypa/pipenv/issues/2207
Re:Black – Uncompromising Python code formatter
by ben509 on Monday May 20, 2019 @11:53AM
(#19961683)
That's interesting; they actually discuss the issue and talk about parallelizing it, but all you need to do is pass a requirements file to pip.
It would be nice if pip could act more as a base tool and pass information back to a wrapper.
Re:Black – Uncompromising Python code formatter
by ben509 on Friday May 17, 2019 @01:29PM
(#19941710)
I'm coming from managing virtualenvs with s*ty bash scripts on a complex application, so pipenv got rid of a ton of jank, even though it's slow and has issues resolving certain dependencies.
I like it because I can document most maintenance tasks as "pipenv sync && pipenv run X" and they Just Work with exactly the library versions specified for that commit.
But definitely look into poetry if you're packaging a library.
Re:Black – Uncompromising Python code formatter
by epistasis on Friday May 17, 2019 @01:41PM
(#19941826)
Thanks for the suggestion!
Re:Black – Uncompromising Python code formatter
by camel_Snake on Friday May 17, 2019 @04:11PM
(#19943114)
It's not you. There are plenty of people who dislike pipenv. Another commentor suggested poetry, which is what I favor when 'python3 -m venv .env' isn't appropriate.
Re:Black – Uncompromising Python code formatter
by dumdedum on Friday May 17, 2019 @01:52PM
(#19941919)
I have similar experience, pipenv is not bad but it's definitely not great. Personally I'm starting to use poetry in new projects and it's being great, much better than pipenv.
Whenever I have time I want to migrate all my pipenv projects to poetry.
Re:Black – Uncompromising Python code formatter
by task_queue on Friday May 17, 2019 @06:30PM
(#19944215)
> It's so slow so often, and I can't understand why.
The Python community is victim to pipenv's creator's marketing and shoehorning, that's why.
Re:Black – Uncompromising Python code formatter
by kissgyorgy on Friday May 17, 2019 @05:51PM
(#19943924)
Probably because pipenv is the worst Python package manager ever.
Re:Black – Uncompromising Python code formatter
by AceJohnny2 on Friday May 17, 2019 @05:19PM
(#19943670)
I'm saving your and cjbprime's comments for future reference. You've both perfectly expressed the benefit and contextual benefit of code formatters.
Let me take a shot at why it's important.
We spend years peering at code hunting for tiny, miniscule mistakes. Thus we're training ourselves, quite rigorously, to spot minor deviations.
We're also irrational in the moment: our aesthetic sense is bothered by certain patterns, and our social sense wants to assign blame for this "wrongness" to individuals.
An auto-formatter removes a ton of deviations that don't matter, and desocializes the aesthetics.
This saves code reviewers time and stress and helps them focus on what actually matters in the code.
And it only has to save more time than it takes to run "pipenv run black" to be measurably worth it.