Commit graph

2490 commits

Author SHA1 Message Date
Charlie Marsh
47db418ba2
Bump version to v0.2.5 (#3885) 2024-05-28 18:05:32 +00:00
Charlie Marsh
78c43c6a7a
Move editable discovery behind --preview for now (#3884)
## Summary

Just reduces the risk of shipping stable regressions for now.
2024-05-28 17:54:25 +00:00
konsti
f92447772e
Support x86 windows (#3873)
Add trampolines for x86 windows.

Closes https://github.com/astral-sh/uv/issues/3660.
2024-05-28 16:07:39 +00:00
Charlie Marsh
cedd18e4c6
Remove some unused pub functions (#3872)
## Summary

I wrote a bad Python script to find these.
2024-05-28 15:58:13 +00:00
Charlie Marsh
1fc6a59707
Remove special-casing for editable requirements (#3869)
## Summary

There are a few behavior changes in here:

- We now enforce `--require-hashes` for editables, like pip. So if you
use `--require-hashes` with an editable requirement, we'll reject it. I
could change this if it seems off.
- We now treat source tree requirements, editable or not (e.g., both `-e
./black` and `./black`) as if `--refresh` is always enabled. This
doesn't mean that we _always_ rebuild them; but if you pass
`--reinstall`, then yes, we always rebuild them. I think this is an
improvement and is close to how editables work today.

Closes #3844.

Closes #2695.
2024-05-28 15:49:34 +00:00
konsti
063a0a4384
Add context to failed uv tool run (#3882)
These are not covered by `fs_err` and a missing binary otherwise only
give a generic "file not found" error.
2024-05-28 14:48:54 +00:00
Tim de Jager
b12b25db10
fix: remove unused Result in uv-cache (#3875)
## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
It removes the unused result when creating the Cache with the
`from_path` constructor. I don't believe it does any io operations any
more at least.
2024-05-28 09:19:08 +00:00
konsti
a89e146107
Initial workspace support (#3705)
Add workspace support when using `-r <path>/pyproject.toml` or `-e
<path>` in the pip interface. It is limited to all-editable
static-metadata workspaces, and tests only include a single main
workspace, ignoring path dependencies in another workspace. This can be
considered the MVP for workspace support: You can create a workspace,
you can install from it, but some options and conveniences are still
missing. I'll file follow-up tickets (support in lockfiles, support path
deps in other workspace, #3625)

There is also support in `uv run`, but we need
https://github.com/astral-sh/uv/issues/3700 first to properly support
using different current projects in the bluejay interface, currently the
resolution and therefore the lockfile depends on the current project.
I'd do this change first (it's big enough already), then #3700, and then
add workspace support properly to bluejay.

Fixes #3404
2024-05-28 07:41:53 +00:00
Charlie Marsh
89cfecea77
Add support for prepare_metadata_for_build_editable hook (#3870)
## Summary

See:
https://peps.python.org/pep-0660/#prepare-metadata-for-build-editable
2024-05-27 23:21:45 +00:00
Charlie Marsh
22dbc79994
Use consistent argument ordering for Dist conversions (#3868) 2024-05-27 19:48:58 +00:00
Charlie Marsh
3c61eabd9d
Remove unnecessary ::try_from (#3867)
## Summary

I didn't realize this even worked? We only define a `From` for this
conversion.
2024-05-27 15:18:20 -04:00
Tim de Jager
65b17f6e81
feat: bump pep580 and pep440 types (#3860)
This bumps the versions of pep580 and pep440 to coincide with the
crates.io versions. While not strictly the same, the new types in uv us
an `Inner` struct. Practically I've found I'm still able to use the
patched versions, as can seen from the open PR here:
https://github.com/prefix-dev/pixi/pull/1436.

Would be great if this bump can be done so we can keep combining the
types :)
2024-05-27 09:38:39 +02:00
Zanie Blue
66eb642938
Add test context utility to uv-interpreter (#3832)
Follow-up to https://github.com/astral-sh/uv/pull/3797 to clean up the
test isolation in `uv-interpreter`.

I still want to expose a CLI at some point like `uv python <...>` for
discovery and test from there, hopefully this will make that transition
simpler.
2024-05-27 04:17:49 +00:00
Charlie Marsh
14fa49b7ba
Move availability enums into their own module (#3858) 2024-05-27 00:12:53 -04:00
Zanie Blue
31b0ff6373
Gate discovery of managed toolchains with preview (#3835)
Prepares for merge of https://github.com/astral-sh/uv/pull/3797, gating
managed toolchain discovery with the preview flag to lower risk of
releasing.

e.g.

```
❯ cargo dev -q fetch-python         
❯ cargo run -q -- venv --python 3.11
Using Python 3.11.9 interpreter at: /opt/homebrew/opt/python@3.11/bin/python3.11
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate
❯ cargo run -q -- venv --preview --python 3.11
Using Python 3.11.7 interpreter at: /Users/zb/Library/Application Support/uv/toolchains/cpython-3.11.7-macos-aarch64-none/install/bin/python3
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate
```

We'll add automatic fetching of managed interpreters later.
2024-05-27 04:05:19 +00:00
Zanie Blue
30e780e1dd
Add persistent storage of installed toolchains (#3797)
Extends #3726 

Moves toolchain storage out of `UV_BOOTSTRAP_DIR` (`./bin`) into the
proper user data directory as defined by #3726.

Replaces `UV_BOOTSTRAP_DIR` with `UV_TOOLCHAIN_DIR` for customization.
Installed toolchains will be discovered without opt-in, but the idea is
still that these are not yet user-facing.
2024-05-27 03:54:49 +00:00
Charlie Marsh
4191c331a7
Update bundled Python URLs and add "arm" architecture variant (#3855)
## Summary

This also adds filtering for the ARM Pythons, since that needs some libc
changes; and it closes https://github.com/astral-sh/uv/issues/3854 by
way of adding an "arm" branch.
2024-05-26 23:33:08 -04:00
Charlie Marsh
61ed0c82ed
Remove unused Platform enum (#3856) 2024-05-26 23:21:56 -04:00
renovate[bot]
89daa58458
Update Rust crate hyper-util to v0.1.4 (#3847) 2024-05-27 01:25:23 +00:00
Ibraheem Ahmed
7dc322665c
Concurrent progress bars (#3252)
## Summary

Implements concurrent progress bars. Resolves
https://github.com/astral-sh/uv/issues/1209.

## Test Plan

b21bdfbb-8817-4873-a65c-16c9e8c7c460
2024-05-27 01:21:07 +00:00
Charlie Marsh
70cbc32565
Remove tracing::log usage (#3853) 2024-05-27 01:03:28 +00:00
renovate[bot]
080f09586b
Update pre-commit dependencies (#3852) 2024-05-27 00:58:51 +00:00
renovate[bot]
e2971a7a4b
Update Rust crate tracing-tree to v0.3.1 (#3851) 2024-05-27 00:58:06 +00:00
renovate[bot]
3416f4247f
Update Rust crate serde to v1.0.203 (#3850) 2024-05-27 00:57:45 +00:00
renovate[bot]
2aba5867e7
Update Rust crate schemars to v0.8.21 (#3849) 2024-05-27 00:56:04 +00:00
renovate[bot]
57bb7a9507
Update Rust crate mimalloc to v0.1.42 (#3848) 2024-05-27 00:54:38 +00:00
Charlie Marsh
34e1cc8dd4
Use --exclude-newer in some pip sync tests (#3846)
## Summary

Saw a bunch of failures in
2543579113
due to `anyio` publishing v0.4.4.
2024-05-27 00:41:18 +00:00
Zanie Blue
98652e3954
Bump version to 0.2.4 (#3840) 2024-05-26 12:11:15 -05:00
konsti
f4533c3a85
Ignore libc on other platforms (#3825)
Libc variants are only relevant on linux, we can ignore it on non
{linux, windows, mac}, e.g. BSDs.

Closes #3824
2024-05-25 10:05:10 +00:00
Charlie Marsh
c2931e806d
Remove discovery group from CLI (#3830)
## Summary

Allows, e.g., `UV_SYSTEM_PYTHON=false uv pip install --python
.venv/bin/python`.

This was intended to work after fixing
https://github.com/astral-sh/uv/issues/3000, but I think I misdiagnosed
the scope when closing that issue, and the linked PR there only fixed
some _other_ problems around index URLs.

The only thing we really lose here is we no longer error when
`--break-system-packages` is provided without `--system`, but we can
enforce that elsewhere if we want.

Closes https://github.com/astral-sh/uv/issues/3829.
2024-05-24 19:03:44 +00:00
Charlie Marsh
6682765630
Require pinned version in Preference type (#3828)
## Summary

This PR makes a variety of invalid states unrepresentable by changing
`Preference` to require a `PackageName` and `Version`, rather than
accepting a generic `Requirement`. There should be no meaningful
behavior changes.
2024-05-24 18:48:36 +00:00
Zanie Blue
ce4d862b06
Bump version to 0.2.3 (#3827) 2024-05-24 13:19:28 -05:00
Charlie Marsh
688f4f43d4
Ignore unnamed requirements in preferences (#3826)
## Summary

We actually _already_ ignore these (preferences only apply to versions,
not URLs), it just happens later on. This PR thus just avoids crashing.
The behavior is unchanged.

Closes #3822.
2024-05-24 17:32:20 +00:00
Zanie Blue
674d167a50
Fix interpreter cache collisions for relative virtualenv paths (#3823)
Closes #3784

The cache did not use an absolute path. I'm not sure this is actually a
new bug, as this code wasn't touched in #3266 but perhaps there was a
slight difference in the paths we were passing around. Note, just
canonicalizing the path as soon as we see it doesn't work because then
we jump out of the virtual environmnent into the system interpreter.

## Test plan

```
❯ uv venv
Using Python 3.12.3 interpreter at: /opt/homebrew/opt/python@3.12/bin/python3.12
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate
❯ uv pip install anyio
Resolved 3 packages in 81ms
Installed 3 packages in 4ms
 + anyio==4.3.0
 + idna==3.7
 + sniffio==1.3.1
❯ mkdir uv-issue-3784 && cd uv-issue-3784
❯ uv venv
Using Python 3.12.3 interpreter at: /opt/homebrew/opt/python@3.12/bin/python3.12
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate

❯ gcm
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
❯ cargo run -q -- pip list -v -p .venv
DEBUG Checking for Python interpreter in directory `.venv`
TRACE Cached interpreter info for Python 3.12.3, skipping probing: .venv/bin/python3
DEBUG Using Python 3.12.3 environment at .venv/bin/python3
Package Version
------- -------
anyio   4.3.0
idna    3.7
sniffio 1.3.1
❯ cd uv-issue-3784
❯ cargo run -q -- pip list -v -p .venv
DEBUG Checking for Python interpreter in directory `.venv`
TRACE Cached interpreter info for Python 3.12.3, skipping probing: .venv/bin/python3
DEBUG Using Python 3.12.3 environment at /Users/zb/workspace/uv/.venv/bin/python3
Package Version
------- -------
anyio   4.3.0
idna    3.7
sniffio 1.3.1

❯ cd ..
❯ gco zb/fix-relative-venv
Switched to branch 'zb/fix-relative-venv'
❯ cargo run -q -- pip list -v -p .venv
DEBUG Checking for Python interpreter in directory `.venv`
TRACE Cached interpreter info for Python 3.12.3, skipping probing: .venv/bin/python3
DEBUG Using Python 3.12.3 environment at .venv/bin/python3
Package Version
------- -------
anyio   4.3.0
idna    3.7
sniffio 1.3.1
❯ cd uv-issue-3784
❯ cargo run -q -- pip list -v -p .venv
DEBUG Checking for Python interpreter in directory `.venv`
TRACE Cached interpreter info for Python 3.12.3, skipping probing: .venv/bin/python3
DEBUG Using Python 3.12.3 environment at .venv/bin/python3
```
2024-05-24 11:18:49 -05:00
Charlie Marsh
999d072ae9
Always include package names for Git and HTTPS dependencies (#3821)
## Summary

Related to https://github.com/astral-sh/uv/issues/3818. We should
_always_ include the package name if we know it's not a file path, even
if it starts with an environment variable.
2024-05-24 14:01:38 +00:00
Charlie Marsh
73f67089e1
Add JSON alias for unsafe-any-match (#3820)
Closes https://github.com/astral-sh/uv/issues/3819.
2024-05-24 13:31:46 +00:00
Zanie Blue
c2a58cd303
Add integration test for GitHub Actions CI patterns (#3805) 2024-05-23 23:25:06 -05:00
Charlie Marsh
8d566e553d
Use a cross-platform representation for relative paths in pip compile (#3804)
## Summary

I haven't tested on Windows yet, but the idea here is that we should use
a portable representation when printing paths.

I decided to limit the scope here to paths that we write to output
files.

Closes https://github.com/astral-sh/uv/issues/3800.
2024-05-24 03:02:42 +00:00
Charlie Marsh
a7d486bc71
Move render-benchmarks under a Cargo feature (#3815)
## Summary

Avoid compiling these large dependencies when we typically don't need
them.
2024-05-24 03:00:53 +00:00
Charlie Marsh
ce38fccdc9
Remove tracing-indicatif dependency (#3816)
## Summary

It's only used in `uv-dev`; can restore later if important.
2024-05-24 02:59:26 +00:00
Charlie Marsh
dd27f2f710
Make anyhow a dev dependency in uv-configuration (#3814) 2024-05-24 02:49:31 +00:00
Charlie Marsh
e8e826949d
Remove WerkZeug source builds from tests (#3813) 2024-05-24 02:16:34 +00:00
Charlie Marsh
c25a6f08cd
Remove anyio source builds from hash tests (#3812) 2024-05-24 01:51:59 +00:00
Charlie Marsh
c7b9823b64
Remove ujson test (#3811)
## Summary

I believe this is tested by the following test
(`install_build_system_no_backend`), which seems to have identical
constraints.

Closes #3743.
2024-05-24 01:40:30 +00:00
Charlie Marsh
6860b04f28
Remove anyio Git builds from tests (#3810) 2024-05-24 01:33:24 +00:00
Charlie Marsh
e654c62e2e
Remove bz2 builds from tests (#3809) 2024-05-23 21:26:41 -04:00
Charlie Marsh
585146391a
Remove tqdm builds from tests (#3808) 2024-05-24 01:17:45 +00:00
Charlie Marsh
a02e225eec
Remove werkzeug Git builds from tests (#3806) 2024-05-23 21:17:07 -04:00
Charlie Marsh
710c11c6ad
Remove future builds from tests (#3807) 2024-05-24 01:09:39 +00:00
Zanie Blue
99b8633ce3
Search for python3 in unix virtual environments (#3798) 2024-05-23 19:33:34 -05:00