Skip to content
Adding and removing packages

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"    # range

Dev dependencies

bunpy add -D pytest black mypy

Adds to [dependency-groups] dev:

[dependency-groups]
dev = ["pytest>=8.0", "black>=24.0", "mypy>=1.0"]

Optional extras

bunpy add --extra web fastapi uvicorn

Adds 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 pytest

Leaves the package in [project] dependencies if present; only removes it from the dev lane.

Dry run

bunpy remove --no-install requests

Updates pyproject.toml and bunpy.lock but does not delete files from site-packages. Useful for scripting.