astral-uv:zb/system-install

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

Branch merges

Branch information

Name:
zb/system-install
Repository:
lp:astral-uv

Recent commits

7f2e85d... by Zanie Blue <email address hidden>

Automatically run system install tests on labeled pull requests and main

9e2d155... by Charlie Marsh <email address hidden>

Add a custom suggestion to install wheel into the build environment (#2307)

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

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

Avoid using setuptools shim of distutils (#2305)

## Summary

It turns out that setuptools includes a shim to patch distutils. I'll
admit that I don't fully understand why or how it's different, but this
is the trick `pip` uses to ensure that it gets the "original" distutils.

We actually use distutils in two places: once for the system Python
scheme, and once for virtual environments. In virtualenv, they _do_ use
the patched distutils, so this could deviate in ways I don't understand.

Closes #2302.

10c4eff... by Zanie Blue <email address hidden>

Refactor incompatiblity tracking for distributions (#1298)

Extends the "compatibility" types introduced in #1293 to apply to source
distributions as well as wheels.

- We now track the most-relevant incompatible source distribution
- Exclude newer, Python requirements, and yanked versions are all
tracked as incompatibilities in the new model (this lets us remove
`DistMetadata`!)

1181aa9... by wim glenn

Added ability to select bytecode invalidation mode of generated .pyc (#2297)

Since Python 3.7, deterministic pycs are possible (see [PEP
552](https://peps.python.org/pep-0552/))
To select the bytecode invalidation mode explicitly by env var:

    PYC_INVALIDATION_MODE=UNCHECKED_HASH uv pip install --compile ...

Valid values are TIMESTAMP (default), CHECKED_HASH, and UNCHECKED_HASH.
The latter options are useful for reproducible builds.

---------

Co-authored-by: konstin <email address hidden>

2e9678e... by Charlie Marsh <email address hidden>

Add support for Metadata 2.2 (#2293)

## Summary

PyPI now supports Metadata 2.2, which means distributions with Metadata
2.2-compliant metadata will start to appear. The upside is that if a
source distribution includes a `PKG-INFO` file with (1) a metadata
version of 2.2 or greater, and (2) no dynamic fields (at least, of the
fields we rely on), we can read the metadata from the `PKG-INFO` file
directly rather than running _any_ of the PEP 517 build hooks.

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

41c911f... by Andrew Gallant <email address hidden>

uv-fs: fix Windows path literals

This was causing `cargo test --doc` to fail for me locally.

b3b5afa... by Andrew Gallant <email address hidden>

uv-fs: transparently support reading UTF-16 files

This PR tweaks uv to support reading `requirements.txt` regardless of
whether it is encoded as UTF-8 or UTF-16. This is particularly relevant
on Windows where `uv pip freeze > requirements.txt` will likely write a
UTF-16 encoded `requirements.txt` file.

There is some discussion on #1666 where it's suggested that perhaps
we should explicitly not support this. I didn't see that until I
had already put this PR together, but even so, I think it's worth
considering this. UTF-16 is predominant on Windows. It is very easy
to produce a UTF-16 encoded file. Moreover, there is an easy and well
specified way to recognize and transcode UTF-16 encoded data to UTF-8.

I think the downside of this is that it could encourage the use UTF-16
encoded `requirements.txt` files *in addition* to UTF-8 encoded
files, and it would probably be nice to converge and standardize on
one encoding. One possible alternative to this PR is that we provide
a better error message. Another alternative is to ensure that a
`-o/--output` flag exists for all commands (neither `uv pip freeze` nor
`pip freeze` have such a flag) so that users can always write output
to a file without relying on their environment's piping behavior.
(Although this last alternative seems a little sad to me.)

It's also worth noting the [PEP-0508] doesn't seem to mention file
encoding at all. So I think from a "do the standards allow this"
perspective, this change is OK.

Finally, `pip` itself seems to work with UTF-16 encoded
`requirements.txt` files.

I think I personally overall lean towards supporting UTF-16 for
`requirements.txt` files. In part because I think it smoothes out the
UX a little bit, in part because there is no obvious specification
(that I'm aware of) that mandates that these files are UTF-8, and
finally in part because `pip` supports it too.

Fixes #1666, Fixes #2276

[PEP-0508]: https://peps.python.org/pep-0508/

ef806dc... by Zhan Rongrui <email address hidden>

🧹 chore: refactor pip_list function to trim end of joined elements (#2298)

<!--
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
refactor pip_list function to trim end of joined elements

fixed: https://github.com/astral-sh/uv/issues/2296

<!-- How was it tested? -->

8a80709... by Charlie Marsh <email address hidden>

Encapsulate header parsing for metadata files (#2295)