Sorry Python but it is what it is.

50 points
*
Deleted by creator
permalink
report
reply
1 point
*

The only time I ever interacted with python packaging was when packaging for nixos. And I can tell you that the whole ecosystem is nuts. You have like ten package managers each with thirty different ways to do things, none of which specify dependencies in a way that can be resolved without manual input because y’all have such glorious ideas as implementing the same interface in different packages and giving each the same name and such. Oh and don’t get me started on setup.py making http requests.

permalink
report
parent
reply
15 points

This article someone linked is not 14 years old and it perfectly describes the mess python and pip are: https://chriswarrick.com/blog/2023/01/15/how-to-improve-python-packaging/

My favorite part is:

Most importantly: which tool should a beginner use? The PyPA has a few guides and tutorials, one is using pip + venv, another is using pipenv (why would you still do that?), and another tutorial that lets you pick between Hatchling (hatch’s build backend), setuptools, Flit, and PDM, without explaining the differences between them

But yes, following old blog post is the issue.

permalink
report
parent
reply
6 points

Why not read the official python docs?

permalink
report
parent
reply
2 points

Hahaha!..

Oh shit, you’re serious.

permalink
report
parent
reply
3 points

If you’re using a manually managed venv, you need to remember to activate it, or to use the appropriate Python.

That really doesn’t seem like a big ask.

I’ve been using python professionally for like 10 years and package management hasn’t really been a big problem.

If you’re doing professional work, you should probably be using docker or something anyway. Working on the host machine is just asking for “it works on my machine what do you mean it doesn’t work in production?” issues.

permalink
report
parent
reply
0 points

No, actually most devs don’t use docker like that. Not java devs, not JS devs, not rust devs. That is because maven, npm and cargo manage dependencies per project. You use it for python exactly because pip does it the wrong way and python has big compatibility issues.

permalink
report
parent
reply
2 points

I have to agree, I maintain and develop packages in fortrat/C/C++ that use Python as a user interface, and in my experience pip just works.

You only need to throw together a ≈30 line setup.py and a 5 line bash script and then you never have to think about it again.

permalink
report
parent
reply
38 points

This is programmer humor, 95% of the people here still get defeated by semicolons, have never used a debugger, and struggle to exit vim.

permalink
report
parent
reply
14 points

Sometimes I wish there was a community for more advanced users, where the concept of deciding on the best build tool chain per project is not a major hurdle. Venvs? Nbd. Pipenv? Nbd. Conda/mamba/micromamba? Nbd. Pure pip? Oh boy, I hope it a simple one, but I’ll manage. Maven? Fml, but sure. Npm? Sure. “Complex” git workflows, no problem.

Idk, that’s just setting up the work environment, if your brains get squeezed by that I’m not sure if you will then be able to the actually code whatever its being asked of you. Some people…

But yeah, this is a newbie space so I guess that we have to ignore some noise.

permalink
report
parent
reply
1 point

Seriously, I usually use Poetry these days for most projects, shit just works, build well and lets me distribute my code from PiPy just fine. Everything in one pyproject.yaml.

permalink
report
parent
reply
13 points

They’re not difficult by any means.

But they are tedious when compared to other solutions.

permalink
report
parent
reply
3 points

If we talk about solutions: python has plenty. Which might be overwhelming to the user.

I use Direnv to manage my python projects. I just have to add layout pyenv 3.12.0 on top and it will create the virtual environment for me. And it will set my shell up to use that virtual environment as I enter that directory. And reset back to default when I leave the directory.

But you could use pipenv, poetry, pdm, conda, mamba for your environment management. Pip and python do not care.

permalink
report
parent
reply
30 points

npm is just plain up terrible. never worked for me first try without doing weird stuff

permalink
report
reply
14 points

i will get hated for this but: cargo > composer > pip > npm

permalink
report
reply
5 points

maven not on the list because they aren’t even playing the same sport.

permalink
report
parent
reply
28 points
*

I don’t know what cargo is, but npm is the second worst package manager I’ve ever used after nuget.

permalink
report
reply
10 points

I’ve never had an issue with nuget, at least since dotnet core. My experience has it far ahead of npm and pip

permalink
report
parent
reply
8 points
*

I’ll second this. I would argue that .Net Core’s package/dependency management in general is way better than Python or JavaScript. Typically it just works and when it doesn’t it’s not too difficult to fix.

permalink
report
parent
reply
2 points

It’s also much faster to install packages than npm or pip since it uses a local package cache and each package generally only has a few DLL files inside.

permalink
report
parent
reply
2 points
*

what’s wrong with nuget? I have to say I like the “I want latest” “no, all your dependencies are pinned you want to update latest you gotta decide to do it” workflow. I can think of some bad problems when you try to do fancy things with it but the basic case of “I just want to fetch my program’s dependencies” it’s fine.

permalink
report
parent
reply
2 points
*

I’m guessing they only used it 10 years ago when it was very rough around the edges. It didn’t integrate well with the old .NET Framework because it conflicted with how web.config managed dependencies and poor integration with VS. It was quite bad back then… but so was .NET Framework in general. Then they rebuilt from the ground up with dotnet core and it’s been rock solid since

Or they just hate Microsoft, which is a common motif to shit on anything Microsoft does regardless of the actual product.

permalink
report
parent
reply
2 points

Imho the VS integration has always been good, it’s the web config that’s always been a trash fire, and that’s not new.

permalink
report
parent
reply
5 points

cargo is rust

permalink
report
parent
reply
28 points

cargo is the package manager for the Rust language

permalink
report
parent
reply
3 points

Fuck pip

all my homies use pdm

permalink
report
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 4.3K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments