diff --git a/pages/common/uv-help.md b/pages/common/uv-help.md new file mode 100644 index 0000000000..85277d0b45 --- /dev/null +++ b/pages/common/uv-help.md @@ -0,0 +1,20 @@ +# uv help + +> Display detailed documentation for `uv` commands. +> More information: . + +- Display general help for `uv`: + +`uv help` + +- Display help for a specific command: + +`uv help {{command}}` + +- Display help for a subcommand: + +`uv help {{command}} {{subcommand}}` + +- Display help without using a pager: + +`uv help --no-pager {{command}}` diff --git a/pages/common/uv-lock.md b/pages/common/uv-lock.md new file mode 100644 index 0000000000..81f6d16505 --- /dev/null +++ b/pages/common/uv-lock.md @@ -0,0 +1,32 @@ +# uv lock + +> Update the project's lockfile. +> More information: . + +- Create or update the project's lockfile: + +`uv lock` + +- Check if the lockfile is up-to-date without updating it: + +`uv lock --check` + +- Assert that a lockfile exists without checking if it's current: + +`uv lock --check-exists` + +- Preview what would be locked without writing the lockfile: + +`uv lock --dry-run` + +- Lock a specific Python script instead of the current project: + +`uv lock --script {{path/to/script.py}}` + +- Upgrade all packages to their latest compatible versions: + +`uv lock --upgrade` + +- Upgrade only specific packages: + +`uv lock --upgrade-package {{package1}} --upgrade-package {{package2}}` diff --git a/pages/common/uv-pip.md b/pages/common/uv-pip.md new file mode 100644 index 0000000000..ab5f14e8b3 --- /dev/null +++ b/pages/common/uv-pip.md @@ -0,0 +1,36 @@ +# uv pip + +> Provides pip-like commands for installing, uninstalling, and managing packages. +> More information: . + +- Install a package: + +`uv pip install {{package}}` + +- Install packages from a requirements file: + +`uv pip install {{[-r|--requirements]}} {{requirements.txt}}` + +- Install a package with a specific version: + +`uv pip install {{package==1.2.3}}` + +- Uninstall a package: + +`uv pip uninstall {{package}}` + +- Save installed packages to file: + +`uv pip freeze > {{requirements.txt}}` + +- List installed packages: + +`uv pip list` + +- Show information about an installed package: + +`uv pip show {{package}}` + +- Sync environment with a requirements file (install/uninstall to match exactly): + +`uv pip sync {{requirements.txt}}` diff --git a/pages/common/uv-remove.md b/pages/common/uv-remove.md new file mode 100644 index 0000000000..5eb8be46f6 --- /dev/null +++ b/pages/common/uv-remove.md @@ -0,0 +1,28 @@ +# uv remove + +> Remove dependencies from the project's `pyproject.toml` file. +> More information: . + +- Remove a dependency from the project: + +`uv remove {{package}}` + +- Remove multiple dependencies: + +`uv remove {{package1}} {{package2}}` + +- Remove a development dependency: + +`uv remove --dev {{package}}` + +- Remove a dependency from an optional dependency group: + +`uv remove --optional {{extra_name}} {{package}}` + +- Remove a dependency from a specific dependency group: + +`uv remove --group {{group_name}} {{package}}` + +- Remove without syncing the virtual environment: + +`uv remove --no-sync {{package}}` diff --git a/pages/common/uv-run.md b/pages/common/uv-run.md new file mode 100644 index 0000000000..f48493a6d5 --- /dev/null +++ b/pages/common/uv-run.md @@ -0,0 +1,28 @@ +# uv run + +> Run a command or script in the project environment. +> More information: . + +- Run a Python script: + +`uv run {{script.py}}` + +- Run a Python module: + +`uv run {{[-m|--module]}} {{module_name}}` + +- Run a command with additional packages installed temporarily: + +`uv run --with {{package}} {{command}}` + +- Run a script with packages from a requirements file: + +`uv run --with-requirements {{requirements.txt}} {{script.py}}` + +- Run in an isolated environment (no project dependencies): + +`uv run --isolated {{script.py}}` + +- Run without syncing the environment first: + +`uv run --no-sync {{command}}` diff --git a/pages/common/uv-sync.md b/pages/common/uv-sync.md new file mode 100644 index 0000000000..6fde6c4d41 --- /dev/null +++ b/pages/common/uv-sync.md @@ -0,0 +1,36 @@ +# uv sync + +> Update the project's environment to match the lockfile. +> More information: . + +- Sync the project environment with the lockfile: + +`uv sync` + +- Sync and include all optional dependencies: + +`uv sync --all-extras` + +- Sync with specific optional dependencies: + +`uv sync --extra {{extra_name}}` + +- Sync only development dependencies: + +`uv sync --only-dev` + +- Sync excluding development dependencies: + +`uv sync --no-dev` + +- Sync specific dependency groups: + +`uv sync --group {{group_name}}` + +- Check if environment is already synchronized (no changes): + +`uv sync --check` + +- Preview what would be synced without making changes: + +`uv sync --dry-run` diff --git a/pages/common/uv-venv.md b/pages/common/uv-venv.md new file mode 100644 index 0000000000..9e3be6402d --- /dev/null +++ b/pages/common/uv-venv.md @@ -0,0 +1,24 @@ +# uv venv + +> Create an isolated Python environment for installing packages. +> More information: . + +- Create a virtual environment in the default location (`.venv`): + +`uv venv` + +- Create a virtual environment at a specific path: + +`uv venv {{path/to/venv}}` + +- Create using a specific Python version: + +`uv venv --python {{3.12}}` + +- Create with a custom prompt prefix: + +`uv venv --prompt {{my_project}}` + +- Create and allow overwriting existing environment: + +`uv venv --allow-existing {{venv_name}}` diff --git a/pages/common/uv-version.md b/pages/common/uv-version.md new file mode 100644 index 0000000000..5b8c64735b --- /dev/null +++ b/pages/common/uv-version.md @@ -0,0 +1,28 @@ +# uv version + +> Read or update a project's version. +> More information: . + +- Display the current project version: + +`uv version` + +- Set the project version to a specific value: + +`uv version {{1.2.3}}` + +- Bump the project version using semantic versioning: + +`uv version --bump {{major|minor|patch}}` + +- Preview version changes without writing to `pyproject.toml`: + +`uv version --bump {{patch}} --dry-run` + +- Update version for a specific package in a workspace: + +`uv version --package {{package_name}} {{1.2.3}}` + +- Display version in JSON format: + +`uv version --output-format json`