add
Usage
pensa add <package>
pensa add <package>@<constraint>
pensa add <package> -G <group>Description
Adds a dependency to pyproject.toml, resolves it, updates the lock file, and installs it.
Examples
pensa add requests
pensa add httpx@^0.27
pensa add "requests[security]"
pensa add pytest -G devFlags
| Flag | Description |
|---|---|
-G, --group | Add to a dependency group (e.g., dev, test) |
Behavior
- Queries PyPI for the latest version matching the constraint (or latest stable if none given)
- Adds the dependency to
[project.dependencies](or[dependency-groups]with-G) - Resolves all dependencies together
- Writes the lock file
- Installs the new package into the virtual environment