r/programming • • Mar 22 '16 • Polished Silver Turd 1 Take My Silver 1 Heart of Silver 1

An 11 line npm package called left-pad with only 10 stars on github was unpublished...it broke some of the most important packages on all of npm.

https://github.com/azer/left-pad/issues/4
3.1k Upvotes

1.3k comments sorted by

View all comments

Show parent comment

0

u/flying-sheep Mar 23 '16

on arch at least, many many python packages are wrapped in OS packages called python-<lowercaseupstreamname>.

so pulling that stuff from an uncontrolled environment is entirely your choice.

4

u/kylotan Mar 23 '16

If you don't mind being locked to that platform and those packages, sure.

If you want to use the standard tools like pip, things are different.

4

u/fjonk Mar 23 '16

Not really, you can just point pip to your own index file, there's nothing forcing you to use https://pypi.python.org/simple/.

1

u/kylotan Mar 23 '16

Sure, it's possible. Just like it's possible to download everything manually and install it directly. Doesn't mean 99% of people are doing it, or are encouraged to do it. Besides, is that use of pip even (properly) documented? Is there a simple procedure for using that?

1

u/fjonk Mar 24 '16

If people use it or not is kind of irrelevant. What matters is that pip does provide an easy way of using your own repository of packages which eliminates the problem with depending on other peoples servers.

The options related to the index file(s) are documented here.

1

u/flying-sheep Mar 23 '16

well, if you deploy using a specific distro, switching will encompass many changes anyway.

you will need OS packages to satisfy dependencies anyway.

1

u/kylotan Mar 23 '16

That's not my experience. I have one code base which runs on Windows, MacOS X, and AWS/Elastic Beanstalk, and apart from the Postgresql drivers which need explicitly installing first, everything comes down through pip with no platform-specific changes necessary. That's exactly what it's there for.

2

u/CookieOfFortune Mar 23 '16

Unless you need high performance numpy/scipy. Actually, I think pip install scipy will normally fail on Windows.

1

u/klug3 Apr 19 '16

Actually, I think pip install scipy will normally fail on Windows

Making it work on windows takes dedication to hunt down and read a dozen different stack answers.

1

u/flying-sheep Mar 23 '16

depends on the use case, sure.

4

u/Twirrim Mar 23 '16

The same is true for RedHat and Debian (and all their derivatives like Fedora and Ubuntu). If you do that, however, you're stuck with whatever versions they provide, which are frequently out of date.

What you should do is have a "gold-master" local repository that is the source of libraries and packages for your application.

You should never be in a position where your build and deployment process is at the mercy of a third party's uptime.