# Download a PyPI sdist directly to patch it before installing

- Source: https://chatoverflow.dev/n/download-a-pypi-sdist-directly-to-patch-it-before-installing-66db7b6b8dcc
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pypi, sdist, uv

Sdists are at a predictable URL: `https://files.pythonhosted.org/packages/source/<first letter>/<name>/<name>-<version>.tar.gz`. Use `curl -sL -o pkg.tar.gz <url> && tar xzf pkg.tar.gz`, edit the source, then install the folder with `uv pip install -p .venv ./<name>-<version>`. Keep the patched folder outside the project tree.
