Sorry Python but it is what it is.

Praise Idleness
link
fedilink
English
1
edit-2
2M

deleted by creator

So noone mentioned how awesome vcpkg is yet?

Fuck pip

all my homies use pdm

ɐɥO
link
fedilink
11Y

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

Tekhne
link
fedilink
71Y

No one here has yet complained about Cocoapods and Carthage? I’m traumatized. Thank God for SwiftPM

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

Pxtl
link
fedilink
English
2
edit-2
1Y

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.

Lucky
link
fedilink
2
edit-2
1Y

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.

Pxtl
link
fedilink
English
21Y

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.

Lucky
link
fedilink
11Y

The project I’m on right now originally had the nuget.exe saved in source because they had to manually run it through build scripts, it wasn’t built in to VS until VS2012

cargo is the package manager for the Rust language

cargo is rust

Lucky
link
fedilink
21Y

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

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.

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.

So you are saying that npm is better than pip?? I’m not saying pip is good, but npm?

Sören
link
fedilink
171Y

npm has a lockfile which makes it infinitely better.

bjorney
link
fedilink
111Y

pip also has lock files

pip freeze > requirements.txt

Would that just create a list of the current packages/versions without actually locking anything?

bjorney
link
fedilink
6
edit-2
1Y

Would that just create a list of the current packages/versions

Yes, and all downstream dependencies

without actually locking anything?

What do you mean? Nothing stops someone from manually installing an npm package that differs from package-lock.json - this behaves the same. If you pip install -r requirements.txt it installs the exact versions specified by the package maintainer, just like npm install the only difference is python requires you to specify the “lock file” instead of implicitly reading one from the CWD

@SatyrSack@lemmy.one
link
fedilink
1
edit-2
1Y

As I understand, when you update npm packages, if a package/version is specified in package-lock.json, it will not get updated past that version. But running those pip commands you mentioned is only going to affect what version gets installed initially. From what I can tell, nothing about those commands is stopping pip from eventually updating a package past what you had specified in the requirements.txt that you installed from.

bjorney
link
fedilink
11Y

But running those pip commands you mentioned is only going to affect what version gets installed initially.

I don’t follow. If my package-lock.json specifies package X v1.1 nothing stops me from manually telling npm to install package X v1.2, it will just update my package.json and package-lock.json afterwards

If a requirements.txt specifies X==1.1, pip will install v1.1, not 1.2 or a newer version. If I THEN install package Y that depends on X>1.1, the pip install output will say 1.1 is not compatible and that it is being upgraded to 1.2 to satisfy package Y’s requirements. If package Y works fine on v1.1 and does not require the upgrade, it will leave package X at the version you had previously installed.

Sören
link
fedilink
11Y

That’s not a lockfile. This would be the equivalent of package.json

bjorney
link
fedilink
-11Y

How is it not a lock file?

package.json doesn’t contain the exact version number of all downstream dependencies, this does

Lockfile contains exact state of the npm-managed code, making it reproducible exactly the same every time.

For example without lockfile in your package.json you can have version 5.2.x. In your working directory, you use 5.2.1, however on repo, 5.2.2 has appeared, matching your criteria. Now let’s say a new bug appeared in 5.2.2.

Now you have mismatched vendor code, that can make your code behave differently on your machine, and your coworker’s machine, making you hunt for bug that wasn’t even on your side.

Lockfile prevents that by saving an actual state of vendor code.

bjorney
link
fedilink
11Y

Yes, which is EXACTLY like a pip freeze’d requirements.txt, storing the exact version of every package and downstream dependency you have installed

Pip has Pipfile.lock.

@ExLisper@linux.community
creator
link
fedilink
English
-21Y

I would say npm is shitty like a lot of tools are. pip takes it to the next level.

Yeah? I don’t recall having to wait a long time when setting up my project using pip.

LalSalaamComrade
link
fedilink
36
edit-2
1Y
@ExLisper@linux.community
creator
link
fedilink
English
2
edit-2
1Y

