astral-uv:zb/amazon

Last commit made on 2024-03-13
Get this branch:
git clone -b zb/amazon https://git.launchpad.net/astral-uv

Branch merges

Branch information

Name:
zb/amazon
Repository:
lp:astral-uv

Recent commits

db6280e... by Zanie Blue <email address hidden>

Add system install test for Amazon Linux

43dc9c8... by Charlie Marsh <email address hidden>

Bump version to v0.1.18 (#2398)

3799862... by Charlie Marsh <email address hidden>

Trim injected `python_version` marker to (major, minor) (#2395)

## Summary

Per [PEP 508](https://peps.python.org/pep-0508/), `python_version` is
just major and minor:

![Screenshot 2024-03-12 at 5 15
09 PM](https://github.com/astral-sh/uv/assets/1309177/cc3b8d65-dab3-4229-aed7-c6fe590b8da0)

Right now, we're using the provided version directly, so if it's, e.g.,
`-p 3.11.8`, we'll inject the wrong marker. This was causing `pandas` to
omit `numpy` when `-p 3.11.8` was provided, since its markers look like:

```
Requires-Dist: numpy<2,>=1.22.4; python_version < "3.11"
Requires-Dist: numpy<2,>=1.23.2; python_version == "3.11"
Requires-Dist: numpy<2,>=1.26.0; python_version >= "3.12"
```

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

00ec993... by Zanie Blue <email address hidden>

Fix bug where `--no-binary :all:` prevented build of editable packages (#2393)

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

7220894... by Charlie Marsh <email address hidden>

Expand environment variables prior to detecting scheme (#2394)

## Summary

This PR ensures that we expand environment variables _before_ sniffing
for the URL scheme (e.g., `file://` vs. `https://` vs. something else).

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

3bf20f9... by Charlie Marsh <email address hidden>

Use local package instead of `transitive_url_dependency.zip` (#2396)

90a60bc... by konstin

Update pubgrub (#2384)

Rebase pubgrub onto upstream changes, reducing our divergencies with
upstream.

659f412... by Zanie Blue <email address hidden>

Add system install test for alpine (#2371)

28bf493... by Zanie Blue <email address hidden>

Do not bump the minor version on breaking changes (#2376)

... yet.

I think we're not quite ready for a versioning policy over here. Now
that we have a "labeled" breaking change in #2362 we need to decide if
it should be a minor or patch version.

79ac3a2... by Charlie Marsh <email address hidden>

Wait for request stream to flush before returning resolution (#2374)

## Summary

This is a more robust fix for
https://github.com/astral-sh/uv/issues/2300.

The basic issue is:

- When we resolve, we attempt to pre-fetch the distribution metadata for
candidate packages.
- It's possible that the resolution completes _without_ those pre-fetch
responses. (In the linked issue, this was mainly because we were running
with `--no-deps`, but the pre-fetch was causing us to attempt to build a
package to get its dependencies. The resolution would then finish before
the build completed.)
- In that case, the `Index` will be marked as "waiting" for that
response -- but it'll never come through.
- If there's a subsequent call to the `Index`, to see if we should fetch
or are waiting for that response, we'll end up waiting for it forever,
since it _looks_ like it's in-flight (but isn't). (In the linked issue,
we had to build the source distribution for the install phase of `pip
install`, but `setuptools` was in this bad state from the _resolve_
phase.)

This PR modifies the resolver to ensure that we flush the stream of
requests before returning. Specifically, we now `join` rather than
`select` between the resolution and request-handling futures.

This _could_ be wasteful, since we don't _need_ those requests, but it
at least ensures that every `.wait` is followed by ` .done`. In
practice, I expect this not to have any significant effect on
performance, since we end up using the pre-fetched distributions almost
every time.

## Test Plan

I ran through the test plan from
https://github.com/astral-sh/uv/pull/2373, but ran the build 10 times
and ensured it never crashed. (I reverted
https://github.com/astral-sh/uv/pull/2373, since that _also_ fixes the
issue in the proximate case, by never fetching `setuptools` during the
resolve phase.)

I also added logging to verify that requests are being handled _after_
the resolution completes, as expected.

I also introduced an arbitrary error in `fetch` to ensure that the error
was immediately propagated.