From 9ba2bb7f96f81354ac9dc93aba603b9f5b07fb11 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 4 Aug 2024 21:37:16 -0400 Subject: [PATCH] Make some minor tweaks to the docs --- docs/concepts/dependencies.md | 36 ++++++++++++++++++++++--------- docs/first-steps.md | 2 -- docs/guides/install-python.md | 2 +- docs/guides/integration/github.md | 4 ++-- docs/guides/projects.md | 10 ++++++--- docs/guides/tools.md | 2 +- docs/index.md | 16 ++++++++------ docs/installation.md | 13 +++++------ 8 files changed, 54 insertions(+), 31 deletions(-) diff --git a/docs/concepts/dependencies.md b/docs/concepts/dependencies.md index 1fe2668005a6..0481e8d0d272 100644 --- a/docs/concepts/dependencies.md +++ b/docs/concepts/dependencies.md @@ -1,13 +1,29 @@ # Specifying dependencies -In uv, project dependency specification is divided between two `pyproject.toml` tables: -`project.dependencies` and `tool.uv.sources`. +In uv, project dependencies are declared across two `pyproject.toml` tables: `project.dependencies` +and `tool.uv.sources`. -`project.dependencies` is used to define the standards-compliant dependency metadata, propagated -when uploading to PyPI or building a wheel. `tool.uv.sources` is used to specify the _sources_ -required to install the dependencies, which can come from a Git repository, a URL, a local path, a -different index, etc. This metadata must be expressed separately because the `project.dependencies` -standard does not allow these common patterns. +`project.dependencies` defines the standards-compliant dependency metadata, propagated when +uploading to PyPI or building a wheel. + +`tool.uv.sources` enriches the dependency metadata with additional sources, incorporated during +development. A dependency source can be a Git repository, a URL, a local path, or an alternative +registry. + +`tool.uv.sources` enables uv to support common patterns like editable installations and relative +paths that are not supported by the `project.dependencies` standard. For example: + +```toml title="pyproject.toml" +[project] +name = "albatross" +version = "0.1.0" +dependencies = [ + "bird-feeder", +] + +[tool.uv.sources] +bird-feeder = { path = "/path/to/bird-feeder" } +``` ## Project dependencies @@ -40,12 +56,12 @@ dependencies = [ ``` If the project only requires packages from standard package indexes, then `project.dependencies` is -sufficient. If, the project depends on packages from Git, remote URLs, or local sources, -`tool.uv.sources` is needed. +sufficient. If the project depends on packages from Git, remote URLs, or local sources, +`tool.uv.sources` can be used to enrich the dependency metadata. ## Dependency sources -During development, the project may rely on a package that isn't available on PyPI. The following +During development, a project may rely on a package that isn't available on PyPI. The following additional sources are supported by uv: - Git: A Git repository. diff --git a/docs/first-steps.md b/docs/first-steps.md index ef13bf4787f7..2a7cf696558e 100644 --- a/docs/first-steps.md +++ b/docs/first-steps.md @@ -1,7 +1,5 @@ # First steps with uv -uv only provides a command-line interface and must be used from a terminal. - After [installing uv](./installation.md), you can check that uv is available by running the `uv` command: diff --git a/docs/guides/install-python.md b/docs/guides/install-python.md index 639cec2cb47c..2849722e0c75 100644 --- a/docs/guides/install-python.md +++ b/docs/guides/install-python.md @@ -23,7 +23,7 @@ system. If you've previously installed Python with uv, a new version will not be !!! note - Python does not publish official distributable binaries so uv uses third-party distributions from the [`python-build-standalone`](https://github.com/indygreg/python-build-standalone) project. The project is partially maintained by the uv maintainers and is used by many other Python projects. See the [Python distributions](../concepts/python-versions.md#python-distributions) documentation for more details. + Python does not publish official distributable binaries. As such, uv uses third-party distributions from the [`python-build-standalone`](https://github.com/indygreg/python-build-standalone) project. The project is partially maintained by the uv maintainers and is used by other prominent Python projects (e.g., [Rye](https://github.com/astral-sh/rye), [Bazel](https://github.com/bazelbuild/rules_python)). See the [Python distributions](../concepts/python-versions.md#python-distributions) documentation for more details.