Commit graph

201 commits

Author SHA1 Message Date
Mathieu Kniewallner
fd17f6d902
docs: use python to highlight requirements and use more content tabs (#6549)
## Summary

It appears that using `python` for code blocks containing requirements
works quite well.

![Screenshot from 2024-08-23
23-23-05](https://github.com/user-attachments/assets/38c92ef7-1f5e-40eb-8ea4-7024c8180bc4)

![Screenshot from 2024-08-23
23-23-31](https://github.com/user-attachments/assets/940dc7d5-22a8-4cd8-b54a-d56542d4345c)

Also using more content tabs for cases where we need to differentiate
macOS/Linux from Windows.

## Test Plan

Local run of the documentation.
2024-08-27 06:05:14 -05:00
konsti
ae57d85dfb
Detect musl and error for musl pbs builds (#6643)
As described in #4242, we're currently incorrectly downloading glibc
python-build-standalone on musl target, but we also can't fix this by
using musl python-build-standalone on musl targets since the musl builds
are effectively broken.

We reintroduce the libc detection previously removed in #2381, using it
to detect which libc is the current one before we have a python
interpreter. I changed the strategy a big to support an empty `PATH`
which we use in the tests.

For simplicity, i've decided to just filter out the musl
python-build-standalone archives from the list of available archive,
given this is temporary. This means we show the same error message as if
we don't have a build for the platform. We could also add a dedicated
error message for musl.

Fixes #4242

## Test Plan

Tested manually.

On my ubuntu host, python downloads continue to pass:
```
target/x86_64-unknown-linux-musl/debug/uv python install
```

On alpine, we fail:
```
$ docker run -it --rm -v .:/io alpine /io/target/x86_64-unknown-linux-musl/debug/uv python install
  Searching for Python installations
  error: No download found for request: cpython-any-linux-x86_64-musl
```
2024-08-27 00:06:53 +00:00
Charlie Marsh
486c9848a1
Add docs for disabling build isolation with uv sync (#6607)
## Summary

This requires some care, so worth documenting the intended workflows.

Closes https://github.com/astral-sh/uv/issues/6437.
2024-08-26 18:21:43 +00:00
konsti
4e82db093a
Document why we do lower bounds (#6516)
Document in the resolution concept documentation why we add lower bounds

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-23 20:28:39 +00:00
Zanie Blue
e0abab8259
Add documentation for uv python find (#6527)
In part, for https://github.com/astral-sh/uv/pull/6521
2024-08-23 15:14:52 -05:00
T-256
d0dda3798d
docs: Use proper environment variables for Windows (#6433)
ref: https://github.com/astral-sh/uv/issues/6397#issuecomment-2304512872
2024-08-23 13:04:08 -05:00
Agustín Borgna
5e01740b30
docs: Incorrect workspace members keyword (#6502)
## Summary

Small keyword fix. In the `concepts/dependencies` documentation, the
workspace example listed members under an invalid
`tool.uv.workspace.include` field.

This PR changes the key to
[`tool.uv.workspace.members`](https://docs.astral.sh/uv/reference/settings/#workspace_members)
instead.
2024-08-23 12:16:33 +02:00
Zanie Blue
a535d3b131
Further clarifications to the tools documentation (#6474) 2024-08-22 18:58:02 -05:00
Zanie Blue
cba329ee21
Add tip for using managed = false to disable project management (#6465)
Closes https://github.com/astral-sh/uv/issues/6463
2024-08-22 18:06:57 -05:00
Zanie Blue
13130fe756
Clarify the uv tool run, uvx, and uv run relationships (#6455) 2024-08-22 23:05:42 +00:00
Zanie Blue
3dd39e6d35
Fix references to --python-downloads (it is --no-python-downloads) (#6439)
Noticed in https://github.com/astral-sh/uv/pull/6409
2024-08-22 09:22:55 -05:00
Hynek Schlawack
a3a5b82a17
docs: fix tip markup in python-versions.md (#6409)
## Summary

Currently there's an empty tip box.

## Test Plan

Docs only, therefore eyeballed. :)
2024-08-22 10:51:35 +02:00
Andrew Gallant
33480d61eb switch to jiff from chrono (#6205)
This PR migrates uv's use of `chrono` to `jiff`.

I did most of this work a while back as one of my tests to ensure Jiff
could actually be used in a real world project. I decided to revive
this because I noticed that `reqwest-retry` dropped its Chrono
dependency,
which is I believe the only other thing requiring Chrono in uv.
(Although, we use a fork of `reqwest-middleware` at present, and that
hasn't been updated to latest upstream yet. I wasn't quite sure of the
process we have for that.)

In course of doing this, I actually made two changes to uv:

First is that the lock file now writes an RFC 3339 timestamp for
`exclude-newer`. Previously, we were using Chrono's `Display`
implementation for this which is a non-standard but "human readable"
format. I think the right thing to do here is an RFC 3339 timestamp.

Second is that, in addition to an RFC 3339 timestamp, `--exclude-newer`
used to accept a "UTC date." But this PR changes it to a "local date."
That is, a date in the user's system configured time zone. I think
this makes more sense than a UTC date, but one alternative is to drop
support for a date and just rely on an RFC 3339 timestamp. The main
motivation here is that automatically assuming UTC is often somewhat
confusing, since just writing an unqualified date like `2024-08-19` is
often assumed to be interpreted relative to the writer's "local" time.
2024-08-20 11:31:46 -05:00
Charlie Marsh
3395d24959
Allow user to constrain supported lock environments (#6210)
## Summary

The strategy here is: if the user provides supported environments, we
use those as the initial forks when resolving. As a result, we never add
or explore branches that are disjoint with the supported environments.
(If the supported environments change, we ignore the lockfile entirely,
so we don't have to worry about any interactions between supported
environments and the preference forks.)

Closes https://github.com/astral-sh/uv/issues/6184.
2024-08-20 13:28:04 +00:00
Zanie Blue
c703917d99
Document the cache directory (#6229) 2024-08-19 15:51:45 -05:00
Zanie Blue
ea3db275a9
Link to persistent configuration options in Python versions document (#6226) 2024-08-19 19:22:58 +00:00
Zanie Blue
923dc13617
Link to the projects concept from the dependencies concept (#6224) 2024-08-19 14:22:27 -05:00
Charlie Marsh
865e9e0626
Make some edits to the workspace concept documentation (#6223) 2024-08-19 18:57:31 +00:00
Charlie Marsh
c80a831438
Add support for package@latest in tool run (#6138)
## Summary

`@latest` will ignore any installed tools and force a cache refresh.

Closes https://github.com/astral-sh/uv/issues/5807.
2024-08-19 16:58:36 +00:00
Zanie Blue
6bc8639ce8
Allow customizing the tool install directory with UV_TOOL_BIN_DIR (#6207)
Requested in #6067
2024-08-19 15:02:10 +00:00
Charlie Marsh
35cdd43f88
Document dynamic metadata behavior for cache (#5993)
## Summary

Closes https://github.com/astral-sh/uv/issues/5484.
2024-08-16 17:01:11 -04:00
Zanie Blue
e8876ada6d
Fix some outdated documentation discussing Python environments (#6058)
Starting on https://github.com/astral-sh/uv/issues/5966 noticed various
problems
2024-08-13 11:47:39 -05:00
Theo BABILON
070d5b7402
Fixed projects guide typo (#6033)
Sorry for spam, also noticed this tiny repetition

Co-authored-by: tbabilon <theo.babilon@mlp.com>
2024-08-12 07:09:11 -05:00
Charlie Marsh
cd0171a2ed
Remove editable: false support (#5987)
## Summary

This doesn't actually work yet. We'll re-add it in the future.

Closes #5958.
2024-08-09 20:59:23 -04:00
Zanie Blue
44f94524f3
Document virtual environment discovery (#5965) 2024-08-09 18:15:21 +00:00
Zanie Blue
4df0fe9a01
Update the interface for declaring Python download preferences (#5936)
The loose consensus is that "fetch" doesn't have much meaning and that a
boolean flag makes more sense from the command line.

1. Adds `--allow-python-downloads` (hidden, default) and
`--no-python-downloads` to the CLI to quickly enable or disable
downloads
2. Deprecates `--python-fetch` in favor of the options from (1)
3. Removes  `python-fetch` in favor of a `python-downloads` setting
5. Adds a `never` variant to the enum, allowing even explicit installs
to be disabled via the configuration file

## Test plan

I tested this with various `pyproject.toml`-level settings and `uv venv
--preview --python 3.12.2` and `uv python install 3.12.2` with and
without the new CLI flags.
2024-08-09 13:10:19 -05:00
Charlie Marsh
7a0b610c19
Document the tool upgrade command (#5947) 2024-08-09 08:19:38 -05:00
Zanie Blue
345c167774
Fix GitHub cache integration link (#5847)
Unclear why mkdocs does not error on this 404
2024-08-07 02:08:45 +00:00
Zanie Blue
91792674da
Link to the GitHub integration guide from the cache concept (#5828) 2024-08-06 15:48:19 -05:00
Zanie Blue
6a31c80c7e
Update the override section with some content from the README (#5820) 2024-08-06 20:23:58 +00:00
Zanie Blue
aad39febe5
Address some feedback in the tools documentation (#5827) 2024-08-06 15:21:18 -05:00
Zanie Blue
1f7961d6fb
Add "next steps" to some early documentation pages (#5825) 2024-08-06 13:48:04 -05:00
Zanie Blue
12059340de
Update resolver reference documentation (#5823) 2024-08-06 13:18:23 -05:00
Zanie Blue
83d6f59e2e
Update the resolution concept documentation (#5813) 2024-08-06 12:06:06 -05:00
Charlie Marsh
089f50a845
Add --no-sources to avoid reading from tool.uv.sources (#5801)
## Summary

Closes https://github.com/astral-sh/uv/issues/5791.
2024-08-06 14:14:19 +00:00
Charlie Marsh
ce30bffaab
Make some minor tweaks to the docs (#5786)
## Summary

Small stuff from a first scan.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-05 13:54:06 +00:00
Charlie Marsh
6a80f176a3
Remove some trailing backticks from the docs (#5781) 2024-08-05 00:56:03 +00:00
Delgan
260d1f546f
Fix broken anchor links in docs about dependencies (#5769) 2024-08-05 00:42:48 +00:00
konsti
ba924d298f
Better workspace documentation (#5728)
Add more context around using workspaces.

Closes #5604.

Preview (ignore the glitchy navbar):


![image](https://github.com/user-attachments/assets/61b08a9c-958a-4529-8781-509597704350)
2024-08-03 08:49:09 -05: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
konsti
db371560bc
Use prettier to format the documentation (#5708)
To enforce the 100 character line limit in markdown files introduced in
https://github.com/astral-sh/uv/pull/5635, and to automate the
formatting of markdown files, i've added prettier and formatted our
markdown files with it.

I've excluded the changelog and the generated references documentation
from this for having too many changes, but we can also include them.

I'm not particular on which style we use. My main motivations are
(major) not having to reflow markdown files myself anymore and (minor)
consistence between all markdown files. I've chosen prettier for similar
reason as we chose black, it's a single good style that's automated and
shared in the community. I do prefer prettier's style of not breaking
inside of a link name though.

This PR is in two parts, the first adds prettier to CI and documents
using it, while the second actually formats the docs. When merge
conflicts arise, we can drop the last commit and regenerate it with `npx
prettier --prose-wrap always --write BENCHMARKS.md CONTRIBUTING.md
README.md STYLE.md docs/*.md docs/concepts/**/*.md docs/guides/**/*.md
docs/pip/**/*.md`.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-02 08:58:31 -05:00
konsti
78d4045729
Don't use equals signs for cli args with value (#5704)
Use a consistent style for cli arguments with a value, e.g.
`--resolution lowest`, not `--resolution=lowest`.
2024-08-01 14:17:30 -05:00
Zanie Blue
22d152192d
Improvements to the dependency concept doc (#5658) 2024-07-31 15:44:25 +00:00
Zanie Blue
fbff1baf33
Improvements to the Python version concepts documentation (#5638)
Depends on https://github.com/astral-sh/uv/pull/5637
2024-07-31 08:40:50 -05:00
Charlie Marsh
5d727cb0af
Deprecate the --isolated flag (#5466)
## Summary

This PR deprecates the `--isolated` flag. The treatment varies across
the APIs:

- For non-preview APIs, we warn but treat it as equivalent to
`--no-config`.
- For preview APIs, we warn and ignore it, with two exceptions...
- For `tool run` and `run` specifically, we don't even warn, because we
can't differentiate the command-specific `--isolated` from the global
`--isolated`.
2024-07-30 22:40:38 +00:00
Zanie Blue
f971631adf
Wrap documentation at 100 characters (#5635)
Basically sick of dealing with mixed formatting here. Going with the
number at
7c08e61b73/.editorconfig (L20)
2024-07-30 22:17:58 +00:00
Zanie Blue
b081425a77
Improvements to the project concept docs (#5634) 2024-07-30 22:11:52 +00:00
Zanie Blue
8545ae2312
Rename more use of "lock file" to "lockfile" (#5629) 2024-07-30 19:09:43 +00:00
Charlie Marsh
3e7b9fb2ee
Add documentation for cache clearing (#5517)
See: https://github.com/astral-sh/uv/pull/5391#issuecomment-2248757705
2024-07-30 09:38:04 -05:00