News for hackers. Stuff that matters.
Re:Dozens of malicious PyPI packages discovered targeting de... by plugin-baby on Wednesday November 02, 2022 @05:17PM (#33443042)
> And why is nodejs so much more dependency-happy than python?

Could it be that nodejs has implemented package management more consistently and conveniently than other languages/platforms?

Re:Dozens of malicious PyPI packages discovered targeting de... by Scarblac on Wednesday November 02, 2022 @05:25PM (#33443128)
That's one thing, the other is the almost complete absence of a standard library.
Re:Dozens of malicious PyPI packages discovered targeting de... by heleninboodler on Wednesday November 02, 2022 @05:38PM (#33443266)
Yeah, I think this is a big one. One of the things that I have always liked about Golang is that the standard library is quite complete and the implementations of things are (usually) not bare-bones implementations that you need to immediately replace with something "prod-ready" when you build a real project. There are exceptions, of course, but I think it's very telling that most of my teammates go so long without introducing new dependencies that they usually have to ask me how to do it. (I never said the ux was fantastic :) This also goes to GP's "consistent and convenient" argument.
Re:Dozens of malicious PyPI packages discovered targeting de... by peteatphylum on Wednesday November 02, 2022 @06:10PM (#33443619)
Totally agree. It feels like there is a pretty strong inverse correlation between standard library size, and average depth of a dependency tree for projects in a given language. In our world, that is pretty close to attack surface.
Re:Dozens of malicious PyPI packages discovered targeting de... by galangalalgol on Wednesday November 02, 2022 @08:17PM (#33444870)
Rust is another example of this. Just bringing in grpc and protobuf gets about a hundred dependencies. Some of them seemingly unrelated. For a language aimed at avoiding security bugs, I find this to be an issue. But a good dependency manager and a small (or optionally absent) stdlib has lead to highly granular dependencies and bringing in giant libs for tiny bits.
Re:Dozens of malicious PyPI packages discovered targeting de... by dheera on Wednesday November 02, 2022 @06:21PM (#33443720)
pip throws your dependencies in some lib directory either on your system (default if you use sudo), in your home directory (default if you don't use sudo), or inside your virtualenv's lib directory.

npm pulls dependencies into node_modules as a subdirectory of your own project as default.

Python really should consider doing something similar. Dependencies shouldn't live outside your project folder. We are no longer in an era of hard drive space scarcity.

Re:Dozens of malicious PyPI packages discovered targeting de... by coredog64 on Wednesday November 02, 2022 @06:40PM (#33443868)
As of Python 3, pip install into the system Python lib directory is strongly discouraged. ISTR that even using pip to update pip results in a warning.

That’s not to say that there’s not still some libs out there that haven’t updated docs to get with the times.

Re:Dozens of malicious PyPI packages discovered targeting de... by kevin_thibedeau on Thursday November 03, 2022 @04:30AM (#33448403)
More distros should adopt the Debian practice of installing into dist-packages and leaving site-packages as a /usr/local equivalent for pip to use on it's own.
Re:Dozens of malicious PyPI packages discovered targeting de... by cozzyd on Wednesday November 02, 2022 @06:58PM (#33444034)
Have you seen how much space a virtualenv uses? It can easily be >1 GB. For every project, this adds up. (Not to mention the bandwidth, which is not always plentiful).
Re:Dozens of malicious PyPI packages discovered targeting de... by dheera on Wednesday November 02, 2022 @07:20PM (#33444226)
4TB hard drives are $300 these days.
Re:Dozens of malicious PyPI packages discovered targeting de... by mardifoufs on Wednesday November 02, 2022 @11:24PM (#33446605)
4tb HDDs are closer to 80$ now, but that reinforces your point :). Even SSDs are now close to 300$ for 4tb!
Re:Dozens of malicious PyPI packages discovered targeting de... by dheera on Thursday November 03, 2022 @12:52PM (#33453851)
Yeah i meant 4TB SSDs, who uses magnetic HDDs anymore lol
Re:Dozens of malicious PyPI packages discovered targeting de... by hnbad on Thursday November 03, 2022 @09:26AM (#33450597)
Well, npm uses a cache so it won't re-download every package every time you install it.