Adding and removing packages
bunpy add
bunpy add [flags] <package[@version]>...Adds packages to pyproject.toml and installs them. See
bunpy add CLI reference.
Version specifiers
bunpy add requests # latest compatible
bunpy add "requests>=2.28" # minimum version
bunpy add requests==2.31.0 # exact pin
bunpy add "requests>=2,<3" # rangeDev dependencies
bunpy add -D pytest black mypyAdds to [dependency-groups] dev:
[dependency-groups]
dev = ["pytest>=8.0", "black>=24.0", "mypy>=1.0"]Optional extras
bunpy add --extra web fastapi uvicornAdds to [project.optional-dependencies] web.
bunpy remove
bunpy remove [flags] <package>...Removes packages from pyproject.toml, re-locks, and uninstalls from
.bunpy/site-packages/. See
bunpy remove CLI reference.
Remove from dev only
bunpy remove -D pytestLeaves the package in [project] dependencies if present; only removes it
from the dev lane.
Dry run
bunpy remove --no-install requestsUpdates pyproject.toml and bunpy.lock but does not delete files from
site-packages. Useful for scripting.