Commit graph

4903 commits

Author SHA1 Message Date
Mathieu Kniewallner
36fedf7ac7
chore(renovate): move out of deprecated options (#8055) 2024-10-09 14:48:19 -05:00
konsti
c07000718a
Enable HTTP/2 in reqwest (#8049) 2024-10-09 18:58:24 +02:00
Mathieu Kniewallner
c2f13f9468
docs(dependency-bots): mention PEP 723 + some improvements (#7819)
## Summary

Renovate recently gained support for updating dependencies defined using
PEP 723 (https://github.com/renovatebot/renovate/pull/31266). Since uv
supports this format, I thought it could be nice to mention support for
it in the integrations documentation as well. I took the occasion to
make the page a bit more structured as well.

## Test Plan

Ran Renovate on https://github.com/mkniewallner/renovate-pep723, which
created https://github.com/mkniewallner/renovate-pep723/pull/2 that
updates a dependency defined using PEP 723. But I'll re-run some tests
again once the changes are released on Renovate cloud GitHub app just in
case.
2024-10-09 11:26:07 -05:00
Brandon W Maister
0ec2d4e434
fix: Improve compatibility with VSCode PS1 prompt (#8006) 2024-10-09 17:33:21 +02:00
Ahmed Ilyas
1764a95d39
Support pip install --exact (#8044)
## Summary

Resolves #8041 

## Test Plan

`cargo test`
2024-10-09 15:31:28 +02:00
konsti
1e6c64074d
Add codeberg integration test for uv publish (#8043) 2024-10-09 15:02:26 +02:00
Jo
44d6478f88
Remove the newly created tool environment if sync failed (#8038)
## Summary

Resolves #8011

## Test Plan

```console
$ cargo run -- tool install pyenv
$ cargo run -- tool list
```
2024-10-09 13:01:53 +00:00
Zanie Blue
5bc726a1e7
Avoid deleting a project environment directory if we cannot tell if a pyvenv.cfg file exists (#8012)
I was exploring a fix to an [apparent
bug](3124893728)
but this was actually just a CI change
https://github.com/astral-sh/uv/pull/8013

Regardless, I think this code is safer?
2024-10-08 17:15:47 -05: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
Jacob Coffee
e8b8d236a1
docs: add alias context to uv tool run --help command (#7695)
<!--
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

<!-- What's the purpose of the change? What does it do, and why? -->
- Adds detail to the `uv tool run --help` CLI that lets users know about
the shorthand, `uvx`

## Test Plan

<!-- How was it tested? -->
Building and running CLI
```
…📝✓] via 🐋 orbstack via 🎁 v0.4.16 via  pyenv via ⚙️ v1.81.0on ☁️  (us-east-2) took 3s 
➜ ./target/debug/uv tool run --help
Run a command provided by a Python package. Also available via the alias `uvx`.

Usage: uv tool run [OPTIONS] [COMMAND]

...

You can also use `uvx` as an alias for `uv tool run`. 
Use `uv help tool run` for more details.
```

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-10-08 21:43:50 +00:00
trag1c
37273cb4bc
Add prerelease compatibility check (#8020)
## Summary

Closes #7977. Makes `PythonDownloadRequest` account for the prerelease
part if allowed. Also stores the prerelease in `PythonInstallationKey`
directly as a `Prerelease` rather than a string.

## Test Plan

Correctly picks the relevant prerelease (rather than picking the most
recent one):
```
λ cargo run python install 3.13.0rc2
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s
     Running `target/debug/uv python install 3.13.0rc2`
Searching for Python versions matching: Python 3.13rc2
cpython-3.13.0rc2-macos-aarch64-none ------------------------------ 457.81 KiB/14.73 MiB                                                                                                                    ^C

λ cargo run python install 3.13.0rc3                 
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s
     Running `target/debug/uv python install 3.13.0rc3`
Searching for Python versions matching: Python 3.13rc3
Found existing installation for Python 3.13rc3: cpython-3.13.0rc3-macos-aarch64-none
```
2024-10-08 16:20:58 -05:00
Zanie Blue
cfaa834dee
Some changelog touchups (#8018) 2024-10-08 20:22:16 +00: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
konsti
282fab5f70
Hint at wrong endpoint in publish (#7872)
Improve hints when using the simple index URL instead of the upload URL
in `uv publish`. This is the most common confusion when publishing, so
we give it some extra care and put it more centrally in the CLI help.

Fixes #7860

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-10-08 19:16:02 +00:00
Jo
9e98055a9e
Add snapshot testing to contribution guide (#7882)
## Summary

Add a `Snapshot testing` section to `CONTRIBUTING.md`.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-10-08 19:08:25 +00:00
Jo
15e5e3f6af
Fill in authors filed during uv init (#7756)
## Summary

Fill in the `authors` field of `pyproject.toml` by fetching author info
from Git.

Resolves #7718
2024-10-08 14:06:37 -05:00
sobolevn
56521937b7
Add shellcheck CI (#7888)
<!--
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

I started learning `uv` by inspecting the source code.
I've noticed that your shell scripts are very good! Which is rare!

## Test Plan

I propose to add `shellcheck` to the CI.
It is a great tool to help finding bugs and style issues in shell code.

Techincal details:
- This CI job will only run when any `.sh` files are changed (or the job
definition file)
- It takes just several seconds even on local machine:
```
» time shellcheck -S style **/*.sh
shellcheck -S style **/*.sh  0.02s user 0.05s system 61% cpu 0.123 total
```

- It is easy to use, for example: I just fixed the single problem you
had in your code with `# shellcheck disable=SC1091`
- I am using this tool for around 8 years now and didn't have any
issues. Examples:
ca899f3b69/.github/workflows/test.yml (L22-L27)
and
https://github.com/wemake-services/wemake-django-template/blob/master/.github/workflows/shellcheck.yml

But, I understand that build / lint tools are very subjective. So, feel
free to close :)
2024-10-08 13:58:00 -05:00
Zanie Blue
cd582cacab
Fix GitHub Actions integration test (#8013)
Fixes bug noted in https://github.com/astral-sh/uv/pull/8012

GitHub upgraded the 3.12 Python version so the path changed!
2024-10-08 17:53:56 +00:00
Zanie Blue
f6fd849f2c
Add managed downloads for CPython 3.13.0 final (#8010) 2024-10-08 12:53:09 -05:00
konsti
b5dbc32aee
Check consistency between prepare and build step (#7986) 2024-10-08 16:38:22 +00:00
konsti
9ae6c4fce7
Build backend: Logging and more checks (#7980) 2024-10-08 15:25:40 +00:00
konsti
1d6e1bd5b4
Fix merge problem with main (#8005) 2024-10-08 17:16:08 +02:00
Sigurd Spieckermann
b70405c59a Use simple image syntax in GitLab integration docs 2024-10-08 09:48:00 -05:00
Sigurd Spieckermann
cae9507bda Use more idiomatic CI job names in GitLab integration docs 2024-10-08 09:48:00 -05:00
Sigurd Spieckermann
427c1f7fb2 Fix cache directory path in GitLab integration docs 2024-10-08 09:48:00 -05:00
Sigurd Spieckermann
4e4a558d64 Remove obsolete command in GitLab integration docs 2024-10-08 09:48:00 -05:00
Sigurd Spieckermann
b5c52b205a Use idiomatic syntax in GitLab integration docs 2024-10-08 09:48:00 -05:00
Sigurd Spieckermann
eb5af72a6d Fix syntax in GitLab integration docs 2024-10-08 09:48:00 -05:00
konsti
025ec02326
Fix problems with build backend metadata files (#7979) 2024-10-08 16:21:36 +02: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
Zanie Blue
46ff220508
Remove PythonPreference toggle based on UV_TEST_PYTHON_PATH (#7989)
Needed for https://github.com/astral-sh/uv/pull/7934

This is some legacy logic, I think.
2024-10-07 21:13:19 +00:00
Zanie Blue
38beb2b24f
Show verbose output during integration tests (#7982) 2024-10-07 18:39:22 +00:00
Zanie Blue
0176b6f0bb
Show verbose logs during smoke test (#7984) 2024-10-07 13:28:54 -05:00
renovate[bot]
a3e21d61e3
Update Rust crate futures to v0.3.31 (#7953) 2024-10-07 17:59:22 +00:00
Zanie Blue
e479e8b4b3
Show interpreter source during Python discovery query errors (#7928)
Closes https://github.com/astral-sh/uv/issues/4154

e.g.

```
❯ UV_PYTHON=/dev/null cargo run -q -- pip install anyio
error: Failed to inspect Python interpreter from provided path at `/dev/null` 
  Caused by: Failed to query Python interpreter at `/dev/null`
  Caused by: Permission denied (os error 13)
  
❯ VIRTUAL_ENV=/dev/null cargo run -q -- pip install anyio
error: Failed to inspect Python interpreter from active virtual environment at `/dev/null/bin/python3` 
  Caused by: Failed to query Python interpreter
  Caused by: failed to canonicalize path `/dev/null/bin/python3`
  Caused by: Not a directory (os error 20)
```
2024-10-07 12:57:18 -05:00
renovate[bot]
719604ae1d
Update pre-commit dependencies (#7955) 2024-10-07 17:55:10 +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
Zanie Blue
a4f64d2be6
Bump patch Python versions for project (#7972) 2024-10-07 12:38:12 -05:00
konsti
ceafa476c7
Basic functional build backend wheels (#7966) 2024-10-07 19:30:52 +02:00
Zanie Blue
7d883fc12f
Add 3.13 support to the platform reference (#7971) 2024-10-07 12:06:43 -05:00
Zanie Blue
c69b808e43
Fix parsing of gnueabi libc variants in Python version requests (#7975)
```
❯ cargo run -q -- python install cpython-3.12.6-linux-armv7-gnueabihf
Searching for Python versions matching: cpython-3.12.6-linux-armv7-gnueabihf
Installed Python 3.12.6 in 2.10s
 + cpython-3.12.6-linux-armv7-gnueabihf

❯ uv python install cpython-3.12.6-linux-armv7-gnueabihf
error: Cannot download managed Python for request: executable name `cpython-3.12.6-linux-armv7-gnueabihf`
```
2024-10-07 15:49:21 +00:00
Zanie Blue
3fce2f3733
Add Python 3.13 classifier (#7948)
ref https://pyreadiness.org/3.13/
2024-10-07 09:31:39 -05: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
Zanie Blue
37b73230d3
Allow self-depedencies in the dev section (#7943)
https://github.com/astral-sh/uv/pull/7766 banned using `uv add` to
create self-dependencies in the `dev` section which breaks `uv add --dev
.[extra]` which is a fair use-case for adding a self-dependency.

Maybe we should only allow this if the added requirement includes an
extra group? Otherwise it's a bit weird.
2024-10-06 14:42:56 +00:00