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

What are optional dependencies (extras)?

IntermediateConceptEnvironments, dependencies & packaging
Answer

Named groups of extra dependencies declared in [project.optional-dependencies], installed with pip install "pkg[extra]". We use dev for test and lint tools, and feature extras like moto[ec2,s3] or requests[socks] pull in only what a feature needs. Quote the argument in shells like zsh, where [ is a glob character (zsh: no matches found: .[dev]).

All Python for DevOps questions Roadmap: Python for automation

More on Environments, dependencies & packaging