hmemcpy / hmemcpy/toolkata

Tutorial: uv for pip users (uv-pip pairing)

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Summary

Add a new tutorial pairing: **Learn uv if you know pip**.

## Motivation

Astral's uv is a Rust-based Python package manager that's 10-100x faster than pip. It implements the same workflow (install, uninstall, requirements.txt) but with massive performance gains. This is a practical, high-impact pairing for the huge Python ecosystem.

**Why this works:**
- Massive performance improvement (10-100x faster)
- Drop-in replacement for pip workflows
- Growing adoption in Python community (Astral tooling: ruff, uv)
- Clear value proposition with minimal learning curve

## Proposed Structure (~8 steps, ~25 min)

| Step | Concept | pip → uv |
|------|---------|----------|
| 1 | Install uv | `curl -LsSf https://astral.sh/uv/install.sh | sh` |
| 2 | Basic package install | `uv pip install requests` vs `pip install requests` |
| 3 | Virtual environments | `uv venv` (faster creation, built-in) |
| 4 | requirements.txt | `uv pip install -r requirements.txt` (10-100x faster resolution) |
| 5 | Lock files | `uv pip compile` (deterministic, reproducible builds) |
| 6 | Running Python | `uv run python script.py` (auto-venv, no manual activation) |
| 7 | Project management | `uv init`, `uv add`, `uv remove` (modern workflow) |
| 8 | Migration | `uv pip freeze` compatibility, gradual adoption |

## Key Comparison Points

| pip workflow | uv equivalent | Benefit |
|--------------|---------------|---------|
| `pip install package` | `uv pip install package` | 10-100x faster |
| `python -m venv .venv` | `uv venv` | Faster, no activation needed with `uv run` |
| `pip install -r requirements.txt` | `uv pip install -r requirements.txt` | Parallel downloads, faster resolution |
| `pip freeze` | `uv pip freeze` | Compatible output |
| `pip-tools compile` | `uv pip compile` | Built-in, faster |
| `pip install -e .` | `uv pip install -e .` | Faster editable installs |

## Pedagogical Notes

**The "aha" moment:** Running `uv pip install -r requirements.txt` on a large project and watching it complete in seconds instead of minutes.

**Key insight:** uv doesn't change the mental model — it keeps pip's UX but removes the pain points (speed, resolution, virtualenv management).

**Migration path:** uv is designed for gradual adoption. You can alias `pip=uv pip` and everything works.

## Resources

- https://github.com/astral-sh/uv
- https://docs.astral.sh/uv/
- https://astral.sh/blog/uv-unified-python-packaging

## Category

`Package Management`

## Notability

- Astral is well-funded (ruff success)
- uv is gaining rapid adoption in Python community
- Addresses a universal Python pain point (pip slowness)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.