Examples for the book Thinking in Types by Bruce Eckel
This project uses:
uv, a fast Python package manager and virtual environment tool.pyinvoke, a command runner (automatically installed by the instructions below).
- Clone this repository
- Install uv
- Run
uv run bootstrap.py- Creates a
.venvdirectory - Installs all dependencies (including dev tools like
invoke,ruff, etc.) - Displays instructions to activate the virtual environment
- Creates a
- Activate the virtual environment.
- Test by running
invoke run-all, which runs all examples and ensures they succeed.
If you activate the virtual environment, you can run any example with python example.py.
Without activation, use uv run example.py.
- To update Pyright:
uv tool install pyright --force
- If you have
pipissues, trypython -m ensurepip --upgrade - If you're trying to see which Python uvx is using, run:
uvx python -c "import sys; print(sys.executable)"
- Install
pnpm. In Windows:winget install --id pnpm.pnpm invoke slideshow
Or, if you want to run a specific presentation:
cd slidevpnpm slidev Slides.md(or whatever slides Markdown file you want to run)