In my experience npm is not great but it does work most of the time. I just tried installing bunch of stuff using pip and NONE of them worked. Python is backwards compatibility hell. Python 2 vs 3, dependencies missing, important libraries being forked and not working anymore. If the official installation instructions are ‘pip install X’ and it doesn’t work then what’s the point?

npm has A LOT of issues but generally when I do ‘npm i’ i installs things and they work.

But the main point is that cargo is just amazing :)

P.S. Never used ruby.

Hmm, I personally haven’t seen that kind of issue myself though. I also tend to not use random packages from random authors though, so that might help.

deleted by creator

@ExLisper@linux.community
creator
link
fedilink
English
11Y

The main issue with JS is that every 6 months someone comes up with the next great tool that misses half of basic features and dies after 6 months when someone comes up with the next great tool. But at least the old tested solution still works unlike in Python where the main goal seems to be breaking the backwards compatibility as often as possible.

But at least the old tested solution still works unlike in Python where the main goal seems to be breaking the backwards compatibility as often as possible.

lol what. Node does a new major release every six months. And you’re shit talking python? There’s probably never going to be another major version change, and minor versions have several years of support

In like 10 years of python development I don’t think I’ve ever been mad about breaking changes in python.

I’m still rocking the fuck out of PHP (8) 😘

pnpm is already very well established, it’s not completely different from npm either so they didn’t have to reinvent the wheel, they just made some things much better.
Python is is just a mess on the other hand, a thousand tools all with some overlap in what they’re trying to achieve because they didn’t have the balls to make pip an all-in-one solution, there are 2 great alternatives that do almost everything though: poetry and pdm. I read a spot on analysis on this article, maybe it can help you make a choice

@ExLisper@linux.community
creator
link
fedilink
English
11Y

This is great, thanks. Will definitely read even though I don’t do much work in python. It’s good to know how NOT to do things.

@rothaine@beehaw.org
link
fedilink
-3
edit-2
1Y

Sorry but nah. My last job we had a couple different python microservices. There was pipenv, venv, virtualenv, poetry, Pipfile.lock, requirements.txt (which is only the top level???), just pure madness

Apparently all this shit is needed because python wants to install shit globally by default? Are you kidding?

Well, we also had a couple node microservices. Here’s how it went: npm install. Done.

Afraid you fucked something and want a clean environment? Here’s how you do it with node: delete node_modules/. Done.

Want a clean python env? Uhhhhhhhh use docker I guess? Maybe try reinstalling Python using homebrew? (real actual answers from the python devs who set these up)

Well what’s currently installed? ls node_modules, or use npm ls if you want to be fancy.

In python land? Uhhhhhh

Let’s update some dep–WHY AREN’T PYTHON PACKAGES USING SEMVER

So yeah, npm may do some stuff wrong, but it seems like it does way more shit right. Granted I didn’t really put in the effort to figure out all this python shit, but the people who did still didn’t have good answers. And npm is just straightforward and “works”.

“But JS projects pull in SOOOO many dependencies” Oh boohoo, you have a 1TB SSD anyway.

Im honestly surprised someone using Python professionally appears to not know anything about how pip/venv work.

The points you think you are making here are just very clearly showing that you need to rtfm…

More like rtfms. I really didn’t feel like learning 20 different tools for repos my team didn’t touch very often.

I really don’t see the hassle… just pick one (e.g. pip/venv) and learn it in like half a day. It took college student me literally a couple hours to figure out how I could distribute a package to my peers that included compiled C++ code using pypi. The hardest part was figuring out how to cross compile the C++ lib. If you think it’s that hard to understand I really don’t know what to tell you…

Sure, for a new project. But when inheriting code I’m not in a position to pick.

The point is that the state of python package managers is a hot fucking mess compared to npm. Claiming that “npm is just as bad” (or worse) honestly seems ridiculous to me.

(And isn’t pip/venv the one the requirements.txt one? Completely flat, no way to discern the difference between direct dependencies and sub-dependencies? No hashes? Sucks when it’s time for updating? Yeah no thanks, I’d like a proper lock file. Which is probably why there are a dozen other tools.)

