Commit Graph

165 Commits

Author SHA1 Message Date
Charlie Marsh 1fae8dbf17
Add Git SHA locking behavior to docs (#11125)
## Summary

Closes https://github.com/astral-sh/uv/issues/11090.
2025-01-31 12:11:04 -06:00
Zanie Blue e0a19be825
Touch-ups to the Python install guide (#11116) 2025-01-30 13:56:53 -06:00
konsti 80d485d32a
Explain build frontend vs. build backend (#11094)
We regularly get questions why `uv build` is missing certain files or
using the wrong build tag, when that's done by the build backend and
part of the build backend's docs. I tried to clarify this difference and
to redirect users to look at the tool's docs instead of wondering why
uv's docs don't explain that.

---------

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-01-30 19:48:47 +00:00
Zanie Blue 48976e12e8
Add docs for signal handling (#11041)
I'm not sure if this should go in the CLI reference or not? but here
seems like an okay start. I want to figure out a way to avoid repeating
this content.
2025-01-29 08:27:52 -06:00
Marco Barbosa c5ccea2bb1
doc typo: unnecessary backslashes to represent brackets in markdown (#11059)
There is a small typo in the doc which could mislead users: reference to
a table in `pyproject.toml` currently appears as
[`\[project.entry-points\]`](https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/#using-package-metadata)
while it should be
[`[project.entry-points]`](https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/#using-package-metadata).

Backslashes are appearing because they weren't supposed to be used on
code representation in Markdown.
2025-01-29 08:17:31 -06:00
Charlie Marsh 566f0d0abd
Add `Requires-Python` upper bound behavior to the docs (#10964)
## Summary

Closes https://github.com/astral-sh/uv/issues/10376.
2025-01-28 12:17:34 -05:00
Charlie Marsh 92b72c62ea
Amend `requires-python` rules in resolver documentation (#10993)
## Summary

Closes https://github.com/astral-sh/uv/issues/10967.
2025-01-28 12:17:27 -05:00
Zanie Blue 6e4845fffb
Add documentation for `uv add -r` (#10926)
Closes https://github.com/astral-sh/uv/issues/10924
2025-01-23 21:34:50 -06:00
Mathieu Kniewallner e3a09888ab
docs(git): add subdirectory example (#10894)
## Summary

Closes #10889.

As kinda hinted in the issue, would adding a `--subdirectory` flag to
`uv add` make sense? This would IMO be more discoverable.

## Test Plan

Ran the command added to the documentation:

```console
$ uv add git+https://github.com/langchain-ai/langchain#subdirectory=libs/langchain
Resolved 40 packages in 203ms
   Built langchain @ git+https://github.com/langchain-ai/langchain@f2ea62f63209130bfc56b1fe7d0fa7c299bbf352#subdirectory=libs/langchain
Prepared 19 packages in 837ms
Installed 37 packages in 14ms
[...]
```
2025-01-23 08:58:39 -05:00
Niklas Rosenstein 5ecfc3d900
Update docs on how to use `UV_PROJECT_ENVIRONMENT` to use the system python environment (#10817)
## Summary

The docs did mention that you could set the `UV_PROJECT_ENVIRONMENT`
variable to point Uv to use the system Python environment (e.g. for use
in CI or Docker), but it did not document _how_.

Reference:
https://github.com/astral-sh/uv/pull/6834#issuecomment-2319253359

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-01-21 18:40:01 +00:00
Se7en d5b98fb76c
fix: links in `configuring projects` doc (#10710)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

Fix invalid links in [configuring
projects](https://docs.astral.sh/uv/concepts/projects/config/#entry-points)
doc.

## Test Plan

<!-- How was it tested? -->
2025-01-17 12:39:56 -06:00
Mel Massadian 66e47345cb
docs(workspaces): remove build-system (#10636)
## Summary

Unless I'm doing something wrong, specifying `hatchling` as a build
system here results in `ValueError: Unable to determine which files to
ship`

## Test Plan

Following the instructions of the document.

## Additional

Don't hesitate to discard
2025-01-15 11:46:35 -06:00
FishAlchemist 201726cda5
docs: Clarify build system specific features usage. (#10261)
## Summary
Since there are occasional inquiries about how to configure UV for
build-system specific features, I want to raise awareness that users
should refer to the documentation of the build system they are using for
relevant settings.
## Test Plan
Run docs service in local.

9821d58d35

![image](https://github.com/user-attachments/assets/3c07ac15-a562-40e2-9289-204c0975261f)

---------

Signed-off-by: FishAlchemist <48265002+FishAlchemist@users.noreply.github.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-01-09 11:41:04 -06:00
Kevin Marchais a2a2662d43
Fix ruff linting warnings from generated template files for extension modules (#10371)
## Summary

This PR fixes two ruff linting issues in the generated template files
when using: `uv init --build-backend` for extension modules.

1. Removes unnecessary `from __future__ import annotations` imports from
generated .pyi files
([PYI044](https://docs.astral.sh/ruff/rules/future-annotations-in-stub/))
2. Adds missing blank line after `hello_from_bin` import to comply with
isort formatting
([I001](https://docs.astral.sh/ruff/rules/unsorted-imports/))

## Test Plan

```bash
cargo run -- init --build-backend scikit-build-core example-ext
uvx ruff check example-ext --select ALL

cargo run -- init --build-backend maturin example-ext
uvx ruff check example-ext --select ALL
```

## Remaining warnings

There are still warnings remainings in the generated `__init__.py`
files:
- [D104](https://docs.astral.sh/ruff/rules/undocumented-public-package/)
Missing docstring in public package
-
[D103](https://docs.astral.sh/ruff/rules/undocumented-public-function/)
Missing docstring in public function
- [T201](https://docs.astral.sh/ruff/rules/print/) `print` found
2025-01-07 17:07:44 +00:00
vladislav doster 523b88edf0
docs(tools.md): remove hyphenation for consistency (#10321) 2025-01-06 09:33:46 -05:00
vladislav doster 27bc8dd3dc
docs(python-versions.md): fix spelling (#10322)
## Summary

Correct misspelling of `interopability` to `interoperability`.

## Test Plan

N/A
2025-01-06 07:41:48 +00:00
Charlie Marsh 0b5c0220b5
Allow environment variables to be included in cache keys (#10170)
## Summary

Closes https://github.com/astral-sh/uv/issues/8130.
2024-12-26 15:31:49 +00:00
Mathieu Kniewallner b24fb774b1
docs: fix invalid syntax in some sources examples (#10127)
## Summary

TOML 1.0 doesn't support multi-line for inline tables, so those examples
are invalid.
2024-12-23 16:12:45 -05:00
Zanie Blue 8908e26de7
Add `uv python install --preview` to the documentation (#10010) 2024-12-19 16:07:46 -06:00
Steven L. bd03243dd5
Fix typo in Caching docs (#10032)
Fix typo in Caching docs

Co-authored-by: Steven Locorotondo <steven.locorotondo@justeattakeaway.com>
2024-12-19 12:15:32 -05:00
Zanie Blue d70160a57b
Update references to `python-build-standalone` to reflect the transferred project (#9977) 2024-12-17 20:19:58 +00:00
Matthew Lee 160fc37315
FIX: Dependency documentation with double quotes where required (#9946)
## Summary
Documentation steps resulted in errors due to single quotes when adding
project dependencies:

``` shell
>uv add 'httpx>0.1.0'

error: Failed to parse: `'httpx`
  Caused by: Expected package name starting with an alphanumeric character, found `'`
'httpx
^
```
``` shell
>uv add 'PyQt5; sys_platform == "windows" 
error: Failed to parse: `'PyQt5;`
  Caused by: Expected package name starting with an alphanumeric character, found `'`
'PyQt5;
^
```

## Testing Steps
- Follow new documentation steps

Tested on:
- [x] Windows
2024-12-16 17:39:04 -06:00
ReinforcedKnowledge 5a5429a5f0
Add a note to say that dependencies between workspace members are editable (#9363)
Just a small note to say that dependencies between workspace members are
editable as shown in #9362

(This might be obvious since if dependencies between workspaces members
are not editable then every time a workspace member is update it has to
be manually reinstalled but since it's in the concepts documentation and
since I see a lot of issues about workspaces, that little note might
help newcomers a little bit)
2024-12-16 12:36:24 -06:00
Charlie Marsh 7cdc1b2ec2
Document the `--fork-strategy` setting (#9887) 2024-12-13 21:35:20 +00:00
Zanie Blue 84285b69e6
Reframe `--locked` and `--frozen` as `--check` operations for `uv lock` (#9662)
Closes https://github.com/astral-sh/uv/issues/7639
2024-12-08 10:02:00 -06:00
Udi Oron a6f5180c27
docs: add a link to `uv python pin` docs (#9630)
The current docs are not clear for those who are not fimiliar with the
'pin' commnad. Adding a link instead of adding more instructions.
2024-12-04 11:11:04 -06:00
Zanie Blue 6cb3bf2b13
Add policies reference section and license document (#9367)
In preparation for adding more pages to the reference section

e.g., 
<img width="1427" alt="Screenshot 2024-11-27 at 1 19 10 PM"
src="https://github.com/user-attachments/assets/10079959-ee01-4c3f-b38e-7c2a7022dd9d">
2024-12-03 10:56:32 -06:00
Zanie Blue c3904a65c4
Mention `uv pip` behavior in build system note (#9586)
xref https://github.com/astral-sh/uv/issues/9518
2024-12-02 16:56:46 -06:00
Nathan McDougall 891e02d586
Add missing word to docs for run.md (#9527)
## Summary

I found this sentence didn't read quite right without this "the".

## Test Plan

No tests, docs-only change.
2024-11-29 21:58:20 -05:00
trag1c 9864d23f48
docs: correct wording for multiple sources section (#9504)
## Summary

Corrects calling tags "commits".

## Test Plan

N/A
2024-11-29 12:33:08 -05:00
Zanie Blue be651ed32d
Fix typo in entry point docs (#9491) 2024-11-28 02:48:52 +00:00
thirtysix aa688226aa
Fix `--refresh-package` flag mentioned as `--refresh-dependency` (#9486)
## Summary

This PR fixes name of `--refresh-package` flag in cache docs. It's
misspelled as `--refresh-dependency`.

## Test Plan

Deployed docs locally.
2024-11-27 17:14:01 -06:00
Zanie Blue 7df3ae2585
Add Python implementation example to limited resolution environments docs (#9475)
Closes https://github.com/astral-sh/uv/issues/9473
2024-11-27 09:53:39 -06:00
Zanie Blue 6afb34091c
Expand entry points documentation (#9329) 2024-11-27 09:53:07 -06:00
Zanie Blue 7a0a5a806d
Update the dependencies documentation (#9359)
This is a first-pass at updating the "Managing dependencies" page after
moving some of the project concept documentation into it. I want to do
more things, like improve visibility into upgrading packages and
reordering some sections, but will tackle those separately for review.

The primary goals here were to consolidate redundant information on
dependency tables and improve the consistency of examples.
2024-11-26 12:32:56 -06:00
Zanie Blue 82f96903ba
Fix header level of "Conflicting dependencies" page (#9330) 2024-11-21 11:44:22 -06:00
Zanie Blue 83c5eae1f3
Avoid referencing `scikit-build` (#9320)
It is different than `scikit-buid-core`
2024-11-21 08:42:47 -06:00
Zanie Blue d391961fa5
Touchup the extension module guide (#9293)
Co-authored-by: pantheraleo-7 <159872817+pantheraleo-7@users.noreply.github.com>
2024-11-21 14:24:21 +00:00
Jon Åslund 98c96b718f
Fix example pyproject.toml in project concept documentation (#9298)
The snippet out of context looks like a valid minimal pyproject.toml
which it is not without name and version. The line worked in layout.md
before when it was just under the minimal config.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-11-21 00:39:39 +00:00
Zanie Blue 110c38e549
Improve the project creation documentation (#9236) 2024-11-20 08:50:14 -06:00
Zanie Blue 20eccc157c
Improve content on project configuration (#9235) 2024-11-20 08:49:51 -06:00
Zanie Blue ca9aaf1c48
Reorganize the project concept documentation (#9121)
- Adds a collapsible section for the project concept
- Splits the project concept document into several child documents.
- Moves the workspace and dependencies documents to under the project
section
- Adds a mkdocs plugin for redirects, so links to the moved documents
still work

I attempted to make the minimum required changes to the contents of the
documents here. There is a lot of room for improvement on the content of
each new child document. For review purposes, I want to do that work
separately. I'd prefer if the review focused on this structure and idea
rather than the content of the files.

I expect to do this to other documentation pages that would otherwise be
very nested.

The project concept landing page and nav (collapsed by default) looks
like this now:

<img width="1507" alt="Screenshot 2024-11-14 at 11 28 45 AM"
src="https://github.com/user-attachments/assets/88288b09-8463-49d4-84ba-ee27144b62a5">
2024-11-19 13:52:12 -06:00
Charlie Marsh e4fc875afa
Allow conflicting extras in explicit index assignments (#9160)
## Summary

This PR enables something like the "final boss" of PyTorch setups --
explicit support for CPU vs. GPU-enabled variants via extras:

```toml
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.13.0"
dependencies = []

[project.optional-dependencies]
cpu = [
    "torch==2.5.1+cpu",
]
gpu = [
    "torch==2.5.1",
]

[tool.uv.sources]
torch = [
    { index = "torch-cpu", extra = "cpu" },
    { index = "torch-gpu", extra = "gpu" },
]

[[tool.uv.index]]
name = "torch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

[[tool.uv.index]]
name = "torch-gpu"
url = "https://download.pytorch.org/whl/cu124"
explicit = true

[tool.uv]
conflicts = [
    [
        { extra = "cpu" },
        { extra = "gpu" },
    ],
]
```

It builds atop the conflicting extras work to allow sources to be marked
as specific to a dedicated extra being enabled or disabled.

As part of this work, sources now have an `extra` field. If a source has
an `extra`, it means that the source is only applied to the requirement
when defined within that optional group. For example, `{ index =
"torch-cpu", extra = "cpu" }` above only applies to
`"torch==2.5.1+cpu"`.

The `extra` field does _not_ mean that the source is "enabled" when the
extra is activated. For example, this wouldn't work:

```toml
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.13.0"
dependencies = ["torch"]

[tool.uv.sources]
torch = [
    { index = "torch-cpu", extra = "cpu" },
    { index = "torch-gpu", extra = "gpu" },
]

[[tool.uv.index]]
name = "torch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

[[tool.uv.index]]
name = "torch-gpu"
url = "https://download.pytorch.org/whl/cu124"
explicit = true
```

In this case, the sources would effectively be ignored. Extras are
really confusing... but I think this is correct? We don't want enabling
or disabling extras to affect resolution information that's _outside_ of
the relevant optional group.
2024-11-19 01:06:25 +00:00
Andrew Gallant ed130b0c11
docs: add some words about specifying conflicting extras/groups (#9120)
This doesn't cover the optional `package` key since I wasn't quite sure
how to articulate its utility in a digestible way.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-11-14 13:50:18 -06:00
Kasper Zutterman f508ef038c
Fix reference to `--resolution` in docs (#8968)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
Update `resolution` to `--resolution`, so it's aligned with the rest of
the resolution documentation, and copy-pastable for usage.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-11-09 13:43:53 +00:00
Zanie Blue 9a04b7fbeb
Add project boundary note (#8900) 2024-11-07 15:49:14 -06:00
Zanie Blue daa929a96e Add docs for `.python-version` file discovery (#8898) 2024-11-07 14:29:54 -06:00
k_fukuchi 545a55f58f
Fix indentation in `projects.md` (#8772)
## Summary

Fix indentation in `projects.md`
2024-11-03 08:28:08 -06:00
Trevor Manz a90a8e7a61
Fix `add httpx` example with real git branch (#8756)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

The example in the docs for adding a git source with `--branch` fails
because `main` doesn't exist.

```sh
uv add git+https://github.com/encode/httpx --branch main
# error: Git operation failed
#   Caused by: failed to fetch into: /Users/manzt/.cache/uv/git-v0/db/4c0b1441d92956e1
#   Caused by: failed to fetch branch `main`
#   Caused by: process didn't exit successfully: `/usr/bin/git fetch --force --update-head-ok 'https://github.com/encode/httpx' '+refs/heads/main:refs/remotes/origin/main'` (exit status: 128)
```

This PR changes the example to the default branch for httpx, `master`.

<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

N/A

<!-- How was it tested? -->
2024-11-01 13:03:21 -04:00
Charlie Marsh 988ac749f4
Clarify `requires-python` requirement for dependencies (#8619)
## Summary

Closes https://github.com/astral-sh/uv/issues/8597.
2024-10-28 00:52:55 +00:00