Interview Prep/Python for DevOps/Environments, dependencies & packaging

Why use the `src/` layout?

AdvancedConceptEnvironments, dependencies & packaging
Answer

With src/cloudaudit/ instead of cloudaudit/ at the repo root, the package is not importable just because you are in the repo directory. Tests therefore import the installed package, which catches packaging bugs (missing modules, missing package data, bad packages.find config) before you ship a broken wheel. It also prevents the accidental shadowing of installed packages by local folders.

All Python for DevOps questions Roadmap: Python for automation

More on Environments, dependencies & packaging