Apparently all this shit is needed because python wants to install shit globally by default?

None of that was needed. It was just used because nobody at your company enforced a single standard for developing your product.

Afraid you fucked something and want a clean environment? Here’s how you do it with node: delete node_modules/. Done.

rm -rf venv/. Done.

Want a clean python env? Uhhhhhhhh use docker I guess?

python -m venv venv

Well what’s currently installed? ls node_modules, or use npm ls if you want to be fancy. In python land? Uhhhhhh

pip freeze. pip list if you want it formatted.

Let’s update some dep–WHY AREN’T PYTHON PACKAGES USING SEMVER

Janky, legacy python packages will have random versioning schemes. If a dependency you’re using doesn’t follow semver I would question why you’re using it and seek out an actively maintained alternative.

That’s not a controversial opinion. I’d say it’s worse than pip. At least pip doesn’t put nag messages on the console or fill up your hard drive with half a gigabyte of small files. OP is confused.

@Hawk@lemmy.dbzer0.com
link
fedilink
English
111Y

npm is so good there are at least 3 alternatives and every package instructs on using a different one.

About the only good thing about npm is that I can use one of the superior alternatives. Using npm is almost always a headache as soon as you start working with a decent number of packages.

Memes like this make me ever more confused about my own software work flow. I’m in engineering so you can already guess my coding classes were pretty surface level at least at my uni and CC

Conda is what I like to use for data science but I still barely understand how to maintain a package manager. Im lowkey a bot when it comes to using non-GUI programs and tbh that paradigm shift has been hard after 18 years of no CLI usage.

The memes are pretty educational though

Try not to learn too much from memes, they’re mostly wrong. Conda is good, if you’re looking for something more modern (for Python) I’d suggest Poetry

Never have heard of Poetry, but I’ll check it out tonight! I pretty much exclusively coded in Python and Julia up until I got out of uni. I learned after a couple of months of insanity swapping kernels, init systems, distributions and learning everything about file systems only leads to further insanity and productivity hindrance.

Something something recommending someone who doesn’t know what a shell is to use emacs and make a Lua/Neovim config. Thanks for the tip!

Tbh, I’m always ending up having issues using poetry and conda. I prefer using penv and pip.

@mog77a@lemmy.ml
link
fedilink
English
21Y

100% this. I remember really really trying to get the hang of them and eventually just giving up and doing it manually every time. I somehow always eventually mess something up or god forbid someone who isn’t me messes it up and I end up spending 4 hours dependency hunting. Venv and pip while still annoying are at least reliable and dead simple to use.

However, a container is now my preferred way of sharing software for at least the past 6 years.

Yup. A container i slow to rebuild, but at least the most robust. This is my preferred way to share python code when there are system dependencies involved.

Andrew
link
fedilink
71Y

npm bad, pnpm good.

What’s the difference? I’m currently doing my web developement 2 course where we started using react so I’m typing npm to terminal all the time :D

Andrew
link
fedilink
11Y

Check out https://pnpm.io

I really dislike pnpm, if everyrhing you do is install and build then if doesnt matter what you use, if you do anything complex pnpm will come back to bite you. Yarn is a good middle ground

Andrew
link
fedilink
11Y

You literally didn’t gave any arguments why you really dislike pnpm. The most obvious benefit is several times faster installations. It also have resolved some peer dependencies (I don’t remember details).

Bun best

I avoid NPM after node-ipc Ukrainian malware incident.

spez
link
fedilink
English
41Y

Pip has a good looking loading thingy though.

NuGet (for C# / .NET) is far better than npm.

And it has a cool name

this is more abt programming languages than packages managers

Which allows me to bash python endlessly >.>

Create a 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.
  • 1 user online
  • 50 users / day
  • 169 users / week
  • 442 users / month
  • 2.42K users / 6 months
  • 1 subscriber
  • 1.61K Posts
  • 35.6K Comments
  • Modlog