Commit graph

134 commits

Author SHA1 Message Date
Zanie Blue
330f5adf34
Move WORKDIR directive in Docker examples (#6652) 2024-08-26 15:09:01 -05:00
Zanie Blue
a2290ff360
Remove duplicate WORKDIR directive in Docker example (#6651) 2024-08-26 14:42:46 -05:00
Charlie Marsh
4cbec958e1
Add FastAPI guide to overview (#6603) 2024-08-25 13:11:10 +00:00
Charlie Marsh
8ee53a9e38
Clarify need to include pyproject.toml with --no-install-project (#6581)
## Summary

See: https://github.com/astral-sh/uv/issues/6573
2024-08-24 09:45:23 -04:00
skykasko
8ca64de67e
Add example of reading script from stdin using echo (#6567)
As a non-shell-wizard, I was unfamiliar with the `EOF` syntax used in
the existing example (just above the one I added). I thought including
an example where the output of `echo` is piped to `uv run` might be more
accessible. As a bonus, it should work across more shells: the `EOF`
example doesn't work in fish because fish [doesn't support
heredocs](https://fishshell.com/docs/current/fish_for_bash_users.html#heredocs),
while the `echo` example does.

Feel free to ignore if unwanted.
2024-08-24 00:03:59 -05:00
Zanie Blue
deea6025a1
Bump version to 0.3.3 (#6558) 2024-08-23 18:35:55 -05:00
Zeyad Moustafa
2419760356
docs: made uvx note more explict (#6546)
<!--
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

I used `uvx` to test my code using `pytest` it was just before the
documentation and it worked pretty fine. But when I saw the docs I was
confused as it says:

> If you are running a tool in a project and the tool requires that your
project is installed, e.g., when using `pytest` or `mypy`, you'll want
to use `uv` run instead of `uvx`. Otherwise, the tool will be run in a
virtual environment that is isolated from your project.

So to make it simple if you don't recommend using `uvx` in this
situation then here is the pull request, and if not just close this pull
request. I said that I don't have to open an issue to discuss this as
it's so simple.

## Test Plan

None

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-23 17:17:37 -05:00
Zanie Blue
60fc2e7234
Add uv tool install example in Docker (#6547) 2024-08-23 17:09:15 -05:00
Zanie Blue
d1cbcb30e3
Add uv sync --no-install-package to skip installation of specific packages (#6540)
Extends #6538 / #6539
See #4028

Allows excluding arbitrary packages from the sync.
2024-08-23 20:48:04 +00:00
Zanie Blue
ca50243174
Add uv sync --no-install-workspace to skip installation of all workspace members (#6539)
Extends #6538
See #4028

Another version of https://github.com/astral-sh/uv/pull/6398
2024-08-23 20:39:33 +00:00
Zanie Blue
be1599ebf6
Add uv sync --no-install-project to skip installation of the project (#6538)
See #4028

A smaller version of https://github.com/astral-sh/uv/pull/6398

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-08-23 20:19:47 +00:00
Charlie Marsh
9d1cd8e48c
Add UV_COMPILE_BYTECODE environment variable (#6530)
## Summary

Closes https://github.com/astral-sh/uv/issues/6493.
2024-08-23 18:05:32 +00:00
Billy Doyle
3f147eeb06
doc: add stdin to guide (#6531)
<!--
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? -->
Document in guide stdin usage

alllll the easter eggs can do as well, but declined to keep consistent
with the other examples 😆

Additions to https://github.com/astral-sh/uv/pull/6481

```bash
$ uv run - <<EOF               
import antigravity
EOF
```

## Test Plan

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


https://github.com/astral-sh/uv/pull/6519#issuecomment-2307371063 new PR
2024-08-23 11:18:49 -05:00
Sofie Van Landeghem
665650fe2e
Two small typo fixes (#6500)
<!--
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

Two small typo fixes: one in the documentation and one in a comment in
the source code I happened to come across.
2024-08-23 12:13:36 +02:00
Charlie Marsh
c5440001ce
Bump version to v0.3.2 (#6483) 2024-08-23 03:11:23 +00:00
Charlie Marsh
1cd80139af
Add a guide for using uv with FastAPI (#6401) 2024-08-23 02:09:46 +00:00
samypr100
984cb23d56
docs: add uv run docs for gui scripts (#6478)
## Summary

Follow up docs to https://github.com/astral-sh/uv/pull/6453
2024-08-22 19:44:37 -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
4576909a10
Add uv run hint to the uvx guide (#6454) 2024-08-22 17:58:05 -05:00
Altaher Emhemed
fa3446651f
Update docs dockerfile (bullseye -> bookworm) (#6441)
<!--
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? -->

Updated docs dockerfile from Debian 11 (bullseye) to latest stable
Debian 12 (bookworm).

## Test Plan

<!-- How was it tested? -->
2024-08-22 10:58:23 -05:00
Charlie Marsh
be17d132ad
Bump version to v0.3.1 (#6385) 2024-08-21 19:07:50 -04:00
Zanie Blue
dd1934c9c3
Bump version to 0.3.0 (#6260)
[Rendered](https://github.com/astral-sh/uv/blob/zb/030/CHANGELOG.md#030)

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-08-20 12:29:58 -05:00
Zanie Blue
4b501a1393
Address feedback for Docker integration guide (#6235) 2024-08-19 22:52:39 +00:00
Zanie Blue
fac2cb8aac
Update Docker guide for projects (#6217)
Closes https://github.com/astral-sh/uv/issues/5371
2024-08-19 17:47:48 -05:00
Zanie Blue
298725fd02
Improvements to the Docker installation guide (#6216) 2024-08-19 17:47:25 -05:00
Zanie Blue
39c3c01f0c
Use uv add --script in guide (#6215) 2024-08-19 17:47:17 -05:00
Mathieu Kniewallner
a1f98e240a
docs(integration): show pinned version example on GH Actions (#6234)
## Summary

Suggestion from
https://github.com/astral-sh/uv/pull/6216#discussion_r1722204667.

I did not think of a clean way to avoid repetition, so tried to use tabs
for the platforms to only show the pin recommendation in one additional
block.

![Screenshot from 2024-08-19
23-54-36](https://github.com/user-attachments/assets/8a870c68-da60-460a-8bda-4afb72d16b86)

## Test Plan

Local run of the documentation.
2024-08-19 17:12:11 -05:00
konsti
c410d0d0db
Install ca-certificates in docker and use pipefail (#6208)
A dockerfile using `ubuntu` instead of `python` as base image currently
silently fails to install.

```dockerfile
FROM ubuntu
RUN apt-get update && apt-get install -y curl --no-install-recommends
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
RUN uv --version
```

```console
$ docker buildx build --progress plain --no-cache .
[...]
#6 [3/4] RUN curl -LsSf https://astral.sh/uv/install.sh | sh
#6 0.144 curl: (77) error setting certificate file: /etc/ssl/certs/ca-certificates.crt
#6 DONE 0.2s

#7 [4/4] RUN uv --version
#7 0.113 /bin/sh: 1: uv: not found
#7 ERROR: process "/bin/sh -c uv --version" did not complete successfully: exit code: 127
```

There's two underlying problems: Pipefail, and missing
`ca-certificates`.

In most shells, the source of a pipe erroring doesn't fail the entire
command, so `curl -LsSf https://astral.sh/uv/install.sh | sh` passes
even if the curl part fails. In bash, you can prefix the command with
`set -o pipefail &&` to change this behavior. But in the `ubuntu` docker
container, dash is the default shell, not bash. dash doesn't have a
pipefail option (in the version in ubuntu), so the [best
practice](https://docs.docker.com/build/building/best-practices/#using-pipes)
is `RUN ["/bin/bash", "-c", "set -o pipefail && curl -LsSf
https://astral.sh/uv/install.sh | sh"]`. That's not very readable, so
i'm going for `RUN curl -LsSf https://astral.sh/uv/install.sh >
/tmp/uv-installer.sh && sh /tmp/uv-installer.sh && rm
/tmp/uv-installer.sh` instead.

```dockerfile
FROM ubuntu
RUN apt-get update && apt-get install -y curl --no-install-recommends
RUN curl -LsSf https://astral.sh/uv/install.sh > /tmp/uv-installer.sh && sh /tmp/uv-installer.sh && rm /tmp/uv-installer.sh \
RUN uv --version
```

```console
$ docker buildx build --progress plain --no-cache .
[...]
#6 [3/3] RUN curl -LsSf https://astral.sh/uv/install.sh > /tmp/uv-installer.sh && sh /tmp/uv-installer.sh && rm /tmp/uv-installer.sh RUN uv --version
#6 0.179 curl: (77) error setting certificate file: /etc/ssl/certs/ca-certificates.crt
#6 ERROR: process "/bin/sh -c curl -LsSf https://astral.sh/uv/install.sh > /tmp/uv-installer.sh && sh /tmp/uv-installer.sh && rm /tmp/uv-installer.sh RUN uv --version" did not complete successfully: exit code: 77
```

The source for this error is `ca-certificates` missing, which is a
recommended package. We need to drop `--no-install-recommends` and the
installation passes again.
2024-08-19 12:14:23 -05: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
Charlie Marsh
15dfb660ab
Bump version to v0.2.37 (#6134) 2024-08-15 22:13:03 -04: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
d971d6b1da
Add python-version-file to GitHub integration documentation (#6086) 2024-08-14 10:50:37 -05:00
Zanie Blue
8d66718077
Bump version to 0.2.36 (#6060) 2024-08-13 12:05:11 -05:00
Theo BABILON
9eead68168
Fixed tools guide typo (#6027)
Noticed this tiny typo when reading the tools guide documentation

Co-authored-by: tbabilon <theo.babilon@mlp.com>
2024-08-12 07:17:38 -04:00
Zanie Blue
e097f948c9
Bump version to 0.2.35 (#5984) 2024-08-09 19:21:06 -05:00
Charlie Marsh
7a0b610c19
Document the tool upgrade command (#5947) 2024-08-09 08:19:38 -05:00
Adrian Sampson
61b0a88107
Docs: Fix link to tools concept page (#5906)
This link previously went to the wrong "concept" page; it now goes to
the one the page intended.
2024-08-08 12:38:24 +00:00
Charlie Marsh
c681c5a33c
Bump version to v0.2.34 (#5889) 2024-08-07 16:33:53 -04:00
Zanie Blue
c34681a74c
Use uv installer during build (#5854) 2024-08-07 08:25:26 -05:00
Zanie Blue
aad39febe5
Address some feedback in the tools documentation (#5827) 2024-08-06 15:21:18 -05: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
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
Zanie Blue
44a6dbfa53
Improvements to the documentation (#5718) 2024-08-03 08:41:33 -05:00
Jelle Zijlstra
4096bcef3e
docs: fix typo (#5732)
Co-authored-by: konstin <konstin@mailbox.org>
2024-08-02 18:23:53 +00: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
Zanie Blue
b14945a7b1
Bump version to 0.2.33 (#5712) 2024-08-01 21:39:17 +00:00
Zanie Blue
ef84380954
Add documentation for caching the uv cache in GHA (#5663)
Related to https://github.com/astral-sh/uv/issues/5409
2024-07-31 11:38:54 -05:00
Zanie Blue
8d14a4cb4f
Simplify GHA UV_SYSTEM_PYTHON examples (#5659) 2024-07-31 10:49:40 -05:00
Zanie Blue
cbb13e6584
Improve the project guide (#5626) 2024-07-30 18:26:23 -05:00
Charlie Marsh
38c232e466
Bump version to v0.2.32 (#5641) 2024-07-30 18:56:39 -04:00