Commit Graph

6177 Commits

Author SHA1 Message Date
Zanie Blue a28db37f33
Add smoke test script in Python (#11628)
I wanted to consolidate these anyway, and apparently it's a huge pain to
make a Windows task fail early via GitHub's PowerShell setup so I
implement this in Python instead.
2025-03-27 15:35:21 -05:00
Zanie Blue 6a13e4cedd
Bump pinned Python versions (#12515)
Moves us to the latest patch for our test Python versions.
2025-03-27 20:16:10 +00:00
Charlie Marsh 7cb85fa08f
Remove TODOs around caching workspace discovery (#12510)
## Summary

This happened!
2025-03-27 16:25:09 +00:00
John Mumm 882e2f9d3f
Improve trace message in auth middleware (#12497)
Updated trace message to be clearer.
2025-03-27 15:10:02 +01:00
Charlie Marsh 82de40c2da
Enable necessary optional features in `uv-settings` (#12504)
## Summary

We tend not to run tests for individual crates, which can lead to weird
situations like this, where crates are missing optional features that
are otherwise installed globally.

## Test Plan

Run `cargo test --profile fast-build -p uv-scripts`, which otherwise
fails to compile.
2025-03-27 02:30:00 +00:00
Charlie Marsh 6e03adc956
Fix schemars macro usage in build backend enum (#12503)
## Test Plan

```
cargo test --profile fast-build -p uv-scripts
```
2025-03-27 02:23:21 +00:00
Aria Desires 6c57c90ed3
distinguish -q and -qq (#12300)
The idea here is that we introduce a new stdout_important method for
things that want to care about the difference between "quiet" and
"silent".

This PR is WIP because it has no actual uses of stdout_important, and we
should have at least one before landing this. Perhaps someone has a
suggestion for commands that would really benefit from this distinction?

Fixes #10431
2025-03-26 16:46:16 -04:00
Charlie Marsh bd9c365b92
Support `--find-links`-style "flat" indexes in `[[tool.uv.index]]` (#12407)
## Summary

This PR extends `[[tool.uv.index]]` to support `--find-links`-style
"flat" indexes, so that users can point to such indexes without using
`--find-links` _and_ get access to the full functionality of
`[[tool.uv.index]]` (e.g., they can now pin packages to
`--find-links`-style indexes).

Note that, at present, `--find-links` indexes actually have some quirky
behavior, in that we combine them into a single entity and then merge
the discovered distributions into each Simple API-style index. The
motivation here, IIRC, was to match pip's behavior quite closely. I'm
interested in _removing_ that behavior, but it'd be breaking (and may
also be inconvenient for some use-cases). So, the behavior for indexes
passed in via `--find-links` remains completely unchanged. However,
`[[tool.uv.index]]` entries with `format = "flat"` are now treated
identically to those defined with `format = "simple"` (the default), in
that we stop after we find the first-matching index, etc.

Closes https://github.com/astral-sh/uv/issues/11634.
2025-03-25 21:14:44 -04:00
Charlie Marsh f2a2d982b8
Bump version to v0.6.10 (#12430) 2025-03-25 20:43:41 -04:00
Charlie Marsh e4c98e976f
Use `Box<Path>` in lieu of `PathBuf` for immutable structs (#12346)
## Summary

I don't know if I actually want to commit this, but I did it on the
plane last time and just polished it off (got it to compile) while
waiting to board.
2025-03-25 21:56:06 +00:00
John Mumm 9745b76357
Add auth policy support for pip commands (#12470)
We were not applying the `authenticate = "always"` behavior to `uv pip`
commands (related to #12362). This PR addresses that, applying
authentication policies wherever we set up a registry client.
2025-03-25 17:13:42 -04:00
konsti 99e2324dcf
Use 64-bit host for 32-bit releases to work around OOM (#12466)
The i686 linux gnu release job started failing since the last release
(#12430) due to an OOM with llvm breaking the 4GB limit for 32-bit
processes. We work around this by using a 64-bit host targeting 32-bit.
2025-03-25 18:33:31 +01:00
renovate[bot] c2eb32164d
Update Rust crate windows-registry to v0.5.1 (#12419) 2025-03-25 01:56:42 +00:00
renovate[bot] c5b6a0849e
Update Rust crate boxcar to v0.2.11 (#12414) 2025-03-25 01:56:07 +00:00
renovate[bot] 78b6c5e571
Update Rust crate backon to v1.4.1 (#12413) 2025-03-25 01:50:35 +00:00
Charlie Marsh ddbf90c906
Revert "Show a dedicated hint for `setuptools` dash-separator change" (#12453)
Reverts astral-sh/uv#12438
2025-03-24 19:09:26 -04:00
Shlomo 20e7dcd366
docs: update dependency-bots.md (#12454)
https://github.com/renovatebot/renovate/issues/30909 has already been
resolved and released
2025-03-24 19:08:58 -04:00
Charlie Marsh 664c77a6e1
Show a dedicated hint for `setuptools` dash-separator change (#12438)
## Summary

See: https://github.com/astral-sh/uv/issues/12434.

## Test Plan

The error in-context:

![Screenshot 2025-03-24 at 12 10
11 PM](https://github.com/user-attachments/assets/48885d71-4222-4364-987f-65a4b776d91f)
2025-03-24 16:37:39 +00:00
Nick Janetakis 113ae87ab4
Update `--prune` help arg from `PRUNE` to `PACKAGE` (#12432)
## Summary

This fixes https://github.com/astral-sh/uv/issues/12426 which helps use
a more accurate arg name in the help output.

## Test Plan

I didn't test it locally, @charliermarsh gave me guidance on what to
change so I looked around that file for another example of `value_name`
and repeated what I saw. I kept it formatted to 1 line based on it not
being a long line. The other example of `value_name` had everything on
separate lines because there were a bunch of parameters passed in.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2025-03-24 15:45:29 +00:00
Charlie Marsh 1865e0a6ee
Pass around index with associated metadata (#12406)
## Summary

This PR modifies the requirement source entities to store a (new)
container struct that wraps `IndexUrl`. This will allow us to store
user-defined metadata alongside `IndexUrl`, and propagate that metadata
throughout resolution.

Specifically, I need to store the "kind" of the index (Simple API vs.
`--find-links`), but I also ran into this problem when I tried to add
support for overriding `Cache-Control` headers on a per-index basis: at
present, we have no way to passing around metadata alongside an
`IndexUrl`.
2025-03-24 10:15:49 -04:00
renovate[bot] c3442e822e
Update Rust crate jiff to v0.2.5 (#12415) 2025-03-24 10:15:03 -04:00
renovate[bot] f00f8e908a
Update taiki-e/install-action digest to 914ac1e (#12410) 2025-03-24 09:19:26 -04:00
renovate[bot] 2040c1c330
Update webfactory/ssh-agent action to v0.9.1 (#12421) 2025-03-24 09:19:07 -04:00
renovate[bot] 5ac62e05c5
Update Rust crate reflink-copy to v0.1.26 (#12418) 2025-03-24 09:18:36 -04:00
renovate[bot] ecbf288e6b
Update Rust crate mimalloc to v0.1.44 (#12416) 2025-03-24 09:18:26 -04:00
renovate[bot] 7c57cefaa8
Update Rust crate astral-tokio-tar to v0.5.2 (#12412) 2025-03-24 02:16:43 +00:00
renovate[bot] 6355a24240
Update PyO3/maturin-action action to v1.47.3 (#12411) 2025-03-23 22:15:00 -04:00
renovate[bot] b69be96e0f
Update astral-sh/setup-uv digest to 2269511 (#12409) 2025-03-23 22:14:16 -04:00
renovate[bot] 619e300025
Update Swatinem/rust-cache digest to 9d47c6a (#12408) 2025-03-23 22:14:10 -04:00
Maxime ec997b6fd2
Update PyTorch/Python version tip (#12402)
PyTorch 2.6.0 supports Python 3.13, and publishes wheels for it. Update
the tip to reflect this.


## Summary

Clarify docs.

## Test Plan

Look for "cp313" at the following URLs:
- [x] https://download.pytorch.org/whl/cu124/torch/
- [x] https://download.pytorch.org/whl/torch/
2025-03-23 17:23:08 -04:00
Zanie Blue 2b1d50a5ab
Fix log message for `SIGTERM` when child has exited (#12400) 2025-03-23 09:35:11 -04:00
konsti fb1b3232e8
Support modules with different casing in build backend (#12240)
Match the module name to its module directory with potentially different
casing.

For example, a package may have the dist-info-normalized package name
`pil_util`, but the importable module is named `PIL_util`.

We get the module name either as dist-info-normalized package name, or
explicitly from the user. For dist-info-normalizing a package name, the
rules are lowercasing, replacing `.` with `_` and replace `-` with `_`.
Since `.` and `-` are not allowed in module names, we can check whether
a directory name matches our expected module name by lowercasing it.

Fixes #12187

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2025-03-23 13:29:21 +00:00
Charlie Marsh 9af989e30c
Extract a single-index fetch in flat index client (#12394) 2025-03-23 09:07:19 -04:00
Charlie Marsh 2250ddedbf
Ignore `--find-links` entries for pinned indexes (#12396)
## Summary

In general, we merge `--find-links` entries into each index. If a
package is pinned to an index, though, it seems surprising (and wrong)
that we'd ever select a distribution from `--find-links`. This PR
modifies the provider to ignore `--find-links` for any explicitly pinned
packages.
2025-03-23 08:46:36 -04:00
Zanie Blue 869457890a
Add support for pre-releases to Python platform key regex (#12380)
Needed for more test cases on top of #12374
2025-03-23 03:19:04 +00:00
Zanie Blue ec499807f8
Add support for Python version requests in `uv python list` (#12375)
Allows `uv python list <request>` to filter the installed list. I often
want this and it's not hard to add.

I tested the remote download filtering locally (#12381 is needed for
snapshot tests)

```
❯ cargo run -q -- python list --all-versions 3.13
cpython-3.13.2-macos-aarch64-none    <download available>
cpython-3.13.1-macos-aarch64-none    /opt/homebrew/opt/python@3.13/bin/python3.13 -> ../Frameworks/Python.framework/Versions/3.13/bin/python3.13
cpython-3.13.1-macos-aarch64-none    <download available>
cpython-3.13.0-macos-aarch64-none    /Users/zb/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/bin/python3.13
❯ cargo run -q -- python list --all-versions 3.13 --only-installed
cpython-3.13.1-macos-aarch64-none    /opt/homebrew/opt/python@3.13/bin/python3.13 -> ../Frameworks/Python.framework/Versions/3.13/bin/python3.13
cpython-3.13.0-macos-aarch64-none    /Users/zb/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/bin/python3.13
```
2025-03-23 03:13:58 +00:00
kenwoodjw cdd6de555b
docs: Update dependencies.md (#12388)
<!--
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
Fixes #12334
<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

<!-- How was it tested? -->
2025-03-22 22:06:11 -05:00
Zanie Blue 15bf83ced8
Add comments to the `with_filtered_python_keys` regex (#12379)
I need to edit this thing and it's a nightmare as written.

See https://github.com/astral-sh/uv/pull/12380
2025-03-22 21:57:15 -05:00
Zanie Blue f80003a61b
Add `uv python list` test cases (#12374)
Needed for 

- https://github.com/astral-sh/uv/pull/12367
- https://github.com/astral-sh/uv/pull/12375
2025-03-22 21:57:07 -05:00
Charlie Marsh bbf4f830b5
Remove flat index client's dependency on registry client (#12393)
## Summary

I want to use the flat index client from within the registry client, so
making them both depend on the same underlying primitives rather than
having the flat index client depend on the registry client.
2025-03-22 18:14:25 +00:00
Charlie Marsh ed0759fb45
Omit wheels from lockfile based on `--exclude-newer` (#12299)
## Summary

We respect `--exclude-newer` during resolution, but we weren't applying
it to individual _files_ when writing the lockfile. As a result, if
wheels were added to a distribution after its initial release, we'd end
up including them in the lockfile, even if they were uploaded after the
`--exclude-newer` date.

Closes https://github.com/astral-sh/uv/issues/12296.
2025-03-22 12:27:11 -04:00
Charlie Marsh 7ac6c6963d
Allow virtual packages with `--no-build` (#12314)
## Summary

Closes #12311.
2025-03-22 12:00:02 -04:00
Charlie Marsh 149102a4e7
Use a boxed slice for extras and groups (#12391)
## Summary

A very common struct, and these are immutable. Easy to optimize.
2025-03-22 11:53:36 -04:00
Charlie Marsh 4215d0e16b
Check all compatible torch indexes when `--torch-backend` is enabled (#12385)
## Summary

It's possible that the PyTorch version the user depends on isn't in the
latest index. These indexes are equally trusted, so we should override
the policy.

Closes #12357.
2025-03-22 11:53:23 -04:00
Charlie Marsh 59c6d34b59
Omit fragment when querying for wheels in Simple HTML API (#12384)
## Summary

Closes https://github.com/astral-sh/uv/issues/12383.
2025-03-22 11:36:50 -04:00
Charlie Marsh 2b3d6fd7b6
Support `.env` files in `uv tool run` (#12386)
## Summary

Closes https://github.com/astral-sh/uv/issues/12371.
2025-03-22 11:36:42 -04:00
Zanie Blue 42a87da857
Update some Python find tests to use filters (#12377) 2025-03-21 18:44:30 +00:00
Zanie Blue 2592e0ff1a
Update `python_required_python_major_minor` with note about Homebrew (#12378)
Resolves
https://github.com/astral-sh/uv/pull/12377#discussion_r2008114043
2025-03-21 18:35:53 +00:00
Ahmed Ilyas a80353de2b
Add `uv sync --check` flag (#12342)
## Summary

Closes #12338 

## Test Plan

`cargo test`

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-03-21 15:48:27 +00:00
Aria Desires 26d40cb8a5
Restore "Support `python find --script` (#11891)"
Let's see if this reproduces in a PR now...

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-03-21 10:31:43 -05:00