Currently, for users to specify at the command line whether to use
uv-managed or system Python interpreters, they use the
`--python-preference` parameter, which takes four possible values. This
is more complex than necessary since the normal case is to either say
"only managed" or "not managed". This PR hides the old
`--python-preference` parameter from help and documentation and adds two
new flags: `--managed-python` and `--no-managed-python` to capture the
"only managed" and "not managed" cases.
I have successfully tested this locally but currently cannot add
snapshot tests because of problems with distinguishing managed vs.
system interpreters in CI (and non-determinism when run on different
developers' machines). The `--python-preference` test in
`tool-install.rs` is currently ignored for this reason. See #5144 and
#7473.
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>
<!--
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
Update this example snippet adding test.pypi.org as a publishing index
to mark the index with `explicit = true`. This will help prevent users
from unexpected behavior if no other indices are defined and users don't
select a different index selection algorithm (with `--index-strategy`).
When `test.pypi.org` is the selected index for package management,
packages resolve to odd versions like 0.0.1 and `uv` spits out lots of
errors.
<!-- What's the purpose of the change? What does it do, and why? -->
## Test Plan
N/A, documentation only change
<!-- How was it tested? -->
## Summary
Follow up to https://github.com/astral-sh/uv/pull/11888 with added
support for uv tool run.
Changes
* Added functionality for running windows scripts in previous PR was
moved from run.rs to uv_shell::runnable.
* EXE was added as a supported type, this simplified integration across
both uv run and uvx while retaining a backwards compatible behavior and
properly prioritizing .exe over others. Name was adjusted to runnable as
a result to better represent intent.
## Test Plan
New tests added.
## Documentation
Added new documentation.
## Summary
This is roughly equivalent, but gets the non-`+cpu` macOS build from the
PyTorch index rather than PyPI. It seems a bit simpler? Though up for
debate.
## Summary
Closes#9867.
Update alternative indexes documentation to use `[[tool.uv.index]]` and
the associated environment variables instead of `UV_INDEX`.
This also globally reworks the documentation by:
- adding AWS CodeArtifact keyring example
- adding packages publishing examples for all providers
- making it more consistent for all providers
It might be best to show how to publish packages only once for all
providers, but the publish URL usually being different than the URL used
to retrieve packages, even if this duplicates things, it might still be
more straightforward for users to see exactly what is needed for each
provider.
## Test Plan
Manually tested retrieving packages from AWS CodeArtifact and GCP
Artifact Registry using both token and keyring.
Could not test:
- Publishing packages
- Azure Artifacts (not using it at all)
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>
<!--
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
Just to add the section for installing and upgrading uv tool, specifying
the Python version, in the document.
Originally, it was planned to add a markdown block (header) for
representation, but it was felt to be a bit redundant, so it ended up
being like this.
close https://github.com/astral-sh/uv/issues/11536
## Test Plan
Run doc server with strict mode in local. (``mkdocs serve -f
mkdocs.public.yml --strict``)

<!-- How was it tested? -->
---------
Signed-off-by: FishAlchemist <48265002+FishAlchemist@users.noreply.github.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
Initially it seemed like `app.py` might be slightly more desirable but
people seem to overwhelmingly favour `main.py` as a good "generic" name.
Fixes#7782
## Summary
The [current scripts docs
page](https://docs.astral.sh/uv/guides/scripts/) doesn't include detail
on how to use a custom package index when setting up a script. I believe
this might be because it didn't use to work (see #6688 ) but it now does
(thanks for that, by the way! 😄)
Given it's a useful feature, I suggest adding a quick example to the
scripts page, with the details of authentication, etc. left to the main
`indexes.md` doc.
I'd also suggests that this closes#6688, though it doesn't actually add
that feature - that appears to have already been done :)
## Test Plan
No testing is needed, I think!
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>
<!--
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
Use `UV_INDEX` instead of the deprecated `UV_EXTRA_INDEX_URL`.
<!-- What's the purpose of the change? What does it do, and why? -->
## Test Plan
It is a minor documentation change.
<!-- How was it tested? -->
## Summary
It turns out activating the kernel does not change `VIRTUAL_ENV`, so we
still install into the environment the Jupyter environment, rather than
the project environment.
Unfortunately, after this change, we do still show a warning on `uv
add`:
```
warning: `VIRTUAL_ENV=/Users/crmarsh/.cache/uv/archive-v0/3bddKDdYXuX2w57Fu6itL` does not match the project environment path `.venv` and will be ignored
```
`uv pip install` works without warning.
Closes#11154.
## Summary
Maybe slightly controversial because it's more verbose, but we really
want to limit these indexes to Linux and Windows, rather than ignoring
them on Darwin. E.g., we'd also want to ignore them on other platforms.
Further down, I use markers that look like this in the more complete
examples, so this feels more consistent.
This PR rewords the instructions for using uv in a container. I'm a new
user and was somewhat confused by it, so I've rewritten it as I'd have
liked to have read it.
It makes it more clear what distroless means, to avoid confusion with
other projects that ship OS files with an image with its tag name clear
of qualifiers(`astral-sh/uv`, in this case). An example of that is
caddy, which ships with alpine.
This also modifies the original example to use a distroful image instead
of distroless one while #8635 doesn't get resolved.
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>
## Summary
Hardlinking does not work in that context and raises a warning.
Setting the link mode to copy makes the warning go away.
## Test Plan
Tested on gitlab.com and our self-hosted GitLab instance.
Before changing the link mode:
8986967570
After changing the link mode:
8987026307.
⚒️ with ❤️ by
[Siemens](https://opensource.siemens.com/)
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>
## Summary
The latter issue has been closed in favour of the former, so just link
the one issue Dependabot is using to track this.
## Test Plan
N/A
---
Thanks!
<!--
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? -->
As requested in https://github.com/astral-sh/uv/issues/6565, this adds a
tip discussing the ability to pin the image to a specific SHA digest and
why it may be useful.
## Test Plan
<!-- How was it tested? -->
Start serving the documentation locally
```shell
uvx --with-requirements docs/requirements.txt -- mkdocs serve -f mkdocs.public.yml
```
Then navigate to http://127.0.0.1:8000/uv/guides/integration/docker/ to
see the tool tip being rendered properly
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>