853 Commits

Author SHA1 Message Date
Charlie Marsh
c5d9f55bc4 Bump version to v0.4.21 (#8188) 2024-10-14 20:44:43 +00:00
Charlie Marsh
2901a8d6cc Run cargo update (#8152) 2024-10-12 21:30:52 +00:00
konsti
c07000718a Enable HTTP/2 in reqwest (#8049) 2024-10-09 18:58:24 +02:00
Zanie Blue
651fe6f4e6 Bump netrc crate to latest commit (#8021)
Closes https://github.com/astral-sh/uv/issues/8003
Closes https://github.com/astral-sh/uv/issues/6809

This hasn't been released ~4 months later and these are pretty critical
fixes for Windows users.
2024-10-08 17:15:39 -05:00
Zanie Blue
0e1b25a536 Bump version to 0.4.20 (#8016) 2024-10-08 19:55:21 +00:00
Kemal Akkoyun
1a39ffe391 uv run: List available scripts when a script is not specified (#7687)
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
## Summary

This PR adds the ability to list available scripts in the environment
when `uv run` is invoked without any arguments.
It somewhat mimics the behavior of `rye run` command
(See https://rye.astral.sh/guide/commands/run).

This is an attempt to fix #4024.

## Test Plan

I added test cases. The CI pipeline should pass.

### Manuel Tests

```shell
❯ uv run
Provide a command or script to invoke with `uv run <command>` or `uv run script.py`.

The following scripts are available:

normalizer
python
python3
python3.12

See `uv run --help` for more information.
```

---------

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-10-08 19:34:50 +00:00
renovate[bot]
fa4ac3d2bd Update Rust crate boxcar to v0.2.6 (#7951)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [boxcar](https://redirect.github.com/ibraheemdev/boxcar) |
workspace.dependencies | patch | `0.2.5` -> `0.2.6` |

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/uv).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45Ny4wIiwidXBkYXRlZEluVmVyIjoiMzguOTcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW50ZXJuYWwiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-08 03:36:44 -04:00
Zanie Blue
a451fb6858 Bump version to 0.4.19 (#7991) 2024-10-07 17:32:37 -05:00
renovate[bot]
a3e21d61e3 Update Rust crate futures to v0.3.31 (#7953) 2024-10-07 17:59:22 +00:00
renovate[bot]
48792bf3af Update Rust crate async-compression to v0.4.13 (#7950) 2024-10-07 12:52:14 -05:00
renovate[bot]
6dc06fae67 Update Rust crate clap to v4.5.19 (#7952) 2024-10-07 12:50:35 -05:00
renovate[bot]
af32e04fd8 Update Rust crate reqwest to v0.12.8 (#7954) 2024-10-07 12:50:14 -05:00
renovate[bot]
0f691f21f4 Update Rust crate indexmap to v2.6.0 (#7956) 2024-10-07 12:49:54 -05:00
konsti
ceafa476c7 Basic functional build backend wheels (#7966) 2024-10-07 19:30:52 +02:00
konsti
5d789c6af7 Implement build backend metadata (#7961) 2024-10-07 10:51:45 +02:00
konsti
92538ada7c Metadata transformation for the build backend (#7781) 2024-10-07 10:38:40 +02:00
Charlie Marsh
005bb235f0 Improve legibility of build failure errors (#7854)
## Summary

We now...

- Only show `stdout` and/or `stderr` if they're non-empty.
- Use a colorful header for the start of each section
- Highlight the step that failed

## Test Plan

![Screenshot 2024-10-01 at 8 18
42 PM](https://github.com/user-attachments/assets/c3dadf6d-11be-468d-940c-a0a29c4a88f0)
2024-10-03 12:52:53 +00:00
Charlie Marsh
14507a1793 Add uv- prefix to all internal crates (#7853)
## Summary

Brings more consistency to the repo and ensures that all crates
automatically show up in `--verbose` logging.
2024-10-01 20:15:32 -04:00
Zanie Blue
7b55e97909 Bump version to 0.4.18 (#7852) 2024-10-01 18:25:34 -05:00
Charlie Marsh
6c7f8bb564 Use build failure hints for dotenv errors, rather than in uv add (#7825)
## Summary

We now display the "Did you mean `python-dotenv`?"-style errors on build
failure, rather than in `uv add`. This is less opinionated and couples
us less to specific content in the registry.

## Test Plan

![Screenshot 2024-09-30 at 10 15
05 PM](https://github.com/user-attachments/assets/5b6684e2-d992-4f20-82ab-05632779ba91)
2024-10-01 16:31:27 +00:00
konsti
bd3c462674 Remove pyo3 feature from pep440 and pep508 crates (#7843) 2024-10-01 14:24:34 +00:00
Charlie Marsh
b6de417c94 Use serde-untagged to improve some untagged enum error messages (#7822)
## Summary

This is related to https://github.com/astral-sh/uv/issues/7817, but
doesn't close it.
2024-09-30 23:40:21 +00:00
Charlie Marsh
f67347e72c Allow multiple source entries for each package in tool.uv.sources (#7745)
## Summary

This PR enables users to provide multiple source entries in
`tool.uv.sources`, e.g.:

```toml
[tool.uv.sources]
httpx = [
  { git = "https://github.com/encode/httpx", tag = "0.27.2", marker = "sys_platform == 'darwin'" },
  { git = "https://github.com/encode/httpx", tag = "0.24.1", marker = "sys_platform == 'linux'" },
]
```

The implementation is relatively straightforward: when we lower the
requirement, we now return an iterator rather than a single requirement.
In other words, the above is transformed into two requirements:

```txt
httpx @ git+https://github.com/encode/httpx@0.27.2 ; sys_platform == 'darwin'
httpx @ git+https://github.com/encode/httpx@0.24.1 ; sys_platform == 'linux'
```

We verify (at deserialization time) that the markers are
non-overlapping.

Closes https://github.com/astral-sh/uv/issues/3397.
2024-09-30 21:16:44 +00:00
Charlie Marsh
71d5661bd8 Add a custom suggestion for uv add dotenv (#7799)
## Summary

This was brought up on Twitter recently. `dotenv` hasn't been updated in
years and doesn't build successfully anymore. Users almost always mean
to install `python-dotenv`. I think we can add helpful hints here to
point users in the right direction.

## Test Plan

![Screenshot 2024-09-29 at 9 27
27 PM](https://github.com/user-attachments/assets/72585860-9d98-4478-9eac-2c17ac06178b)
2024-09-30 17:00:31 +00:00
Charlie Marsh
b6ce39f45e Remove lossy resolution-to-requirements conversion in install plan (#7798)
## Summary

This is a longstanding piece of technical debt. After we resolve, we
have a bunch of `ResolvedDist` entries. We then convert those to
`Requirement` (which is lossy -- we lose information like "the index
that the package was resolved to"), and then back to `Dist`.
2024-09-30 10:13:09 -04:00
renovate[bot]
077affc11a Update Rust crate platform-info to v2.0.4 (#7790) 2024-09-30 01:35:30 +00:00
renovate[bot]
7947422c92 Update Rust crate hyper-util to v0.1.9 (#7789) 2024-09-30 01:10:33 +00:00
renovate[bot]
ad6236b903 Update Rust crate regex to v1.11.0 (#7793) 2024-09-29 21:01:13 -04:00
renovate[bot]
9044931c5b Update Rust crate toml_edit to v0.22.22 (#7792) 2024-09-29 21:01:09 -04:00
renovate[bot]
3b0b1d4dc1 Update Rust crate syn to v2.0.79 (#7791) 2024-09-29 21:01:04 -04:00
renovate[bot]
a7038e1b4a Update Rust crate flate2 to v1.0.34 (#7788) 2024-09-29 21:00:38 -04:00
renovate[bot]
0019aae813 Update Rust crate async-trait to v0.1.83 (#7787) 2024-09-29 21:00:27 -04:00
renovate[bot]
bcada9f99c Update Rust crate tempfile to v3.13.0 (#7795) 2024-09-29 21:00:14 -04:00
Charlie Marsh
d2e7b40cec Bump version to v0.4.17 (#7742) 2024-09-27 13:28:38 -04:00
Jo
0c801f8f4b Initialize a Git repository in uv init (#5476)
## Summary

Similiar to `cargo init --vcs <VCS>`, this PR adds the `--vcs <VCS>`
flag for `uv init`, allowing to create a version control system during
initialization. By default, `uv init` will create a Git repository if
the `--vcs` flag is not provided. Use `--vcs none` to disable this
feature.

Currently, only Git is supported. While Cargo also supports hg, pijul,
and fossil, this initial PR only includes Git. We can add more later if
there are any user requests.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-09-26 02:40:39 +00:00
konsti
9004364de3 Rename uv-build to uv-build-frontend (#7688)
uv will soon support both a build frontend (`uv build`) and a build
backend (`build-system = "uv"`). To avoid the name clash, I'm renaming
the `uv-build` crate to `uv-build-frontend`. In a follow-up PR, I will
add a `uv-build-backend` crate with the build backend implementation.
2024-09-25 14:17:54 -04:00
tfsingh
106633a5e5 Add support for upgrading Python in tool environments (#7605)
This PR adds support for upgrading the build environment of tools with
the addition of a ```--python``` argument to ```uv upgrade```, as
specified in #7471.

Some things to note:
- I added support for individual packages — I didn't think there was a
good reason for ```--python``` to only apply to all packages
- Upgrading with ```--python``` also upgrades the package itself — I
think this is fair as if a user wants to _strictly_ switch the version
of Python being used to build a tool's environment they can use ```uv
install```. This behavior can of course be modified if others don't
agree!

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

Closes https://github.com/astral-sh/uv/issues/7471.
2024-09-25 17:40:28 +00:00
konsti
f5601e2610 Clean up "performance allocators" and "performance flate2" backends (#7686)
Co-authored-by: Amos Wenger <amos@bearcove.net>
2024-09-25 15:41:40 +00:00
Zanie Blue
e81ed8ec5d Bump version to 0.4.16 (#7669) 2024-09-24 14:39:21 -05:00
konsti
16a6fd2c42 Add retries to uv publish (#7635) 2024-09-24 16:24:44 +00:00
konsti
205bf8cabe Implement trusted publishing (#7548)
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-09-24 16:07:20 +00:00
konsti
c053dc84f4 Progress bars for uv publish (#7613) 2024-09-24 15:55:33 +00:00
konsti
1995d20298 Add uv publish: Basic upload with username/password or keyring (#7475)
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-09-24 15:33:06 +00:00
renovate[bot]
ab2bba285e Update Rust crate thiserror to v1.0.64 (#7630) 2024-09-22 22:33:03 -04:00
renovate[bot]
4be9e3aeb3 Update Rust crate clap to v4.5.18 (#7629) 2024-09-22 21:00:58 -04:00
Charlie Marsh
0d81bfbc67 Bump version to v0.4.15 (#7612) 2024-09-21 09:01:20 -04:00
Zanie Blue
a497b156bb Bump version to 0.4.14 (#7600) 2024-09-20 15:08:54 -05:00
Zanie Blue
d6c9603594 Fix handling of sys.base_prefix collision in interpreter identity check during tool installs (#7596)
Closes https://github.com/astral-sh/uv/issues/7586

Extends https://github.com/astral-sh/uv/pull/7593 (thanks @lucab!)

---------

Co-authored-by: Luca BRUNO <lucab@lucabruno.net>
2024-09-20 14:01:14 -05:00
Zanie Blue
b8f9ee3b4d Bump version to 0.4.13 (#7558) 2024-09-19 20:43:56 +00:00
Charlie Marsh
f3463b3d08 Heal cache entries with missing source distributions (#7559)
## Summary

`uv cache prune --ci` will remove the source distribution directory. If
we then need to build a _different_ wheel (e.g., you're building a
package that has Python minor version-specific wheels), we fail, because
we expect the source to be there.

Now, if the source is missing, we re-download it. It would be slightly
easier to just _ignore_ that revision, but that would mean we'd also
lose the already-built wheels -- so if you ran against many Python
versions, we'd continuously lose the cached data.

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

## Test Plan

We can add tests, but they _need_ to build non-pure Python wheels, which
tends to be expensive...

For reference:

```console
$ cargo run venv --python 3.12
$ cargo run pip install mercurial==6.8.1 --verbose
$ cargo run cache prune --ci
$ cargo run venv --python 3.11
$ cargo run pip install mercurial==6.8.1 --verbose
```

I also did this with a local `.tar.gz` that I downloaded from PyPI.
2024-09-19 20:31:55 +00:00