Interview Prep/Python for DevOps/Environments, imports & packaging errors

`ruff` passes locally but fails in CI with different rules or versions.

BeginnerTroubleshootingEnvironments, imports & packaging errors
Answer

Likely causes → Different ruff versions (new rules or changed defaults), or config not picked up in CI (running from another directory).

Diagnose →

ruff --version
ruff check --show-settings src/cloudaudit/cli.py | grep -i "select\|target"

Fix → Pin ruff in dev deps and in the pre-commit config (same version), and set select explicitly in [tool.ruff.lint] rather than relying on defaults.

Prevent → One pinned tool version used by pre-commit, local and CI.

All Python for DevOps questions Roadmap: Python for automation

More on Environments, imports & packaging errors