diff --git a/README.md b/README.md index a7bdec4..5950c44 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@
-hatch plugin to use pip-compile to manage project dependencies and lockfiles. +hatch plugin to use pip-compile (or uv) to manage project dependencies and lockfiles.
@@ -19,6 +19,7 @@
+
@@ -88,6 +89,7 @@ Set your environment type to `pip-compile` to use this plugin for the respective
- [pip-compile-constraint](docs/examples.md#pip-compile-constraint) - syncing dependency versions across environments
- [Upgrading Dependencies](docs/examples.md#upgrading-dependencies) - how to upgrade dependencies
- [Using Hashes](docs/examples.md#pip-compile-hashes) - how to include hashes in your lockfile
+- [Using uv instead of pip-compile](docs/examples.md#pip-compile-resolver) - how to use `uv` instead of `pip-compile`
### Configuration Options
@@ -110,15 +112,16 @@ pip-compile-hashes = true
| [lock-filename](docs/examples.md#lock-filename) | `str` | The filename of the ultimate lockfile. `default` env is `requirements.txt`, non-default is `requirements/requirements-{env_name}.txt` |
| [pip-compile-constraint](docs/examples.md#pip-compile-constraint) | `str` | An environment to use as a constraint file, ensuring that all shared dependencies are pinned to the same versions. |
| [pip-compile-hashes](docs/examples.md#pip-compile-hashes) | `bool` | Whether to generate hashes in the lockfile. Defaults to `false`. |
+| [pip-compile-resolver](docs/examples.md#pip-compile-resolver) | `str` | Whether to use `pip-compile` or `uv` to resolve dependencies into the project. Defaults to `pip-compile` |
+| [pip-compile-args](docs/examples.md#pip-compile-args) | `list[str]` | Additional command-line arguments to pass to `pip-compile-resolver` |
| [pip-compile-verbose](docs/examples.md#pip-compile-verbose) | `bool` | Set to `true` to run `pip-compile` in verbose mode instead of quiet mode, set to `false` to silence warnings |
-| [pip-compile-args](docs/examples.md#pip-compile-args) | `list[str]` | Additional command-line arguments to pass to `pip-compile` |
#### Installing Lockfiles
-| name | type | description |
-| --------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------- |
-| [pip-compile-installer](docs/examples.md#pip-compile-installer) | `str` | Whether to use `pip` or `pip-sync` to install dependencies into the project. Defaults to `pip` |
-| [pip-compile-install-args](docs/examples.md#pip-compile-install-args) | `list[str]` | Additional command-line arguments to pass to `pip-compile-installer` |
+| name | type | description |
+| --------------------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------- |
+| [pip-compile-installer](docs/examples.md#pip-compile-installer) | `str` | Whether to use `pip`, `pip-sync`, or `uv` to install dependencies into the project. Defaults to `pip` |
+| [pip-compile-install-args](docs/examples.md#pip-compile-install-args) | `list[str]` | Additional command-line arguments to pass to `pip-compile-installer` |
diff --git a/docs/examples.md b/docs/examples.md
index 674b758..09c8f92 100644
--- a/docs/examples.md
+++ b/docs/examples.md
@@ -131,9 +131,46 @@ Whether to generate hashes in the lockfile. Defaults to `false`.
pip-compile-hashes = true
```
+## pip-compile-resolver
+
+Which resolver to use to generate the lockfile. Defaults to `pip-compile`.
+
+[uv] is a drop in replacement for `pip-compile` with a much faster resolver written in rust.
+If you'd like to use `uv` instead of `pip-compile` you can set the `pip-compile-resolver` option.
+
+> NOTE: **pip-compile-installer**
+>
+> [uv] can also be used as the default installer instead of `pip`. See
+> the [pip-compile-installer](#pip-compile-installer) option for more
+> information.
+
+> WARNING: **uv**
+>
+> As of writing this the [uv] project
+> is brand new and still very actively being developed and may not be suitable for all
+> use cases. Known issues are currently options like `--exclude-unsafe` and how it handles
+> installing packages with hashes. The latest version of `uv` will be installed into your
+> environment when it's created.
+
+- **_pyproject.toml_**
+
+ ```toml
+ [tool.hatch.envs.