Commit Graph

3658 Commits

Author SHA1 Message Date
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
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 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
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
Zanie Blue 80b5384a4d
Set `VIRTUAL_ENV` for `uv run` invocations (#6543)
If we don't do this, and `uv run` invokes something like `uv run
--isolated uv pip install foo` uv won't mutate the isolated environment,
it'll mutate whatever outer environment it finds.
2024-08-23 20:03:38 +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
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
Thomas Quillan 429e6e61a8
Revert changes to pyproject.toml when sync fails duing `uv add` (#6526)
## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
This is a attempt at fixing https://github.com/astral-sh/uv/issues/6486.
It reverts changes made to `pyproject.toml` when sync fails during `uv
add`. This solution felt a little heavy handed and could probably be
improved but it is what happens when locking fails during `uv add` so I
thought it would be a good start.

## Test Plan

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

I have added a test case for this to `tests/edit.rs`. It uses
`pytorch==1.0.2` to achieve the desired failure.
2024-08-23 13:54:33 -04:00
Ben Beasley 13da5b3cf5
Add license texts for contents of ecosystem/ (#6181)
<!--
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? -->
While the contents of `ecosystem/` are “merely” `pyproject.toml` files
and one trivial Python script, they are still covered by the licenses of
the projects from which they are copied. Not only is maintaining
license/copyright statements good practice, but it’s generally
specifically required by the particular licenses involved here.

Even though these files are for integration testing only – and therefore
do not contribute to the license of the compiled `uv` executable – they
are nevertheless part of the source archive, so distributors and
integrators need to consider their license status. For example, I
maintain the `uv` package in Fedora Linux, and I need to consider these
licenses because the files would be redistributed in the source RPMs.

## Test Plan

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

N/A – validated by examination of the diff.
2024-08-23 11:28:17 -05: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
Zanie Blue 4cdca06db2
Add `--no-project` alias for `uv python pin --no-workspace` (#6514)
This matches the other interfaces and seems like an oversight.
2024-08-23 16:08:27 +00:00
Charlie Marsh 57f833c302
Respect `-` as stdin channel for `uv run` (#6481)
## Summary

Closes https://github.com/astral-sh/uv/issues/6467.
2024-08-23 11:49:56 -04:00
Zanie Blue 01fc233dd0
Ignore `.python-version` files in `uv venv` with `--no-config` (#6513)
Dupe of  #6373 — merged into the wrong branch by accident.
2024-08-23 13:56:11 +00:00
Mathieu Kniewallner 7edd78c797
feat(self-update): show old version in update message (#6473)
## Summary

Indicate the previous version from which uv was upgraded when running
`uv self update`. Thought that it could be useful in some situations to
have a trace of the previous version that was installed.

## Test Plan

Did not find a way to test this, since this heavily relies on being able
to use the installation script and the ability to publish artifacts for
a specific tag.
2024-08-23 07:55:47 -05:00
konsti bbcd10d3cc
Remove rustc-hash 1.1.0 (#6507)
Update tracing-durations-export so we only have rustc-hash 2.0.0
remaining.
2024-08-23 11:50:08 +00:00
konsti 33f15ac456
Update pubgrub to 388685a8711092971930986644cfed152d1a1f6c (#6495)
Regular maintenance.
2024-08-23 12:43:55 +02: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
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
konsti d8c41481ec
Fix generated docs (#6496)
Follow-up to #6494
2024-08-23 07:45:39 +00:00
Shantanu 6bd677d60d
Update cli.md (#6494)
Noticed a typo
2024-08-23 09:10:07 +02:00
FishAlchemist ad0900458f
Fix to miss string termination in PowerShell commands for shell autocompletion docs. (#6491)
## Summary
Missing string termination in PowerShell commands for shell
autocompletion docs.
 Incomplete command:
 

![image](https://github.com/user-attachments/assets/c96a93a3-f70c-4496-be54-34ab72f01a3f)



## Test Plan
Run docs server locally

![image](https://github.com/user-attachments/assets/fe861be4-6e44-441b-b924-ae832a72be16)
2024-08-23 00:22:50 -04:00
Charlie Marsh c5440001ce
Bump version to v0.3.2 (#6483) 2024-08-23 03:11:23 +00:00
Charlie Marsh 9b42142fe7
Avoid overwriting symlinks in `pip compile` output (#6487)
## Summary

Closes https://github.com/astral-sh/uv/issues/6485.
2024-08-23 02:54:45 +00:00
Charlie Marsh 1cd80139af
Add a guide for using uv with FastAPI (#6401) 2024-08-23 02:09:46 +00:00
Charlie Marsh be8ad0c507
Restore `cache` suffix on Windows cache path (#6482)
## Summary

We accidentally changed the Windows cache directory from
`C:\Users\User\AppData\Local\uv\cache` to
`C:\Users\User\AppData\Local\uv` in v0.3.0. We're considering this a
bug, since it does _not_ match the documentation, and prior to v0.3.0,
we always used the former. This PR migrates back to the previous
location. It should be seamless for users, as we move the cache items to
the new location on startup.

Closes https://github.com/astral-sh/uv/issues/6417.
2024-08-22 22:04:57 -04: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 34dd8401ed
Fix retrieval of credentials for URLs from cache (#6452)
While working on https://github.com/astral-sh/uv/pull/6389 I discovered
we never checked `cache.get_url` here, which is wrong — though I don't
think it had much effect in practice since the realm would typically
match first. The main problem is that when we call `get_url` later we
hard-code the username to `None` because we assume we checked up here
with the username if present.
2024-08-22 19:00:58 -05:00
Zanie Blue a535d3b131
Further clarifications to the tools documentation (#6474) 2024-08-22 18:58:02 -05:00
Charlie Marsh c743705dfb
Revert "Cache downloaded wheel when range requests aren't supported" (#6470)
## Summary

This reverts commit 7d92915f3d.

I thought this would be a net performance improvement, but we've now had
multiple reports that this made locking _extremely_ slow. I also tested
this today with a very large codebase against a registry that does not
support range requests, and the number of downloads was sort of wild to
watch. Reverting the reduced resolution time by over 50%.

Closes #6104.
2024-08-22 19:54:42 -04:00
Zanie Blue 7502a963e1
Add support for configuring `python-downloads` with `UV_PYTHON_DOWNLOADS` (#6436)
Part of https://github.com/astral-sh/uv/issues/6406

Replaces #6416
2024-08-22 23:19:03 +00:00
Zanie Blue 99d278f9f5
Treat `.pyw` files as scripts in `uv run` on Windows (#6453)
Closes https://github.com/astral-sh/uv/issues/6435
2024-08-22 23:07:30 +00: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 30e5336825
Update the installation documentation page (#6468)
Adds installation of autocompletion, uninstallation, and upgrades.
2024-08-22 18:04:34 -05:00
Zanie Blue 4576909a10
Add `uv run` hint to the `uvx` guide (#6454) 2024-08-22 17:58:05 -05:00
Charlie Marsh 9ee52e4e39
Deny invalid members in workspace schema (#6450)
## Summary

This has bitten me a few times.
2024-08-22 16:48:00 -04:00
Charlie Marsh 4591d0b4b2
Remove URI type from JSON Schema (#6449)
## Summary

Relative paths (like `./foo/bar`) are also welcome here!
2024-08-22 16:39:27 -04: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
Zanie Blue 0c8661340e
Add support for configuring the `python-preference` with `UV_PYTHON_PREFERENCE` (#6432)
Part of https://github.com/astral-sh/uv/issues/6406
2024-08-22 10:57:36 -05: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
Wim Jeantine-Glenn 3c7b169bf2
docs: Update pip compatibility pages to mention configuration files support (#6410)
<!--
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

Docs at https://docs.astral.sh/uv/pip/compatibility/ still say:

> the future, uv will also support persistent configuration in its own
configuration file format (e.g., pyproject.toml or uv.toml or similar).
For more, see [#651](https://github.com/astral-sh/uv/issues/651).

I think that's done now (?), so updated these to link to
https://docs.astral.sh/uv/configuration/files/

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-22 14:09:46 +00:00
Zanie Blue fc9fdd2dbb
Revert "Env variables for python downloads" (#6431)
This reverts commit bbd9adaa40 from #6416
— the Python download variable is not aligned with the setting.
2024-08-22 13:29:09 +00:00
Alexandre B A Villares 582e5a316f
docs: correcting typo "available" -> "unavailable" (#6424) 2024-08-22 12:53:07 +00:00
Ahmed Ilyas bbd9adaa40
Env variables for python downloads (#6416)
## Summary

Resolves #6406

## Test Plan

```
❯ UV_PYTHON_PREFERENCE=only-managed cargo run -q -- sync --show-settings | rg python_preference
    python_preference: OnlyManaged,
❯ UV_PYTHON_PREFERENCE=system cargo run -q -- sync --show-settings | rg python_preference
    python_preference: System,
❯ UV_NO_PYTHON_DOWNLOADS=1 cargo run -q -- sync --show-settings | rg python_downloads
    python_downloads: Never,
❯ UV_ALLOW_PYTHON_DOWNLOADS=1 cargo run -q -- sync --show-settings | rg python_downloads
    python_downloads: Automatic,
```
2024-08-22 08:52:52 -04: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
Michał Górny 04e2ff57aa
Mark emit_marker_expression* tests as requiring python-patch (#6411)
## Summary

Mark the new tests requiring Python 3.12.1 specifically as requiring
python-patch feature. This makes the test suite pass again on systems
not having this specific version (and disabling the feature).

## Test Plan

`cargo test` on Gentoo :-).
2024-08-22 10:37:40 +02:00
konsti dc94b4836f
Use backticks in pep508-rs (#6415)
In accordance with the style guide, use backticks in pep508-rs error
messages.
2024-08-22 08:31:04 +00:00
konsti c2088af78d
Hint at missing quote in marker (#6414)
For https://github.com/astral-sh/uv/issues/6379#issuecomment-2303074836.

Input: `name; python_version == 3.10`
Error:
```
Expected a quoted string or a valid marker name, found '3.10'
name; python_version == 3.10
                        ^^^^
```
2024-08-22 08:15:47 +00:00
Charlie Marsh 681d605bd9
Treat invalid extras as `false` in marker evaluation (#6395)
## Summary

Closes https://github.com/astral-sh/uv/issues/6279.

Closes https://github.com/astral-sh/uv/pull/6395.
2024-08-22 01:03:39 +00:00
Charlie Marsh 02f5416bda
Fix extra newline in args (#6396) 2024-08-22 00:44:48 +00:00