astral-uv:charlie/context

Last commit made on 2024-06-14
Get this branch:
git clone -b charlie/context https://git.launchpad.net/astral-uv

Branch merges

Branch information

Name:
charlie/context
Repository:
lp:astral-uv

Recent commits

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

Move concurrency settings to top-level

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

Use portable slash paths in lockfile (#4324)

## Summary

This would be a lightweight solution to
https://github.com/astral-sh/uv/issues/4307 that doesn't fully engage
with all the possibilities in the design space (but would unblock
cross-platform for now).

74c0568... by Charlie Marsh <email address hidden>

Add a derive macro for `Combine` (#4325)

## Summary

Saves us some boilerplate when adding settings in the future.

83067c1... by Charlie Marsh <email address hidden>

Reduce some `anyhow` usages (#4323)

7d9541d... by Charlie Marsh <email address hidden>

Add `--no-build`, `--no-build-package`, and binary variants (#4322)

## Summary

These are now supported on `uv run`, `uv lock`, `uv sync`, and `uv tool
run`.

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

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

Add a `--show-settings` option for configuration testing (#4304)

## Summary

The fixtures here are pretty large, but it lets us test what we actually
care about (the resolved settings) rather than inferring the resolved
settings from behavior, which I think is a big improvement.

I also broke the tests down into more granular cases.

1d6d98f... by Charlie Marsh <email address hidden>

Make `--reinstall`, `--upgrade`, and `--refresh` shared arguments (#4319)

## Summary

Ensures that we respect these in all the relevant `uv` APIs.

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

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

Omit project name from workspace errors (#4299)

## Summary

Because the workspace member itself is part of the resolution, adding
the workspace name for the project leads to confusing errors, like:

```
❯ cargo run lock --preview
   Compiling uv v0.2.11 (/Users/crmarsh/workspace/puffin/crates/uv)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.79s
     Running `/Users/crmarsh/workspace/puffin/target/debug/uv lock --preview`
  × No solution found when resolving dependencies:
  ╰─▶ Because only albatross==0.1.0 is available and albatross==0.1.0 depends on anyio<=3, we can conclude that all versions of albatross depend on anyio<=3.
      And because bird-feeder==1.0.0 depends on anyio>=4.3.0,<5 and only bird-feeder==1.0.0 is available, we can conclude that all versions of albatross and all versions of bird-feeder are incompatible.
      And because albatross depends on albatross and bird-feeder, we can conclude that the requirements are unsatisfiable.
```

(Notice "albatross depends on albatross".)

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

Load configuration options from workspace root (#4295)

## Summary

In a workspace, we now read configuration from the workspace root.
Previously, we read configuration from the first `pyproject.toml` or
`uv.toml` file in path -- but in a workspace, that would often be the
_project_ rather than the workspace configuration.

We need to read configuration from the workspace root, rather than its
members, because we lock the workspace globally, so all configuration
applies to the workspace globally.

As part of this change, the `uv-workspace` crate has been renamed to
`uv-settings` and its purpose has been narrowed significantly (it no
longer discovers a workspace; instead, it just reads the settings from a
directory).

If a user has a `uv.toml` in their directory or in a parent directory
but is _not_ in a workspace, we will still respect that use-case as
before.

Closes #4249.

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

Add persistent configuration for non-`pip` APIs (#4294)

## Summary

This PR introduces top-level configuration for uv, such that you can do:

```toml
[tool.uv]
index-url = "https://test.pypi.org/simple"
```

And `uv pip compile`, `uv run`, `uv tool run`, etc., will all respect
that configuration.

The settings that were escalated to the top-level remain on
`tool.uv.pip` too, but they're only respected in `uv pip` commands. If
they're specified in both places, then the `pip` settings win out.

While making this change, I also wired up some of the global options,
like `connectivity` and `native_tls`, through to all the relevant
places.

Closes #4250.