[Python Dependency Pitfalls] How to set the world on fire

Hey there,

#1 on my list of dependency management pitfalls is there for a good reason:

It lead to a single developer causing mayhem and breaking thousands of open-source projects around the world in one fell swoop.

Here's how it all went down:

A few years back, Azer Koçulu wrote a tiny library he published on Npm, the package repository for NodeJS. (The Python equivalents would be PyPI + pip.)

That "library" contained only 11 lines of code in total, but it was downloaded MILLIONS of times every month of as a dependency in other JavaScript projects.

What Azer's magical "micro library" did, you ask?

It added a tiny piece of functionality that was frequently needed but wasn't a part of the NodeJS standard library:

The ability to pad out the lefthand-side of strings with zeroes or spaces. For example, to format numbers for display.

In Python you'd probably do something like this:

>>> n = '4'
>>> n.zfill(3)
'004'

Anyway, this tiny "left-pad" library was used across many projects, including important applications like Node itself.

One fine day, Azer decided to close his NodeJS package repository account…

Which removed all of the packages associated with it.

And suddenly, "left-pad" was no longer available for download…

Can you guess what happened to the dependency install setup steps on projects using "left-pad?"

Well, they came to a SCREECHING HALT:

App deployments became stuck dead in their tracks. Automated tests stopped working.

And thousands of developers couldn't even RUN their apps locally…

All because "left-pad" had disappeared—and some important build tools required it to work.

It was quite crazy. Even some newspapers reported about the "left-pad incident."

You can imagine that there was a lot of "bruhaha" about the NodeJS packaging system—

But to tell you the truth the *exact same thing* could happen at any time with Python's packaging repository, PyPI.

It's easy to think that pulling in functionality from 3rd party dependencies is always a net benefit.

But every time you're adding an external dependency to your own project you're walking a fine line…

BAD external dependencies can make your stomach churn as a developer or project maintainer.

The people who got burned by the NodeJS "left-pad" incident know what I'm talking about...

On the other hand, a great quality third-party package can save you hours or even days of work.

The challenge is deciding whether a dependency adds value or is just a liability:

>> See step-by-step how to research and make Python dependency decisions (and how to explain them to your team/manager)

— Dan Bader

P.S. There's an important skill that Python dev managers look for in a candidate, but they rarely find it. More on that tomorrow.

Key phrases

Older messages

[Sublime + Python Setup] why Atom can’t replace Sublime

Wednesday, September 22, 2021

Hey there, "In a nutshell, Atom is a Sublime Text editor that just got better." When I read this quote I got so worked up I nearly fell off my chair. Because every time I've tried Atom or

[PythonistaCafe] What's in PythonistaCafe for you?

Wednesday, September 22, 2021

Hey there, A couple of years ago I'd become quite interested in martial arts. Hours upon hours of watching "The Karate Kid" growing up must've taken their toll on me... And so, I

[PythonistaCafe] Why PythonistaCafe exists

Tuesday, September 21, 2021

Hey there, In one of my last emails I talked about how some online communities in the tech space devolve over time and turn into cesspools of negativity. This relates directly to how and why I started

[Sublime + Python Setup] The Ctrl+s "Heisenbug"

Tuesday, September 21, 2021

"What the **** is going on?!" I heard Keith yell. Returning from my lunch break and in a helpful mood I grabbed my coffee mug and shuffled over to my coworker's desk. "What's

[Python Dependency Pitfalls] A total mess?

Monday, September 20, 2021

Hey there, Recently I watched a Pythonista ask for advice on setting up a Python project on his work machine. This new developer had some prior experience with NodeJS and had just started to get his

You Might Also Like

New Blogs on ThomasMaurer.ch for 04/23/2024

Tuesday, April 23, 2024

View this email in your browser Thomas Maurer Cloud & Datacenter Update This is the update for blog posts on ThomasMaurer.ch. Cloud operations for Windows Server through Azure Arc By Thomas Maurer

Post-Post 🗨️

Tuesday, April 23, 2024

Assessing the post-Twitter climate amid Post.News' shutdown. Here's a version for your browser. Hunting for the end of the long tail • April 22, 2024 Post-Post The demise of Post, one of the

BetterDev #257 - Building a GPS Receiver

Monday, April 22, 2024

Better Dev #257 Apr 22, 2024 Hi all, We come back with a new issue this week. If you like BetterDev, please help spead word out by refer to your friends. Buy me a coffee would be great too. This week I

Tomorrow's Free Notes Class: How to sign up!

Monday, April 22, 2024

Hi there, Tomorrow we will be hosting a Free Notes App Class. This is your last chance to register for tomorrow's live class and learn how to get the most out of your Notes app. Our experienced

Elon’s ‘balls to the wall’ autonomy push

Monday, April 22, 2024

Plus: Amazon ends California drone deliveries and Rippling's founder has a brand-new bag View this email online in your browser By Christine Hall Monday, April 22, 2024 Image Credits: Toru Hanai/

📱 Your iPhone is Now Discoverable by Others — Tips for Building Your First PC

Monday, April 22, 2024

Also: How to Play Windows Games on Your Mac, and More! How-To Geek Logo April 22, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your inbox by

JSK Daily for Apr 22, 2024

Monday, April 22, 2024

JSK Daily for Apr 22, 2024 View this email in your browser A community curated daily e-mail of JavaScript news It Is so Cool to Develop React Native With Expo 1. What are the benefits of Expo?. "

😺 The social walkie-talkie

Monday, April 22, 2024

Hi, hi! It's Monday and it's Earth Day! Don't miss the Cat Nips section below for innovative products in the... Product Hunt Read in browser This newsletter is brought to you by YOU MIGHT

The Rings of Power

Monday, April 22, 2024

A paid tier for Spyglass: 'The Inner Ring' The Rings of Power By MG Siegler • 22 Apr 2024 View in browser View in browser On January 22, 2024, exactly one quarter ago, I launched Spyglass. Over

Engineering the future

Monday, April 22, 2024

Don't worry -- we'll be diving into the Mars Sample Return news. View this email online in your browser By Aria Alamalhodaei Monday, April 22, 2024 Hello and welcome back to TechCrunch Space.