Python for Software Engineers
Back to Modern Python Foundations

Project Structure & Packaging

Modern Python projects: src layout, pyproject.toml, uv. The 2026 way to organize code that ships. FIND_VIDEO: search 'python project structure pyproject toml uv' — recommended channel: ArjanCodes / mCoding. Aim for 10 min or under.

20 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. UV Overview & Value Proposition — UV is introduced as a fast Rust-based replacement for pip, venv, and pip-tools.
  2. Installing and Verifying UV — Installation options are demonstrated across package managers and verified using the CLI base command.
  3. Traditional Pip and Venv Workflow — The legacy multi-step workflow involving manual environment creation, activation, and requirements freezing is reviewed.
  4. Project Initialization with uv init — The uv init command is used to scaffold a new project workspace with application and library options.
  5. Analyzing UV Project Structure — Generated project assets are inspected, including Git tracking, .python-version, and pyproject.toml.
  6. Dependency Management and Locking — Dependencies are added using uv add, triggering automated virtual environment creation and lockfile generation.
PDF notes

Frequently asked questions

Do I still need to run source .venv/bin/activate when using UV?

No. UV automatically detects and executes within the local project .venv directory when running project-aware commands.

What is the primary difference between pyproject.toml and uv.lock?

pyproject.toml defines direct dependencies and broad constraints, while uv.lock pins the exact versions and hashes of all transitive dependencies.

Can I initialize a project with UV inside an existing directory?

Yes. Running uv init inside an existing folder generates the necessary metadata files directly in place without nesting directories.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.