Commit graph

357 commits

Author SHA1 Message Date
Den Kasyanov
0ceefb3c88
Update FastAPI integration docs (#6833) (#6850)
## Summary

- Fixed the directory structure and commands for the second scenario
#6833
- Added a headline "Migrating an existing FastAPI project" because the
first part looks like a migration scenario, but didn't have its own
section before.
- Added explicit `--app` flags to commands to emphasize that the
commands create an Application project. Although maybe unnecessary
considering that `--app` is now default.
- Added instructions for testing that the dev server and Docker image
work correctly
- Took the liberty of adding a `project` at the root of all directory
structures and appropriate commands.
- With explicitly defined root directory it is easier to differentiate
between the `project` root directory and FastAPI's `app` directory.
- Without it it could be less obvious for developers less familiar with
FastAPI. Had a similar issue when started using Django several years
ago.
- If I left `app` in the command, then after copying the **app
directory** from https://github.com/astral-sh/uv-fastapi-example the
path would be `app/app/...`.
- Cleaned up glyphs in tree sctructures that were copied from FastAPI
docs.

## Caveats

- On project initialization `hello.py` is created. It is not reflected
in directory structure trees in this PR and may be slightly confusing
for developers less familiar with uv.
- I believe it will be soon addressed in #6750 and after that the docs
will reflect actual directory structure.
2024-08-30 10:00:26 -04:00
Zanie Blue
c91c99b35e
Drop old content from the FastAPI guide (#6851) 2024-08-29 22:22:37 -05:00
Shantanu
57cb9c2957
Add docs for inline exclude newer (#6831)
See https://github.com/astral-sh/uv/pull/6562
2024-08-29 15:44:47 -05:00
Zanie Blue
09e359f5ad
Add a link to the multiple index docs in the alternative index guide (#6826) 2024-08-29 15:27:48 -05:00
Franco Mariluis
670e9603ee
add docs for AWS CodeArtifact (#6816)
<!--
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

This adds explicit information about using `uv` with AWS CodeArtifact
(both as an extra index to fetch private packages and also to publish
packages using `twine`).

## Test Plan

I'm currently using this setup with several private projects that use
CodeArtifact.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-29 12:40:41 -05:00
Zanie Blue
98577b52bf
Enumerate available Docker tags (#6768) 2024-08-28 13:51:23 -05:00
Charlie Marsh
d9bd3bc7a5
Bump to v0.4.0 (#6764) 2024-08-28 17:29:16 +00:00
Zanie Blue
451eef31a6
Bind to the host to allow connections in FastAPI Docker example (#6753)
This wouldn't allow connections as written
2024-08-28 10:33:54 -05:00
Zanie Blue
37e29f1109
Update FastAPI guide for virtual projects and use uv init to create the pyproject.toml (#6752)
Follows https://github.com/astral-sh/uv/pull/6751

Matches https://github.com/astral-sh/uv-fastapi-example/pull/3
2024-08-28 10:33:46 -05:00
Zanie Blue
50c4341cc6
Remove build system from FastAPI guide (#6751)
Matches https://github.com/astral-sh/uv-fastapi-example/pull/2
2024-08-28 10:33:38 -05: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
Zanie Blue
75a5066e10
Improvements to the application and library documentation (#6726) 2024-08-27 23:15:12 +00:00
Zanie Blue
d5d8375c7e
Update project documentation for the application / library concepts (#6718)
Follows https://github.com/astral-sh/uv/pull/6689 and
https://github.com/astral-sh/uv/pull/6585
2024-08-27 16:22:31 -05:00
Zanie Blue
c56102bde3
Fix some broken links (#6705) 2024-08-27 17:24:49 +00:00
Charlie Marsh
6c62d9fbf1
Bump version to v0.3.5 (#6696) 2024-08-27 16:30:12 +00:00
konsti
18453ae79f
Add note about install python on alpine (#6677)
When not using a python base image and using alpine, you need to install
python by yourself. You should also pin the python version when doing
so; currently, i see only python 3.12 in the alpine repository.
2024-08-27 11:03:55 -05:00
Zanie Blue
563e292c14
Add development section to Docker guide and reference new example project (#6666) 2024-08-27 06:41:44 -05:00
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
Zanie Blue
680dcc344c
Improve consistency of directory lookup instructions in Docker (#6665) 2024-08-26 20:39:25 -05:00
Zanie Blue
3949e5d30e
Shift the order of some of the Docker guide content (#6664) 2024-08-26 20:13:14 -05:00
Charlie Marsh
39f3cd2a94
Bump version to v0.3.4 (#6656) 2024-08-26 16:51:01 -04:00
2*yo
900056105a
[Doc] Fix using uv temporarily on docker (#6657)
<!--
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? -->

The following Dockerfile command fails:

```
[...]
RUN --mount=from=uv,source=/uv,target=/bin/uv \
    cd /opt/opencti-connector-webhook && \
    uv pip install --system -r requirements.txt && \
    apk del git build-base
[...]
```
Result 

```
yo@opencti:~/connectors/stream/webhook$ docker build -t opencti/connector-webhook:d .
[+] Building 1.0s (3/3) FINISHED                                                                                                                                            docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                  0.1s
 => => transferring dockerfile: 557B                                                                                                                                                  0.1s
 => ERROR [internal] load metadata for docker.io/library/uv:latest                                                                                                                    0.8s
 => [internal] load metadata for docker.io/library/python:3.11-alpine                                                                                                                 0.8s
------
 > [internal] load metadata for docker.io/library/uv:latest:
------
ERROR: failed to solve: uv: failed to resolve source metadata for docker.io/library/uv:latest: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
```

Fix:

```
[...]
RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv \
    cd /opt/opencti-connector-webhook && \
    uv pip install --system -r requirements.txt && \
    apk del git build-base
[...]
```


## Test Plan

<!-- How was it tested? -->
```
$ docker --version
Docker version 26.0.0, build 2ae903e
$ date
Mon Aug 26 20:31:53 UTC 2024

$ docker build -t opencti/connector-webhook:e .
[+] Building 41.8s (13/13) FINISHED                                                                                                                                         docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                  0.0s
 => => transferring dockerfile: 587B                                                                                                                                                  0.0s
 => [internal] load metadata for ghcr.io/astral-sh/uv:latest                                                                                                                          0.5s
 => [internal] load metadata for docker.io/library/python:3.11-alpine                                                                                                                 0.5s
 => [internal] load .dockerignore                                                                                                                                                     0.1s
 => => transferring context: 2B                                                                                                                                                       0.0s
 => [stage-0 1/6] FROM docker.io/library/python:3.11-alpine@sha256:700b4aa84090748aafb348fc042b5970abb0a73c8f1b4fcfe0f4e3c2a4a9fcca                                                   0.0s
 => [internal] load build context                                                                                                                                                     0.1s
 => => transferring context: 130B                                                                                                                                                     0.0s
 => CACHED FROM ghcr.io/astral-sh/uv:latest@sha256:f6b18f4a7408c5244374b00c8832089258d130f7a77a38807348072e714ffa0c                                                                   0.0s
 => CACHED [stage-0 2/6] COPY src /opt/opencti-connector-webhook                                                                                                                      0.0s
 => CACHED [stage-0 3/6] RUN apk --no-cache add git build-base libmagic libffi-dev libxml2-dev libxslt-dev                                                                            0.0s
 => [stage-0 4/6] RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv     cd /opt/opencti-connector-webhook &&     uv pip install --system -r requirements.txt    38.3s
 => [stage-0 5/6] COPY entrypoint.sh /                                                                                                                                                0.1s
 => [stage-0 6/6] RUN chmod +x /entrypoint.sh                                                                                                                                         0.8s
 => exporting to image                                                                                                                                                                1.7s
 => => exporting layers                                                                                                                                                               1.6s
 => => writing image sha256:aa6810f883d104c838f35e848c0d7d8b4df5c7c3929f18a88b7139d0ec892a0b                                                                                          0.0s
 => => naming to docker.io/opencti/connector-webhook:e                                                                                                                                0.0s
```
2024-08-26 15:36:38 -05:00
Zanie Blue
430cd3006e
Add tip to use intermediate layers (#6650) 2024-08-26 15:14:47 -05:00
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