1/6
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What are poetry and uv, why are they useful
Both are Python package managers that handle dependency resolution, lockfiles, and virtual environment creation.
What are the basic commands to start a new python project with uv
uv init project-name — scaffold a new project with pyproject.toml
uv add requests — add a dependency
uv remove requests — remove a dependency
uv sync — install all deps from lockfile
uv run main.py — run a script in the managed environment
What are common uv commands when working on projects?
uv add --dev pytest — add a dev dependencyuv sync — install/update all deps from lockfile
uv run command — run any command in the project environment (without you needing to manually activate it.) not needed if venv already active
uv lock — regenerate the lockfile without installing
uv tree — show dependency tree
What's the difference between carrot and tilde in package versions
Caret (^2.31.0): Allows changes that don't modify the leftmost non-zero digit. ^2.31.0 → ≥2.31.0, <3.0.0. (Poetry's default)
Tilde (~=2.31.0): Allows only patch-level changes. ~=2.31.0 → ≥2.31.0, <2.32.0.
In short: Caret is more permissive (any minor/patch bump), tilde is stricter (patch bumps only).
Semantic Versioning (SemVer): MAJOR.MINOR.PATCH
MAJOR (2.x.x) — breaking/incompatible API changes
MINOR (x.31.x) — new features, backwards compatible
PATCH (x.x.5) — bug fixes, backwards compatible
Why should we use a new virtual environment for every project?
Dependency isolation — different projects may need different versions of the same package. Without separate envs, they conflict.
Reproducibility — each project has only its own dependencies, making it easy to generate accurate lockfiles and replicate the setup elsewhere.
Clean uninstall — delete the env and everything's gone. No leftover packages polluting other projects or the system Python.
What does scaffolding mean?
Scaffolding = the automatic generation of a basic project structure or boilerplate code to help you start development faster.
It typically creates things like:
folders and files
starter code
default configuration
basic CRUD pages or routes
What is the init.py file?
__init__.py marks a directory as a Python package so that python treats it as such, so Python can import modules from it.
It can also run package initialization code when the package is imported.