# Dependencies ### Adding dependencies ``` uv add $PACKAGE ``` For example, to set up a Jupyter environment: ``` uv add jupyter ``` Development packages: ``` uv add --dev pytest ``` Specific versions: ``` uv add "requests==2.31.0" ``` From a Git repo: ``` uv add git+https://github.com/psf/requests ``` From a `requirements.txt` file: ``` uv add -r requirements.txt -c constraints.txt ``` ### Removing dependencies ``` uv remove $PACKAGE ``` ### Update dependencies Upgrade all package versions in the lock file: ``` uv lock --upgrade ``` Upgrade a specific package version (and its transitive dependencies) in the lock file: ``` uv lock --upgrade-package $PACKAGE ``` Upgrade the lock file and then install the packages: ``` uv sync ``` Only install packages (if the lock file is up to date): ``` uv sync --lock ``` # Tool setup ``` uv tool install $PACKAGE ``` Ruff ``` uv tool install ruff ``` MyPy ``` uv tool install mypy ``` ### Running commands ``` uv run myscript.py ``` If you are using flask, run the server: ``` uv run -- flask run -p 3000 ``` Start working with a Jupyter notebook (after adding the dependency): ``` uv run jupyter notebook ``` # Building distributions By default, create a source package (.tar.gz) and a binary wheel (.whl): ``` uv build ``` Use `--wheel` or `--sdist` to only build either.