pickuma.
Infrastructure

PyPI Package Growth Surge: What the Explosion Means for Python Developers

PyPI's catalog is growing faster than ever. Here's how the surge affects supply-chain risk, dependency bloat, and what to use when you audit your tree.

6 min read

Python’s package index keeps getting heavier. The catalog passed 600,000 projects in 2024 and the upload rate hasn’t slowed. For you, that means every pip install pulls from a registry that is harder to police, harder to mirror, and easier to game. The good news: the tooling for vetting dependencies has matured in parallel. The bad news: most teams haven’t updated their habits to match.

The numbers behind the surge

PyPI has been roughly doubling its project count every three to four years. The Python Software Foundation’s published stats show daily download counts in the billions and monthly new-project counts that now sit in the tens of thousands. A meaningful share of new uploads are not first-class libraries — they’re forks, abandoned experiments, AI-generated wrappers, or single-purpose tools that one team needed once and published anyway.

Two structural shifts are driving the curve. First, packaging finally got easy: pyproject.toml, build, and twine made the publishing path approachable, and uv shortened install times so much that adding a dependency feels free. Second, LLM-assisted workflows generate code that imports packages the author has never personally vetted. The same prompt that builds a script tells you to pip install four libraries you’ve never heard of.

The result is a registry where the median package has fewer maintainers, less documentation, and a shorter half-life than the packages you grew up on. That doesn’t make the ecosystem worse — it makes the vetting burden heavier, and that burden falls on you.

Where the risk actually lives

Supply-chain risk in Python clusters in four places, and they’re not equally serious:

  1. Typosquats and namespace confusion. Researchers have flagged hundreds of typosquatting packages targeting names like requests, urllib3, colorama, and tensorflow. PyPI’s quarantine feature now removes obvious offenders within hours, but the window is non-zero.
  2. Hijacked maintainer accounts. The 2022 ctx incident is the textbook example: an abandoned but popular package was taken over and shipped a malicious release to existing installs. PyPI’s mandatory 2FA has closed the easiest version of this attack, but inherited trust in legacy packages remains a liability.
  3. Transitive dependencies you never picked. A package you read carefully can pull in a chain of packages you didn’t. The deeper the tree, the less your direct review covers.
  4. Build-time execution. setup.py runs arbitrary code at install. Wheels are safer, but source distributions still arrive on developer machines and CI runners every day.

Auditing your tree without becoming paranoid

You don’t need a CISO and a full sigstore deployment to make real progress. A practical baseline for a small team looks like this:

  • Lock everything. Use uv lock, pip-tools, or Poetry. A lockfile with hashes turns an attack on PyPI into an attack on your specific pinned versions — much narrower.
  • Run pip-audit in CI. It’s the PyPA-maintained scanner, checks against the OSV database, and exits non-zero on known vulns. Add it to your pre-merge checks; the false-positive rate is low enough that nobody will mute it.
  • Use deps.dev or socket.dev for new additions. Both surface signals you can’t easily eyeball: package age, maintainer count, install-time scripts, network behavior. Make a 60-second look a habit before any new direct dependency.
  • Mirror what you depend on. For teams shipping to production, a private index — devpi, JFrog, AWS CodeArtifact — gives you a freeze point and a single place to revoke a compromised version. This is the highest-leverage move once your dependency list crosses 50 direct packages.
  • Enable Dependabot or Renovate. Stale dependencies are themselves a risk, since unmaintained packages accumulate quiet vulnerabilities. Automated PRs keep you current without weekend work.

The first three items take an afternoon. The last two are weekend projects with permanent payoff.

Cursor

An AI-first editor that surfaces the imports it suggests, makes it easy to inspect package sources before installing, and integrates with Ruff and security scanners across your Python workflow.

Free tier; Pro from $20/month

Try Cursor

Affiliate link · We earn a commission at no cost to you.

A workable policy for the next year

If you write Python for a living, three habits will absorb most of the surge’s downside without slowing you down.

Treat every new dependency as a small decision, not a free one. Before pip install, glance at the project page: when was the last release, how many maintainers, do the open issues look healthy. Thirty seconds. If the package has 200 downloads a week and exists to wrap two lines of requests, copy the two lines instead.

Move toward signed artifacts. PEP 740 brought sigstore attestations to PyPI in 2024, and trusted publishing via GitHub Actions OIDC removed long-lived API tokens from the equation. If you publish, adopt it. If you only consume, prefer packages that already do — the attestation metadata is visible on the PyPI project page.

Budget for occasional incidents. A team running 100+ transitive dependencies will eventually consume a bad version. The goal isn’t to prevent every incident — it’s to detect within hours and roll back within minutes. That means lockfiles, an audit pass in CI, and a way to ship a pinned downgrade fast.

The PyPI surge is not the kind of problem that gets “solved.” It’s a permanent ambient condition you adapt to, the same way you adapted to GitHub holding most of your tooling or npm spawning ten thousand left-pad descendants. Build the habits now, while the cost of forming them is low.

FAQ

Is PyPI getting less safe overall? +
Not really — the index itself has gotten significantly more secure since 2022 (mandatory 2FA, trusted publishing, sigstore attestations, quarantine for reported malware). What's harder is your job as a consumer: the surface area you might pull from has grown faster than your ability to read it. The platform is fine. Your dependency tree needs more attention than it used to.
What's the single most useful tool to add to a Python project today? +
pip-audit in CI. It's maintained by the PyPA, reads your lockfile, checks against the OSV database, and takes about five minutes to wire into GitHub Actions. It won't catch novel attacks, but it will catch every published CVE in your tree, which covers the majority of real-world exposure.
Should you mirror PyPI internally? +
If your team has more than a handful of engineers shipping production Python, yes. A private index (devpi, AWS CodeArtifact, Artifactory) gives you a single revocation point and protects you from the gap between PyPI removing a malicious package and your CI re-installing it. For a solo project or hobby work, a lockfile with hashes is enough.

Related tools

Some links above are affiliate links. We may earn a commission if you sign up. See our disclosure for details.

Related reading

See all Infrastructure articles →

Get the best tools, weekly

One email every Friday. No spam, unsubscribe anytime.