Commit Graph

7187 Commits

Author SHA1 Message Date
Sławomir Ehlert f1630a70f5
Suppress `MultipleHandlers` from Ctrl-C in confirm (#2903)
## Summary

Fixes #2900

## Test Plan

Tried reproducing the steps described in #2900,
but with `cargo run -- pip ...` and it didn't crash 😄.
2024-04-08 17:18:53 +00:00
Charlie Marsh 10dfd43af9
DRY up HTTP request builder in source database (#2902) 2024-04-08 14:45:26 +00:00
Charlie Marsh f11a5e2208
DRY up local wheel path in distribution database (#2901) 2024-04-08 10:40:17 -04:00
konsti fb4ba2bbc2
Speed up cold cache urllib3/boto3/botocore with batched prefetching (#2452)
With pubgrub being fast for complex ranges, we can now compute the next
n candidates without taking a performance hit. This speeds up cold cache
`urllib3<1.25.4` `boto3` from maybe 40s - 50s to ~2s. See docstrings for
details on the heuristics.

**Before**


![image](https://github.com/astral-sh/uv/assets/6826232/b7b06950-e45b-4c49-b65e-ae19fe9888cc)

**After**


![image](https://github.com/astral-sh/uv/assets/6826232/1c749248-850e-49c1-9d57-a7d78f87b3aa)

---

We need two parts of the prefetching, first looking for compatible
version and then falling back to flat next versions. After we selected a
boto3 version, there is only one compatible botocore version remaining,
so when won't find other compatible candidates for prefetching. We see
this as a pattern where we only prefetch boto3 (stack bars), but not
botocore (sequential requests between the stacked bars).


![image](https://github.com/astral-sh/uv/assets/6826232/e5186800-23ac-4ed1-99b9-4d1046fbd03a)

The risk is that we're completely wrong with the guess and cause a lot
of useless network requests. I think this is acceptable since this
mechanism only triggers when we're already on the bad path and we should
simply have fetched all versions after some seconds (assuming a fast
index like pypi).

---

It would be even better if the pubgrub state was copy-on-write so we
could simulate more progress than we actually have; currently we're
guessing what the next version is which could be completely wrong, but i
think this is still a valuable heuristic.

Fixes #170.
2024-04-08 14:28:56 +00:00
renovate[bot] 47333c985b
Update Rust crate tokio to v1.37.0 (#2886) 2024-04-08 09:35:00 -04:00
renovate[bot] e3ebd4de10
Update debian Docker tag to v12 (#2896) 2024-04-08 09:34:48 -04:00
Zanie Blue e5ea1785ff
Renovate: Group updates to development dependencies (#2888)
I don't think we need to audit these individually since they're not
user-facing.
2024-04-08 07:21:50 +01:00
Zanie Blue b181907ad2
Fix linehaul tests (#2891)
Cleans up the assertions a bit. I looked into snapshot tests per #2564
but it didn't seem worth it for cross-platform tests.

Closes #2564 
Closes https://github.com/astral-sh/uv/pull/2878
2024-04-07 23:42:19 -05:00
renovate[bot] 356a26646c
Update fedora Docker tag to v41 (#2898) 2024-04-07 23:41:49 -05:00
renovate[bot] aa7760534f
Update dependency ubuntu to v22 (#2897) 2024-04-07 23:41:22 -05:00
renovate[bot] 31813f90c7
Update pre-commit dependencies (#2893) 2024-04-08 04:35:44 +00:00
renovate[bot] 61e06bb2c3
Update Rust crate rayon to v1.10.0 (#2880) 2024-04-07 22:54:40 -05:00
renovate[bot] a866cb2f32
Update Rust crate insta to v1.38.0 (#2877) 2024-04-07 22:54:16 -05:00
renovate[bot] f0c83a4ded
Update Rust crate base64 to 0.22.0 (#2874) 2024-04-08 03:02:35 +00:00
Charlie Marsh 52577892eb
Expand some documentation around identifier traits (#2876)
## Summary

I already added more documentation since this issue was created, but
this doesn't hurt.

Closes https://github.com/astral-sh/uv/issues/496.
2024-04-08 02:50:24 +00:00
Charlie Marsh e109e02b12
Expand documentation in `scripts/bench/__main__.py` (#2875)
Closes https://github.com/astral-sh/uv/issues/1318.
2024-04-08 02:48:12 +00:00
renovate[bot] f5334a4914
Update Rust crate which to v6.0.1 (#2873) 2024-04-07 22:38:15 -04:00
renovate[bot] 74371ede8d
Update Rust crate tokio-stream to v0.1.15 (#2872) 2024-04-07 22:37:59 -04:00
renovate[bot] a4bbe6602f
Update Rust crate serde_json to v1.0.115 (#2871) 2024-04-07 22:37:51 -04:00
renovate[bot] 56555b9911
Update Rust crate indexmap to v2.2.6 (#2868) 2024-04-07 22:37:39 -04:00
renovate[bot] 78d64bfc86
Update Rust crate axoupdater to v0.3.6 (#2866) 2024-04-08 02:29:03 +00:00
renovate[bot] 14ef0e044c
Update Rust crate regex to v1.10.4 (#2870) 2024-04-08 02:28:47 +00:00
renovate[bot] 8e7f9b18c5
Update Rust crate git2 to v0.18.3 (#2867) 2024-04-08 02:28:21 +00:00
renovate[bot] d34c90150d
Update Rust crate async-compression to v0.4.8 (#2865) 2024-04-08 02:28:04 +00:00
Zanie Blue b535d252c9
Fix base client builder docstring reference (#2860) 2024-04-07 16:16:13 +00:00
Jelle Zijlstra a217752cac
PIP_COMPATIBILITY.md: typo fixes (#2859) 2024-04-07 12:34:02 +00:00
Charlie Marsh 424d7ab610
Sort and expand target triples in Cargo.toml (#2858)
## Summary

Too hard to read as-is.
2024-04-07 03:25:54 +00:00
Charlie Marsh d4a258422b
DRY up request builer in wheel download (#2857) 2024-04-07 02:12:03 +00:00
Charlie Marsh a3de0e8bc6
Include LICENSE files in source distribution (#2855)
## Summary

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

## Test Plan

Ran `maturin sdist`:

![Screenshot 2024-04-06 at 8 08
38 PM](https://github.com/astral-sh/uv/assets/1309177/48ef10d2-407a-4280-b7c0-e38591a28317)
2024-04-07 00:42:30 +00:00
Charlie Marsh fee9657548
Only ignore `bin` directory at repo root (#2856)
Closes https://github.com/astral-sh/uv/issues/1304.
2024-04-07 00:36:41 +00:00
Charlie Marsh bfc4c1aa5a
Turn off text wrapping in non-scenario fixtures (#2854)
## Summary

We do this in the scenarios, but weren't setting it elsewhere.
2024-04-06 23:27:56 +00:00
Charlie Marsh 35940cb885
Remove additional 'because' (#2849)
## Summary

Is this, perhaps, not totally necessary? It doesn't show up in any
fixtures beyond those that I added recently.

Closes https://github.com/astral-sh/uv/issues/2846.
2024-04-06 10:58:23 -04:00
Charlie Marsh 8ffdcced0f
Use `miette` when printing `pip sync` resolution failures (#2848)
Closes https://github.com/astral-sh/uv/issues/2845.
2024-04-06 00:35:00 +00:00
Charlie Marsh 00934044aa
Backtrack on distributions with invalid metadata (#2834)
## Summary

Closes https://github.com/astral-sh/uv/issues/2821.
2024-04-05 18:00:48 -04:00
Zanie Blue f0b0e1943c
Update `fetch-version-metadata` to only require the stdlib (#2838) 2024-04-05 16:50:56 -05:00
Charlie Marsh c11e9e5097
Add backtracking tests for distribution incompatibilities (#2839)
## Summary

Demonstrates some suboptimal behavior in how we handle invalid metadata,
which are fixed in https://github.com/astral-sh/uv/pull/2834.

The included wheels were modified by-hand to include invalid structures.
2024-04-05 18:16:18 +00:00
Charlie Marsh cedb5e4aec
Add a test for `--offline` direct URLs (#2837) 2024-04-05 17:10:23 +00:00
Ikko Eltociear Ashimine 37225cb920
Fix a typo in source_tree.rs (#2836) 2024-04-05 17:53:09 +01:00
konsti 5474c61fed
Refactor candidate selector for batch prefetching (#2832)
Batch prefetching needs more information from the candidate selector, so
i've split `select` into methods. Split out from #2452. No functional
changes.
2024-04-05 16:51:01 +02:00
Charlie Marsh a0b8d1a994
Clean up `Error` enum in `Metadata23` (#2835)
## Summary

Rename, and remove a bunch of unused variants.
2024-04-05 14:40:33 +00:00
Charlie Marsh 2f386ef440
Show resolution diagnostics after `pip install` (#2829)
## Summary

These are shown in `pip compile`, but absent from `pip install`.

See: #2828.
2024-04-05 03:13:01 +00:00
Charlie Marsh 2ac562b40d
Respect `--no-build` and `--no-binary` in `--find-links` (#2826)
## Summary

In working on `--require-hashes`, I noticed that we're missing some
incompatibility tracking for `--find-links` distributions. Specifically,
we don't respect `--no-build` or `--no-binary`, so if we select a wheel
due to `--find-links`, we then throw a hard error when trying to build
it later (if `--no-binary` is provided), rather than selecting the
source distribution instead.

Closes https://github.com/astral-sh/uv/issues/2827.
2024-04-05 02:00:39 +00:00
Charlie Marsh 365cb16fd6
Bump version to v0.1.29 (#2825) 2024-04-04 15:50:52 -04:00
Charlie Marsh ab8368aa27
Deduplicate editables during install commands (#2820)
## Summary

Closes #2819.
2024-04-04 13:19:44 -04:00
Charlie Marsh 661787b0cb
Document that uv is safe to run concurrently (#2818)
Closes https://github.com/astral-sh/uv/issues/2730.
2024-04-04 04:33:25 +00:00
Charlie Marsh dd3009ad84
Respect Git tags and branches that look like short commits (#2795)
## Summary

If we're given a Git reference like `20240222`, we currently treat it as
a short commit hash. However... it _could_ be a branch or a tag. This PR
improves the Git reference logic to ensure that ambiguous references
like `20240222` are handled appropriately, by attempting to extract it
as a branch, then a tag, then a short commit hash.

Closes https://github.com/astral-sh/uv/issues/2772.
2024-04-03 22:05:54 -04:00
Charlie Marsh dc2c289dff
Upgrade `rs-async-zip` to support data descriptors (#2809)
## Summary

Upgrading `rs-async-zip` enables us to support data descriptors in
streaming. This both greatly improves performance for indexes that use
data descriptors _and_ ensures that we support them in a few other
places (e.g., zipped source distributions created in Finder).

Closes #2808.
2024-04-04 01:31:40 +00:00
Charlie Marsh 34341bd6e9
Allow package lookups across multiple indexes via explicit opt-in (#2815)
## Summary

This partially revives https://github.com/astral-sh/uv/pull/2135 (with
some modifications) to enable users to opt-in to looking for packages
across multiple indexes.

The behavior is such that, in version selection, we take _any_
compatible version from a "higher-priority" index over the compatible
versions of a "lower-priority" index, even if that means we might accept
an "older" version.

Closes https://github.com/astral-sh/uv/issues/2775.
2024-04-03 23:23:37 +00:00
Charlie Marsh e0d55ef496
Allow no-op `--no-compile` flag on CLI (#2816)
Closes https://github.com/astral-sh/uv/issues/2771.
2024-04-03 20:36:44 +00:00
Charlie Marsh 8eaaf65456
Avoid unused extras check in `pip install` for source trees (#2811)
## Summary

This was an oversight in the `-r pyproject.toml` refactor. We can't
enforce unused extras if we have a source tree. We made the correct
changes to `pip compile`, but not `pip install`. This PR just mirrors
those changes to `pip install`, and adds a few tests.

Closes https://github.com/astral-sh/uv/issues/2801.
2024-04-03 11:23:25 -04:00