-
Notifications
You must be signed in to change notification settings - Fork 761
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,606 additions
and
191 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
book |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Summary | ||
|
||
- [Introduction](introduction.md) | ||
|
||
# Getting started | ||
|
||
- [Installing uv](installation.md) | ||
- [Python environments](pip/environments.md) | ||
- [Managing packages](pip/packages.md) | ||
- [Inspecting environments](pip/inspection.md) | ||
- [Locking environments](pip/compile.md) | ||
|
||
# Configuration | ||
|
||
- [Configuration files](configuration/files.md) | ||
- [Environment variables](configuration/environment.md) | ||
- [Authentication](configuration/authentication.md) | ||
|
||
# Advanced usage | ||
|
||
- [Python discovery](python/discovery.md) | ||
- [Resolution](resolution.md) | ||
- [Caching](cache.md) | ||
|
||
# Integration guides | ||
|
||
- [Using in Docker](guides/docker.md) | ||
- [Using in GitHub Actions](guides/github.md) | ||
- [Using with pre-commit](guides/pre-commit.md) | ||
|
||
# Preview features | ||
|
||
- [Introduction](preview/introduction.md) | ||
- [Projects](preview/projects.md) | ||
- [Dependency specification](preview/dependencies.md) | ||
- [Workspaces](preview/workspaces.md) | ||
- [Command-line tools](preview/tools.md) | ||
- [Python toolchains](preview/toolchains.md) | ||
|
||
# Policies | ||
|
||
- [Versioning](versioning.md) | ||
- [Platform support](platforms.md) | ||
- [Compatibility with pip](pip/compatibility.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[book] | ||
language = "en" | ||
multilingual = false | ||
src = "." | ||
title = "uv" | ||
|
||
[output.html] | ||
no-section-label = true | ||
additional-css = ["style.css"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Configuration files | ||
|
||
uv supports persistent configuration files at both the project- and user-level. | ||
|
||
Specifically, uv will search for a `pyproject.toml` or `uv.toml` file in the current directory, or | ||
in the nearest parent directory. | ||
|
||
If a `pyproject.toml` file is found, uv will read configuration from the `[tool.uv.pip]` table. | ||
For example, to set a persistent index URL, add the following to a `pyproject.toml`: | ||
|
||
```toml | ||
[tool.uv.pip] | ||
index-url = "https://test.pypi.org/simple" | ||
``` | ||
|
||
(If there is no such table, the `pyproject.toml` file will be ignored, and uv will continue searching in | ||
the directory hierarchy.) | ||
|
||
If a `uv.toml` file is found, uv will read from the `[pip]` table. For example: | ||
|
||
```toml | ||
[pip] | ||
index-url = "https://test.pypi.org/simple" | ||
``` | ||
|
||
uv will also discover user-level configuration at `~/.config/uv/uv.toml` (or | ||
`$XDG_CONFIG_HOME/uv/uv.toml`) on macOS and Linux, or `%APPDATA%\uv\uv.toml` on Windows. User-level | ||
configuration must use the `uv.toml` format, rather than the `pyproject.toml` format, as a | ||
`pyproject.toml` is intended to define a Python _project_. | ||
|
||
If both project- and user-level configuration are found, the settings will be merged, with the | ||
project-level configuration taking precedence. Specifically, if a string, number, or boolean is | ||
present in both tables, the project-level value will be used, and the user-level value will be | ||
ignored. If an array is present in both tables, the arrays will be concatenated, with the | ||
project-level settings appearing earlier in the merged array. | ||
|
||
Settings provided via environment variables take precedence over persistent configuration, and | ||
settings provided via the command line take precedence over both. | ||
|
||
uv accepts a `--isolated` command-line argument which, when provided, disables the discovery of any | ||
persistent configuration. | ||
|
||
uv also accepts a `--config-file` command-line argument, which accepts a path to a `uv.toml` to use | ||
as the configuration file. When provided, this file will be used in place of _any_ discovered | ||
configuration files (e.g., user-level configuration will be ignored). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Using uv in pre-commit | ||
|
||
An official pre-commit hook is provided at [`astral-sh/uv-pre-commit`](https://github.com/astral-sh/uv-pre-commit). | ||
|
||
To compile requirements via pre-commit, add the following to the `.pre-commit-config.yaml`: | ||
|
||
```yaml | ||
- repo: https://github.com/astral-sh/uv-pre-commit | ||
# uv version. | ||
rev: 0.2.13 | ||
hooks: | ||
# Compile requirements | ||
- id: pip-compile | ||
args: [requirements.in, -o, requirements.txt] | ||
``` | ||
To compile alternative files, modify `args` and `files`: | ||
|
||
```yaml | ||
- repo: https://github.com/astral-sh/uv-pre-commit | ||
# uv version. | ||
rev: 0.2.13 | ||
hooks: | ||
# Compile requirements | ||
- id: pip-compile | ||
args: [requirements-dev.in, -o, requirements-dev.txt] | ||
files: ^requirements-dev\.(in|txt)$ | ||
``` | ||
|
||
To run the hook over multiple files at the same time: | ||
|
||
```yaml | ||
- repo: https://github.com/astral-sh/uv-pre-commit | ||
# uv version. | ||
rev: 0.2.13 | ||
hooks: | ||
# Compile requirements | ||
- id: pip-compile | ||
name: pip-compile requirements.in | ||
args: [requirements.in, -o, requirements.txt] | ||
- id: pip-compile | ||
name: pip-compile requirements-dev.in | ||
args: [requirements-dev.in, -o, requirements-dev.txt] | ||
files: ^requirements-dev\.(in|txt)$ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.