Dependencies, lockfiles & environments
P35.build-publish.01 · Audience: Guest, IT/ML learner, Language professional · Prerequisites: Project layout & pyproject
Where next?
Later in Dependencies, Builds & Publishing
This module unlocks
P35.build-publish.01 · Audience: Guest, IT/ML learner, Language professional · Prerequisites: Project layout & pyproject
Later in Dependencies, Builds & Publishing
This module unlocks
Your pyproject.toml asks for click>=8.1 — a range. A lockfile answers it
with an exact version for every package, direct and transitive. That gap between
"what I asked for" and "what got installed" is where reproducibility lives (and
where builds silently drift). This module builds the check that connects the two.
click>=8.1 means "click, at least 8.1". Versions are major.minor.patch, and comparing them field by field is how you decide whether a version satisfies a constraint. Normalise short versions first — 8.1 is (8, 1, 0) — so a plain tuple comparison does the right thing.Why it matters — A constraint like >=8.1 is a bet on SemVer — that a compatible release won't break you — so evaluating one correctly is the basis of dependency resolution.
Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.
Off by default. The mentor always gets your file; this only decides whether your own copy stays here. Copies live in this browser only - they do not follow you to another device, and clearing site data removes them.
Build a version-constraint checker from scratch, then use it to prove a lockfile satisfies a project's constraints.
Loading exercise…
Loading exercise…
You can declare and pin dependencies. Next: what a build actually produces — the wheel and sdist artifacts a registry expects.
Loading your notes...