From ef2ee5eaacbcfa3a15b18a6a2f527692b9536400 Mon Sep 17 00:00:00 2001 From: Pranav Mangal Date: Thu, 22 Aug 2024 03:34:10 +0530 Subject: [PATCH] uv, uv-{python,tool}: add page (#13491) Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com> Co-authored-by: spageektti --- pages/common/uv-python.md | 28 ++++++++++++++++++++++++++++ pages/common/uv-tool.md | 24 ++++++++++++++++++++++++ pages/common/uv.md | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 pages/common/uv-python.md create mode 100644 pages/common/uv-tool.md create mode 100644 pages/common/uv.md diff --git a/pages/common/uv-python.md b/pages/common/uv-python.md new file mode 100644 index 0000000000..9ce2a4c007 --- /dev/null +++ b/pages/common/uv-python.md @@ -0,0 +1,28 @@ +# uv python + +> Manage Python versions and installations. +> More information: . + +- List all available Python installations: + +`uv python list` + +- Install a Python version: + +`uv python install {{version}}` + +- Uninstall a Python version: + +`uv python uninstall {{version}}` + +- Search for a Python installation: + +`uv python find {{version}}` + +- Pin the current project to use a specific Python version: + +`uv python pin {{version}}` + +- Show the `uv` Python installation directory: + +`uv python dir` diff --git a/pages/common/uv-tool.md b/pages/common/uv-tool.md new file mode 100644 index 0000000000..535bf0aa88 --- /dev/null +++ b/pages/common/uv-tool.md @@ -0,0 +1,24 @@ +# uv tool + +> Install and run commands provided by Python packages. +> More information: . + +- Run a command from a package, without installing it: + +`uv tool run {{command}}` + +- Install a Python package system-wide: + +`uv tool install {{package}}` + +- Upgrade an installed Python package: + +`uv tool upgrade {{package}}` + +- Uninstall a Python package: + +`uv tool uninstall {{package}}` + +- List Python packages installed system-wide: + +`uv tool list` diff --git a/pages/common/uv.md b/pages/common/uv.md new file mode 100644 index 0000000000..d2a4375930 --- /dev/null +++ b/pages/common/uv.md @@ -0,0 +1,37 @@ +# uv + +> A fast Python package and project manager. +> Some subcommands such as `uv tool` and `uv python` have their own usage documentation. +> More information: . + +- Create a new Python project in the current directory: + +`uv init` + +- Create a new Python project in a directory with the given name: + +`uv init {{project_name}}` + +- Add a new package to the project: + +`uv add {{package}}` + +- Remove a package from the project: + +`uv remove {{package}}` + +- Run a script in the project's environment: + +`uv run {{path/to/script.py}}` + +- Run a command in the project's environment: + +`uv run {{command}}` + +- Update a project's environment from `pyproject.toml`: + +`uv sync` + +- Create a lock file for the project's dependencies: + +`uv lock`