python_add_uv()

def python_add_uv(name, uv_version, ruff_version, python_version, venv_name, packages, visibility)

Add Python to your sysroot.

This sets up the workspace to use the spaces store to cache uv python installations. It sets VIRTUAL_ENV and UV_PROJECT_ENVIRONMENT to the workspace venv directory which is created by a setup rule created with this function.

Args

  • name: string: The name of the rule.
  • uv_version: string: uv version from //@packages/star/github.com/astral-sh/uv
  • ruff_version: string: ruff version from //@packages/star/github.com/astral-sh/ruff
  • python_version: string: The version of Python to install
  • venv_name: string: the folder name for where to store the virtual environment
  • packages: list: The Python packages to install
  • visibility: Rule visibility. See visibility.star for more info.