Commit Graph

51 Commits

Author SHA1 Message Date
Zanie Blue 1f963d1b89
Move content from the `mkdocs.public.yml` into the template (#11246)
Closes https://github.com/astral-sh/uv/issues/11242
2025-02-05 16:13:46 +00:00
Zanie Blue 71f0798536
Add a troubleshooting section and reproducible example guide (#10947)
Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
2025-01-27 13:29:23 -06:00
Charlie Marsh 4c0922ee1b
Add AWS Lambda integration guide (#10278)
## Summary

This includes instructions to:

- Deploy a standalone application.
- Deploy an application that depends on local libraries (a workspace).
- Deploy via Docker.
- Deploy via zip.

There's an accompanying Git repository here:
https://github.com/astral-sh/uv-aws-lambda-example.

Closes https://github.com/astral-sh/uv/issues/8935.
2025-01-07 13:50:31 -05: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 8b02d7191d
Update build failures document (#9584)
In preparation for a dedicated "Troubleshooting" section, revitalizes
the "Build failures" reference by adding more details, examples, and
structure. This will be used as a model for a "Install failures"
document.
2024-12-03 15:27:50 +00:00
Zanie Blue 4f65a69ebf
Move the integration guides into the "Guides" section as a collapsed group (#9245)
Let's have all the guides together!
2024-11-20 08:50:02 -06:00
Zanie Blue 78df14e7a8
Add support for anchor redirects with client-side js (#9212)
The redirect plugin doesn't support this, and it's not feasible to do
server-side so we need to do the redirect client-side with some
javascript.
2024-11-19 22:32:43 -06:00
Zanie Blue 2ff705fba0
Add breadcrumbs to the documentation (#9242)
<img width="815" alt="Screenshot 2024-11-19 at 2 10 10 PM"
src="https://github.com/user-attachments/assets/49e645d2-1648-40b4-8bb4-ba5d6545a353">
<img width="815" alt="Screenshot 2024-11-19 at 2 10 25 PM"
src="https://github.com/user-attachments/assets/854d7bee-dc16-4429-ae11-789f50d1c6a4">
2024-11-19 22:31:43 -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
Yoni Chechik 4f6db1d8f9
remove duplicated `PyTorch` entry (#9220) 2024-11-19 12:43:31 +01:00
Charlie Marsh dea2a040f0
Add documentation for using uv with PyTorch (#9210)
## Summary

Now that we have all the pieces in place, this PR adds some dedicated
documentation to enable a variety of PyTorch setups.

This PR is downstream of #6523 and builds on the content in there; #6523
will merge first, and this PR will follow.
2024-11-19 01:09:52 +00:00
baggiponte a88a3e5eba
docs: Add PyTorch installation guide (#6523)
Hello there! First real docs PR for uv.

1. I expect this will be rewritten a gazillion times to have a
consistent tone with the rest of the docs, despite me trying to stick to
it as best as I could. Feel free to edit!
2. I went super on the verbose mode, while also providing a callout with
a TLDR on top. Scrap anything you feel it's redundant!
3. I placed the guide under `integrations` since Charlie added the
FastAPI integration there.

## Summary

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

## Test Plan

<!-- How was it tested? -->
I just looked at the docs on the dev server of mkdocs if it looked nice.

**I could not test the commands that I wrote work** outside of macOS. If
someone among contributors has a Windows/Linux laptop, it should be
enough, even for the GPU-supported versions: I expect the installation
will just break once torch checks for CUDA (perhaps even at runtime).

---------

Co-authored-by: Santiago Castro <bryant1410@gmail.com>
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-11-18 20:02:55 -05:00
Zanie Blue ec71fb1f75
Move the installation configuration docs to a separate page (#8546) 2024-10-24 16:04:21 -05:00
konsti 614013ed58
Add help page for build failures (#8286) 2024-10-22 13:35:54 +02:00
Charlie Marsh 5b391770df
Add support for named and explicit indexes (#7481)
## Summary

This PR adds a first-class API for defining registry indexes, beyond our
existing `--index-url` and `--extra-index-url` setup.

Specifically, you now define indexes like so in a `uv.toml` or
`pyproject.toml` file:

```toml
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
```

You can also provide indexes via `--index` and `UV_INDEX`, and override
the default index with `--default-index` and `UV_DEFAULT_INDEX`.

### Index priority

Indexes are prioritized in the order in which they're defined, such that
the first-defined index has highest priority.

Indexes are also inherited from parent configuration (e.g., the
user-level `uv.toml`), but are placed after any indexes in the current
project, matching our semantics for other array-based configuration
values.

You can mix `--index` and `--default-index` with the legacy
`--index-url` and `--extra-index-url` settings; the latter two are
merely treated as unnamed `[[tool.uv.index]]` entries.

### Index pinning

If an index includes a name (which is optional), it can then be
referenced via `tool.uv.sources`:

```toml
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"

[tool.uv.sources]
torch = { index = "pytorch" }
```

If an index is marked as `explicit = true`, it can _only_ be used via
such references, and will never be searched implicitly:

```toml
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
explicit = true

[tool.uv.sources]
torch = { index = "pytorch" }
```

Indexes defined outside of the current project (e.g., in the user-level
`uv.toml`) can _not_ be explicitly selected.

(As of now, we only support using a single index for a given
`tool.uv.sources` definition.)

### Default index

By default, we include PyPI as the default index. This remains true even
if the user defines a `[[tool.uv.index]]` -- PyPI is still used as a
fallback. You can mark an index as `default = true` to (1) disable the
use of PyPI, and (2) bump it to the bottom of the prioritized list, such
that it's used only if a package does not exist on a prior index:

```toml
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
default = true
```

### Name reuse

If a name is reused, the higher-priority index with that name is used,
while the lower-priority indexes are ignored entirely.

For example, given:

```toml
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"

[[tool.uv.index]]
name = "pytorch"
url = "https://test.pypi.org/simple"
```

The `https://test.pypi.org/simple` index would be ignored entirely,
since it's lower-priority than `https://download.pytorch.org/whl/cu121`
but shares the same name.

Closes #171.

## Future work

- Users should be able to provide authentication for named indexes via
environment variables.
- `uv add` should automatically write `--index` entries to the
`pyproject.toml` file.
- Users should be able to provide multiple indexes for a given package,
stratified by platform:
```toml
[tool.uv.sources]
torch = [
  { index = "cpu", markers = "sys_platform == 'darwin'" },
  { index = "gpu", markers = "sys_platform != 'darwin'" },
]
```
- Users should be able to specify a proxy URL for a given index, to
avoid writing user-specific URLs to a lockfile:
```toml
[[tool.uv.index]]
name = "test"
url = "https://private.org/simple"
proxy = "http://<omitted>/pypi/simple"
```
2024-10-15 18:24:23 -04:00
Jonas Vacek 267dda995b
GitLab Integration documentation (#6857)
<!--
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
Documentation for GitLab integration, reliant on the new tags introduced
in https://github.com/astral-sh/uv/pull/6053

## Test Plan

<!-- How was it tested? -->

---------

Co-authored-by: David Fritzsche <9479371+davidfritzsche@users.noreply.github.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-10-01 18:34:49 +00:00
Zanie Blue 5e64dac75f
Remove the typeset plugin (#7721)
Ref 

- https://github.com/astral-sh/ruff/pull/13517
- https://github.com/squidfunk/mkdocs-material/issues/7567
2024-09-26 13:51:45 -05:00
Charlie Marsh 4ba0e56754
Document uv-with-Jupyter workflows (#7625)
## Summary

This is a work-in-progress as I actually want to change some behaviors
here.

Closes https://github.com/astral-sh/uv/issues/6329.
2024-09-26 00:55:02 +00:00
Charlie Marsh 8efd38c7a9
Use anchorlinks rather than permalinks (#7626)
## Summary

Unfortunately, the permalinks show up in the SERPs as part of the title:

![Screenshot 2024-09-22 at 3 08
54 PM](https://github.com/user-attachments/assets/6914af46-35bd-4d53-8a57-fbba21a0f7e9)

Instead, we'll just make the headers themselves links.

Before:
![Screenshot 2024-09-22 at 3 08
03 PM](https://github.com/user-attachments/assets/9e354fca-d319-4779-b38a-05daee530608)
![Screenshot 2024-09-22 at 3 08
06 PM](https://github.com/user-attachments/assets/954af6b5-35cd-4519-815f-24555b6ba086)

After:

![Screenshot 2024-09-22 at 3 08
19 PM](https://github.com/user-attachments/assets/90c84012-778d-440d-9028-2b40d86ad53c)
![Screenshot 2024-09-22 at 3 08
17 PM](https://github.com/user-attachments/assets/8add8f41-4030-4bbf-9acd-e6027e3f6cda)

I prefer what we had before visually, but the SEO hit is bad enough that
I want to change it.
2024-09-22 19:35:45 -04:00
Charlie Marsh 92e93da81d
Add `static` assets to docs pages (#6951)
## Summary

This PR points the docs towards the static assets that we use for
`astral.sh`, so that we can use shared assets for the Ruff and uv docs.
2024-09-02 20:00:30 -04:00
João Paulo Euko bb52997ac4
Remove duplicate code from `mkdocs` template file (#6757)
This PR remove a duplicated code from `mkdocs` template

Fix: #6756
2024-08-28 11:31:30 -04:00
Zanie Blue f96b4c7837
Add dependabot and renovate documentation page (#6236)
cc @mkniewallner

---------

Co-authored-by: Mathieu Kniewallner <mathieu.kniewallner@gmail.com>
2024-08-28 07:41:23 -05:00
Charlie Marsh 1cd80139af
Add a guide for using uv with FastAPI (#6401) 2024-08-23 02:09:46 +00:00
Zanie Blue 7742e060d2
Add link to benchmarks in documentation (#6257) 2024-08-20 12:54:46 -04:00
Zanie Blue ded7300455
Disable collapsible navigation in the documentation (#5674)
Removes the collapsible sections in favor of larger font navigation
headings. I found the bold to be too distracting from the content itself
— it might be okay in the future if the navigation bar is further left.

Before:

<img width="1356" alt="Screenshot 2024-08-16 at 6 03 57 PM"
src="https://github.com/user-attachments/assets/75e49216-dc0d-4d26-a0d8-0283c29f9b81">

After:

<img width="1324" alt="Screenshot 2024-08-16 at 6 05 36 PM"
src="https://github.com/user-attachments/assets/cbce96ce-0969-46c5-80b6-e163481b8bfa">

(No change to the mobile view)

<img width="823" alt="Screenshot 2024-08-16 at 6 05 03 PM"
src="https://github.com/user-attachments/assets/b450e413-d5a4-4d2d-9905-e8eb6ac6f546">
<img width="823" alt="Screenshot 2024-08-16 at 6 05 13 PM"
src="https://github.com/user-attachments/assets/bd251ea0-58d8-456e-bdc8-4e3699061e6c">
2024-08-16 18:09:21 -05:00
Zanie Blue f28ce546cf
Move anchors validation to only the public mkdocs config (#6099)
See https://github.com/astral-sh/uv/pull/6096#issuecomment-2290151150
2024-08-14 19:37:25 -05:00
Mathieu Kniewallner 85be33d719
docs: use stricter validation options (#6096)
## Summary

`mkdocs` supports [validation rules for
links](https://www.mkdocs.org/user-guide/configuration/#validation),
which can be tightened to report more issues than the default
configuration. I used the recommended "maximal strictness" configuration
from the documentation.

Adding the `anchors` rule helped spot 4 errors:
```console
WARNING -  Doc file 'guides/install-python.md' contains a link '../concepts/python-versions.md#python-distributions', but the doc 'concepts/python-versions.md' does not contain an anchor '#python-distributions'.
WARNING -  Doc file 'guides/install-python.md' contains a link '../concepts/python-versions.md#discovery-order', but the doc 'concepts/python-versions.md' does not contain an anchor '#discovery-order'.
WARNING -  Doc file 'guides/projects.md' contains a link '../concepts/projects.md#lock-file', but the doc 'concepts/projects.md' does not contain an anchor '#lock-file'.
WARNING -  Doc file 'pip/environments.md' contains a link '../concepts/python-versions.md#discovery-order', but the doc 'concepts/python-versions.md' does not contain an anchor '#discovery-order'.
```

## Test Plan

Local run of the documentation + `mkdocs build --strict`.
2024-08-14 19:27:22 -05:00
Zanie Blue d20314038f
Move help documentation into dedicated page (#6057) 2024-08-13 11:09:32 -05:00
Zanie Blue db0b44b88c
Move some documents to relevant sections (#5968) 2024-08-09 17:31:10 +00:00
Zanie Blue f08cd2b9dc
Add a guide for publishing packages (#5794)
Closes https://github.com/astral-sh/uv/issues/5793
2024-08-05 16:12:37 -05:00
Zanie Blue 865f9eeef7
Collapse policies section into reference (#5696) 2024-08-05 17:44:26 +00:00
konsti 6e310f2702
Rewrite resolver docs (#5723)
This PR rewrites the resolver concept and adds a resolver internals page
targeted at power users.

The new resolution concept documentation has three parts:
* An introduction for people how never heard of "resolution" before, and
a motivating example what it does. I've also shoved the part about
equally valid resolutions in there.
* Features you commonly use: Non-universal vs. universal resolution,
lowest resolution amd pre-releases.
* Expert features, we don't advertise them, you'll only need them in
complex cases when you already know and i kept them to the reference
points you need in this case: Constraints, overrides and exclude-newer.

I intentionally didn't lay out any detail of the resolution itself, the
idea is that users get a vague sense of "uv has to select fitting
versions", but then they learn the options they have to use and some
common failure points without ever coming near SAT or even graphs.

The resolution internals reference page is targeted at power users who
need to understand what is going on behind the scenes. It assumes ample
prior knowledge and exists to explain the uv-specific behaviors for
someone who already understands dependency resolution conceptually and
has interacted with their dependency tree before. I had a section on the
lockfile but removed it because it found the lockfile to be too
self-documenting.

I haven't touched the readme.

Closes #5603
Closes #5238
Closes #5237

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-03 08:47:11 -05:00
Zanie Blue 44a6dbfa53
Improvements to the documentation (#5718) 2024-08-03 08:41:33 -05:00
Zanie Blue 64c6caa57b
Fixup settings reference (#5694)
Fixes #5689
2024-08-01 16:41:26 +00:00
Zanie Blue 0f30c69624
Move settings reference to reference section (#5689)
Joining #5685 in a dedicated reference section
2024-08-01 16:20:30 +00:00
Zanie Blue f107406727
Generate CLI reference for documentation (#5685)
Loosely based on [Cargo's
format](https://github.com/rust-lang/cargo/blob/master/src/doc/src/commands/cargo-build.md)

<img width="896" alt="Screenshot 2024-08-01 at 9 44 03 AM"
src="https://github.com/user-attachments/assets/7c016bb3-2b54-46af-8ea8-ce82e07a0e30">

Future work includes:

- Grouping options
- Enforcing some sort of specific command ordering
- Showing possible values for enums
- Adding "long_about" to commands for more context
2024-08-01 16:04:16 +00:00
Zanie Blue ed520580a1
Remove breadcrumbs for navigation (#5676)
Closes https://github.com/astral-sh/uv/issues/5671

These are effectively worthless since it never displays more than one
level.
2024-07-31 17:10:31 -05:00
Zanie Blue 9e4fbd2111
Move pip-compatibility doc into pip interface section (#5670) 2024-07-31 20:30:10 +00:00
eth3lbert 89947681d1
Improve copy of console command examples (#5397)
## Summary

This PR improves the copy of the console command example by:

- Preventing the selection of generic prompts and generic output
- Lazily setting copy content by leveraging intersection observer

Most of the changes are inspired by
https://github.com/opensafely/documentation/pull/1461

Some other useful refs:
- https://github.com/squidfunk/mkdocs-material/issues/3647
-
https://mkdocstrings.github.io/recipes/#prevent-selection-of-prompts-and-output-in-python-code-blocks

Resolves #5355

## Test Plan

- 
  ``` shell-session
  mkdocs serve -f mkdocs.public.yml
  ``` 
- Navigate to http://localhost:8000/uv/first-steps/#viewing-the-version
- Try clicking the copy button
- Try copying by selecting the content

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-07-31 14:52:02 +00:00
Zanie Blue 5830a532ef
Add links to documentation footer (#5616) 2024-07-30 12:42:17 -05:00
Zanie Blue 6eb8f85668
Update documentation sections (#5452)
Reframes "the low-level interface" as "the pip interface"
Adds indexes to all sections
Renames "commercial indexes" to "alternative indexes"
2024-07-25 12:37:22 -05:00
Zanie Blue 3581e27cdf
Bundle of docs changes (#5426) 2024-07-24 17:10:33 -05:00
Zanie Blue ac81036aa9
Use logo in documentation (#5421)
Before
<img width="728" alt="Screenshot 2024-07-24 at 3 12 28 PM"
src="https://github.com/user-attachments/assets/2ad83857-a2a5-4c33-9fb2-f2580ccb10af">

After
<img width="728" alt="Screenshot 2024-07-24 at 3 11 07 PM"
src="https://github.com/user-attachments/assets/dd209d37-3761-4b28-8ca9-9bf7546236a8">

Alternatively
<img width="728" alt="Screenshot 2024-07-24 at 3 10 45 PM"
src="https://github.com/user-attachments/assets/88f9cc62-71ec-457c-b946-3168502d46c3">
2024-07-24 15:45:10 -05:00
Zanie Blue dac696e950
Bundle of documentation changes (#5307)
Following #5239
2024-07-23 13:29:59 -05:00
Zanie Blue 6492f1a897
A bundle of documentation changes (#5239)
I just need to iterate on everything and we're not doing a lot of
reviews anyway.

Closes #5234 
Closes #5191
2024-07-22 17:15:11 +00:00
Zanie Blue 583a6e57f2
Write tools concept doc (#5207) 2024-07-19 14:24:43 -05:00
Zanie Blue 61a81da760
Move integration guide docs and edit Azure integration guide (#5117) 2024-07-18 03:47:32 +00:00
Zanie Blue 177bbaa8c0
Add stubs for the project documentation (#5135)
@ibraheemdev is going to do some work on these, I just sketched out some
parts to try to understand how things will fit together.
2024-07-16 17:02:54 -05:00
Zanie Blue 21cda3e079
Separate the TOC from the navigation bar (#5128)
Starting a discussion.

I find the navigation bar too long and verbose, it's overwhelming. I
think we either need to either:

- Limit the depth of the navigation bar (i.e. via `toc_depth: 2`)
- Move the table of contents out of the navigation bar over to the right
side

I prefer the second, though I think we ought to do some styling to
improve the aesthetics.
2024-07-16 16:11:35 -05:00
Charlie Marsh 545bbf9286
Add `settings.md` to docs (#5091)
## Summary

It's kinda messed up: the depths are off, and the titles are incorrectly
uppercased, but I'll fix those tomorrow.

![Screenshot 2024-07-15 at 10 38
50 PM](https://github.com/user-attachments/assets/3aabae67-4d6b-40e1-9523-2d4d1b7006b4)
2024-07-16 02:46:21 +00:00