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

Hey Reader,

#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.

Older messages

A "Pythonic" rant?

Wednesday, April 22, 2020

Hey Reader, "Why is Python dependency management so sh*t?" This is a quote that I recently heard from another developer. You know I *love* Python so hearing this instantly made me feel

[🐍PyTricks]: Function argument unpacking in Python

Wednesday, April 22, 2020

# Why Python Is Great: # Function argument unpacking def myfunc(x, y, z): print(x, y, z) tuple_vec = (1, 0, 1) dict_vec = {'x': 1, 'y': 0, 'z': 1} >>> myfunc(*tuple_vec

last call

Tuesday, April 21, 2020

Python Tricks: The Book is available at a 33% discount Click here to learn more and claim your discount Hey Reader, This is the sentence that started it all: "I don't even feel like I've

How we make our custom Python mugs & other swag

Tuesday, April 21, 2020

Hey Reader, In my last email I told you about Nerdlettering.com, the "swag store" for Pythonistas that my wife Anja and I launched. It's been a ton of fun (and work) getting that store

What Python developers say about "Python Tricks: The Book"

Monday, April 20, 2020

Hey Reader, I wanted to share a few things that other Python developers have said about "Python Tricks: The Book." Here's what the Python community had to say: ~~~ “I first heard about

You Might Also Like

Reach More Readers, newsletterest1 – BOOST Your Story on HackerNoon🔥

Wednesday, December 11, 2024

Get Your Story Featured on the Homepage and in The HackerNoon Newsletter ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌

Top Tech Deals 👀 $109 Robot Vacuum, Google Pixel Sale, Anker Power Bank, and More

Wednesday, December 11, 2024

Grab a new Pixel phone or tablet, stocking stuffers, and other goodies. How-To Geek Logo December 11, 2024 Top Tech Deals: $109 Robot Vacuum, Google Pixel Sale, Anker Power Bank, and More Grab a new

Hurry, newsletterest1! Less Than a Week Left to Compete for $2,500 in the AI Writing Contest 🏃

Wednesday, December 11, 2024

Start drafting your entry today! ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌

DePIN On Ethereum: Redefining Coordination Systems

Wednesday, December 11, 2024

Top Tech Content sent at Noon! Boost Your Article on HackerNoon for $159.99! Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, December 11, 2024? The

Post from Syncfusion Blogs on 12/11/2024

Wednesday, December 11, 2024

New blogs from Syncfusion Building a Neumorphic UI with .NET MAUI Column Chart to Showcase Gen Z's Favourite Social Media Platforms By Dhanaraj Rajendran Learn to create a Neumorphic UI with

24 Hours Until Our 2025 Outlook Webinar – Register Now ⏰

Wednesday, December 11, 2024

Don't miss the key trends shaping 2025 with our free webinar on December 12th. View Online | Subscribe | Download Our App FREE WEBINAR - Tomorrow at 11am PST 2025 Outlook: Key Trends on Our Radar

⚙️ Another AI lawsuit

Wednesday, December 11, 2024

Plus: Tesla sued ... again ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

The most Windows-like Linux distro

Wednesday, December 11, 2024

iOS 18.2 arrives; AI moves undercover; Natural Cycles dupe -- ZDNET ZDNET Tech Today - US December 11, 2024 The default Wubuntu desktop. This Linux distro is so Windows-like, it even comes with

Your InfoSec Survival Guide

Wednesday, December 11, 2024

How to optimize your compliance practices through a continuous monitoring approach The Hacker News The InfoSec Survival Guide Today, security and compliance leaders are struggling under the pressure of

The Sequence Chat: The One Area in Which China can Dominate the US in the AI Race

Wednesday, December 11, 2024

Might come as a surprise. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