Commit Graph

5276 Commits

Author SHA1 Message Date
Charlie Marsh
9ebd94cb93 Add tests for UrlString methods (#10256) 2024-12-31 19:16:08 +00:00
Charlie Marsh
cf88828e55 Avoid stripping query parameters from URLs (#10253)
## Summary

Closes https://github.com/astral-sh/uv/issues/10251.
2024-12-31 12:59:26 -05:00
Charlie Marsh
c77aa5820b Add a required version setting to uv (#10248)
## Summary

This follows Ruff's design exactly: you can provide a version specifier
(like `>=0.5`), and we'll enforce it at runtime.

Closes https://github.com/astral-sh/uv/issues/8605.
2024-12-31 15:37:46 +00:00
吴小白
a2f436f79b Add loongarch64 to supported Python platform tags (#10223) 2024-12-31 03:00:37 +00:00
Charlie Marsh
7f1ee9c6dd Accept directories with space names in uv init (#10246)
## Summary

Closes https://github.com/astral-sh/uv/issues/10245.
2024-12-30 21:05:00 -05:00
Charlie Marsh
dcd96a83aa Respect static metadata for already-installed distributions (#10242)
## Summary

Closes
https://github.com/astral-sh/uv/issues/10239#issuecomment-2565663046
2024-12-30 12:47:06 -05:00
Luca Leonardo Scorcia
dec6f5aa02 Initial support for ARMv5TE platform via cross compilation (#10234)
## Summary
Allows uv to recognize the ARMv5TE platform. This platform is currently
supported on Debian distributions. It is an older 32 bit platform mostly
used in embedded devices, currently in rust tier 2.5 so it requires
cross compilation.

Fixes #10157 .

## Test Plan
Tested directly on device by applying a slightly different patch to tag
0.5.4 which is used by the current Home Assistant version (2024.12.5).
After the patch Home Assistant is able to recognize the Python venv and
setup its dependencies.

Patched uv was built with 
```
$ CARGO_TARGET_ARMV5TE_UNKNOWN_LINUX_GNUEABI_LINKER="/usr/bin/arm-linux-gnueabi-gcc" maturin build --release --target armv5te-unknown-linux-gnueabi --manylinux off
``` 

The target wheel was then moved on the device and installed via pip
install.
2024-12-30 11:49:57 -05:00
renovate[bot]
0ea4f5f8b1 Update Rust crate syn to v2.0.93 (#10229) 2024-12-30 03:03:52 +00:00
renovate[bot]
78e246f043 Update Rust crate serde to v1.0.217 (#10228) 2024-12-30 02:56:19 +00:00
renovate[bot]
4623ab32be Update Rust crate jiff to v0.1.16 (#10226) 2024-12-30 02:55:16 +00:00
renovate[bot]
07f6596933 Update Rust crate glob to v0.3.2 (#10225) 2024-12-30 02:43:47 +00:00
renovate[bot]
19fc8865fb Update Rust crate boxcar to v0.2.8 (#10224) 2024-12-30 02:42:41 +00:00
Charlie Marsh
cecff3a726 Guard against self-deletion in uv venv and uv tool (#10206)
## Summary

Closes https://github.com/astral-sh/uv/issues/1327.
2024-12-29 10:46:45 -05:00
Charlie Marsh
4b5a89dbff Add manylinux2014 aliases for --python-platform (#10217)
## Summary

Closes https://github.com/astral-sh/uv/issues/10210.
2024-12-29 01:36:02 +00:00
Charlie Marsh
b316d780bf Consider workspace dependencies to be 'direct' (#10197)
## Summary

Closes https://github.com/astral-sh/uv/issues/7863.
2024-12-28 20:32:45 -05:00
Arnav Gupta
3733008e6c Add support for optional --description in uv init (#10209)
## Summary
Closes #7913 by adding an optional `--description` argument to `uv init`
that fills the description field in the pyproject.toml with the supplied
arg value.

Updated `uv init` docs to describe this new optional argument.
<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan
Added snapshot tests in `uv/crates/uv/tests/it/init.rs` to test this
functionality.
<!-- How was it tested? -->

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-12-28 00:06:51 +00:00
Domenico
8992f5524c fix: typo in uv main (#10205) 2024-12-27 13:43:00 -05:00
Charlie Marsh
1fb7f352b1 Add --outdated support to uv pip tree (#10199)
## Summary

Closes https://github.com/astral-sh/uv/issues/10181.
2024-12-27 17:03:06 +00:00
Charlie Marsh
49a2b6f85c Add --exact flag to uv run (#10198)
## Summary

`uv run --exact` will remove any unnecessary packages prior to running
the given command. (By default, `uv run` uses "inexact" semantics.)

Closes https://github.com/astral-sh/uv/issues/7838.
2024-12-27 16:43:30 +00:00
Charlie Marsh
0bc33e87b8 Patch pkgconfig files after Python install (#10189)
## Summary

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

## Test Plan

Ran `cargo run python install 3.10.15 --reinstall`; verified that
`python3.pc` contained:

```
# See: man pkg-config
prefix=/Users/crmarsh/.local/share/uv/python/cpython-3.10.15-macos-aarch64-none
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Python
Description: Build a C extension for Python
Requires:
Version: 3.10
Libs.private: -ldl   -framework CoreFoundation
Libs:
Cflags: -I${includedir}/python3.10
```
2024-12-27 00:50:41 +00:00
Charlie Marsh
4c49683f7b Bump version to v0.5.13 (#10188) 2024-12-26 23:58:13 +00:00
Charlie Marsh
2f5badddbb Avoid enforcing URL check on initial publish (#10182)
## Summary

Closes https://github.com/astral-sh/uv/issues/10174.
2024-12-26 23:46:36 +00:00
Charlie Marsh
b52d48973f Revert "Update reqwest (#10178)" (#10187)
This reverts commit d2f58d9299.

Closes https://github.com/astral-sh/uv/issues/10186
2024-12-26 23:40:24 +00:00
Charlie Marsh
d3f06de4f5 Fix incorrect mismatched constraints reference (#10184) 2024-12-26 23:25:38 +00:00
Charlie Marsh
351d602d86 Bump version to v0.5.12 (#10175) 0.5.12 2024-12-26 14:16:19 -05:00
Charlie Marsh
d2f58d9299 Update reqwest (#10178) 2024-12-26 14:16:12 -05:00
Charlie Marsh
b6697a777c Run cargo update (#10173) 2024-12-26 12:00:58 -05:00
Charlie Marsh
74112553bf Avoid cloning script when discovering interpreter (#10172) 2024-12-26 15:43:55 +00:00
Charlie Marsh
79dce7391e Avoid need for universal markers in requirements.txt export (#10171) 2024-12-26 15:32:32 +00:00
Charlie Marsh
0b5c0220b5 Allow environment variables to be included in cache keys (#10170)
## Summary

Closes https://github.com/astral-sh/uv/issues/8130.
2024-12-26 15:31:49 +00:00
Frost Ming
e6126ce0dc fix: always write slash paths to RECORD file (#10164)
Signed-off-by: Frost Ming <me@frostming.com>

<!--
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 PR solves an issue on Windows that platform-specific paths are
written to the `RECORD` file when installing, which is inconsistent with
PEP 376, quoting:

> Each record is composed of three elements:
>
>the file’s path
> * a ‘/’-separated path, relative to the base location, if the file is
under the base location.
> * a ‘/’-separated path, relative to the base location, if the file is
under the installation prefix AND if the base location is a subpath of
the installation prefix.
> * an absolute path, using the local platform separator

## Test Plan

<!-- How was it tested? -->
Test case included

---------

Signed-off-by: Frost Ming <me@frostming.com>
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-12-26 09:33:32 -05:00
Charlie Marsh
20df970a56 Nest setup code under unnamed requirements block (#10163) 2024-12-25 23:40:11 +00:00
Charlie Marsh
f40da39baf Store absolute paths in PEP 723 scripts (#10161) 2024-12-25 20:23:39 +00:00
Charlie Marsh
bec8468183 Remove unnecessary prefixes (#10158) 2024-12-25 14:18:01 -05:00
Charlie Marsh
3cb723220e Remove anyhow::Result for lock serialization (#10151) 2024-12-25 01:24:26 +00:00
Charlie Marsh
facd21a679 Replace Option<BTreeSet> with BTreeSet for members (#10150) 2024-12-25 00:37:46 +00:00
Charlie Marsh
f872b56124 Add a lock target abstraction (#10129)
## Summary

This PR introduces a `LockTarget`, which is peer to `InstallTarget` and
enables us to capture the common functionality necessary to support
locking.

For now, to minimize changes, only the `Workspace` target is
implemented. In a future PR, I'll add a `Script` target for both locking
and installing.
2024-12-24 19:26:31 -05:00
Charlie Marsh
7c47a457d9 Move installable targets out of uv-resolver crate (#10126)
## Summary

The proximate motivation is that I want to add new variant for scripts,
but `uv-resolver` can't depend on `uv-scripts` without creating a
circular dependency. However, I think this _does_ just make more sense
-- the resolver crate shouldn't be coupled to the various kinds of
workspaces, and these details are mostly encoded in `projects/lock.rs`
and similar files.
2024-12-24 19:01:50 -05:00
Charlie Marsh
6745a8b00a Show non-project dependencies in uv tree (#10149)
## Summary

Closes #10147.
2024-12-24 23:34:58 +00:00
Charlie Marsh
e09b1080f4 Store dependency groups separate from dependencies in lockfile (#10148)
## Summary

This is necessary for some future improvements to non-`[project]`
workspaces and PEP 723 scripts. It's not "breaking", but it will
invalidate lockfiles for non-`[project]` workspaces. I think that's
okay, since we consider those legacy right now, and they're really rare.
2024-12-24 17:32:29 -05:00
Charlie Marsh
3435777e87 Support uv export for non-project workspaces (#10144) 2024-12-24 15:23:28 +00:00
Charlie Marsh
ddde9481e3 Set glibc versions for standalone installers (#10142)
## Summary

Per Discord, it sounds like `cargo-dist` will assume that 2.31 is our
minimum glibc version, since we're building our own binaries. (You can
confirm this by looking at
[uv-installer.sh](https://github.com/astral-sh/uv/releases/download/0.5.11/uv-installer.sh).)

`cargo-dist` now supports specifying a glibc override for each target:
https://opensource.axo.dev/cargo-dist/book/reference/config.html#min-glibc-version.
This is great, since we use 2.17 everywhere, but 2.28 for ARM.
2024-12-24 08:35:28 -05:00
Charlie Marsh
f69f7610cc Update Cargo.lock (#10143)
## Summary

Must've been a bad rebase somewhere in Renovate?
2024-12-24 13:29:30 +00:00
Charlie Marsh
d1b1da5ac1 Upgrade cargo-dist to v0.27.0 (#10141)
## Summary

Required peer to https://github.com/astral-sh/uv/pull/10115.
2024-12-24 08:24:14 -05:00
renovate[bot]
7796a9cb3e Update Rust crate hyper to v1.5.2 (#10105) 2024-12-24 08:10:06 -05:00
renovate[bot]
5b3e54d9dd Update Rust crate axoupdater to 0.9.0 (#10115) 2024-12-24 08:09:13 -05:00
Charlie Marsh
473e274275 Rename requires-python validation method (#10133)
## Summary

I want to differentiate this from `validate_script_requires_python`.
2024-12-24 00:45:21 +00:00
Charlie Marsh
9279a125e9 Add a common abstraction to discover PEP 723 script interpreters (#10132)
## Summary

This logic is already repeated twice, and I'm on the verge of adding a
third.

(No behavioral changes.)
2024-12-24 00:29:37 +00:00
Charlie Marsh
6ed7302432 Move implementations next to definitions (#10131) 2024-12-23 19:16:48 -05:00
Mathieu Kniewallner
b24fb774b1 docs: fix invalid syntax in some sources examples (#10127)
## Summary

TOML 1.0 doesn't support multi-line for inline tables, so those examples
are invalid.
2024-12-23 16:12:45 -05:00