Commit Graph

188 Commits

Author SHA1 Message Date
Zanie Blue 1f963d1b89
Move content from the `mkdocs.public.yml` into the template (#11246)
Closes https://github.com/astral-sh/uv/issues/11242
2025-02-05 16:13:46 +00:00
konsti c54dbcbcc2
Use dev drive for trampoline CI to avoid timeout (#11015)
Sometimes that job is just slow:
https://github.com/astral-sh/uv/actions/runs/12996921221/job/36247398606
2025-02-03 15:38:56 +01:00
Zanie Blue a6d887a37e
Include Rust toolchain in cache in trampoline test job (#11019) 2025-01-28 14:26:07 +00:00
konsti ad60f8da77
Use install action for cargo shear (#10983) 2025-01-27 18:06:17 +01:00
Zanie Blue 0008ec69c4
Run multiple commands in ecosystem tests (#10920) 2025-01-24 09:18:21 -06:00
Zanie Blue 9a2d5fd358
Add ecosystem test case for `pydantic/pydantic-core` (#10917) 2025-01-23 17:05:13 -06:00
Zanie Blue 10654cb8c2
Fix render of matrix arch for system conda tests (#10914) 2025-01-23 21:31:59 +00:00
Zanie Blue a05b0e0346
Separate musl and libc linux builds in CI (#10830)
We have a lot of jobs downstream of the `build-binary-linux` job, but
the job is significantly slower than the other binary builds because we
need to configure musl. Instead, we split this into two jobs (as it was
before https://github.com/astral-sh/uv/pull/2309#discussion_r1520101330)
to speed things up.

The libc job takes ~1m and its _downstream_ jobs finish before the musl
build does. The musl job takes ~5m.
2025-01-23 15:19:26 -06:00
konsti db4ab9dc8a
Install and remove managed Python to and from the Windows Registry (PEP 514) (#10634)
## Summary

In preview mode on windows, register und un-register the managed python build standalone installations in the Windows registry following PEP 514.

We write the values defined in the PEP plus the download URL and hash. We add an entry when installing a version, remove an entry when uninstalling and removing all values when uninstalling with `--all`. We update entries only by overwriting existing values, there is no "syncing" involved.

Since they are not official builds, pbs gets a prefix. `py -V:Astral/CPython3.13.1` works, `py -3.13` doesn't.

```
$ py --list-paths                                            
 -V:3.12 *        C:\Users\Konsti\AppData\Local\Programs\Python\Python312\python.exe
 -V:3.11.9        C:\Users\Konsti\.pyenv\pyenv-win\versions\3.11.9\python.exe
 -V:3.11          C:\Users\micro\AppData\Local\Programs\Python\Python311\python.exe
 -V:3.8           C:\Users\micro\AppData\Local\Programs\Python\Python38\python.exe
 -V:Astral/CPython3.13.1 C:\Users\Konsti\AppData\Roaming\uv\data\python\cpython-3.13.1-windows-x86_64-none\python.exe
```

Registry errors are reported but not fatal, except for operations on the company key since it's not bound to any specific python interpreter.

On uninstallation, we prune registry entries that have no matching Python installation (i.e. broken entries).

The code uses the official `windows_registry` crate of the `winreg` crate.

Best reviewed commit-by-commit.

## Test Plan

We're reusing an existing system check to test different (un)installation scenarios.
2025-01-23 14:13:41 +00:00
Divyanshu Kalra 027c3f5e67
Add Windows aarch64 build and test job to CI
Based on discussion in https://github.com/astral-sh/uv/pull/10306, this
adds building aarch64 exe using x86 runner. See:
https://github.com/astral-sh/uv/pull/10402#issuecomment-2579094192

Addresses: #1141

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-01-22 22:38:50 -06:00
Charlie Marsh 183fe403c6
Disable `.egg-info` tests via `slow-tests` feature on Windows and macOS (#10872)
## Summary

These are super slow on Windows and it's not critical to test them on
that platform. Let's just do the lazy thing.
2025-01-22 21:39:04 +00:00
Zanie Blue a539d33021
Update smoke test scripts to fail on first error (#10831)
These continue on failure on Windows, which is annoying.
2025-01-22 15:00:50 -06:00
Zanie Blue fd16988a4b
Move smoke tests into dedicated jobs and build `uvx` explicitly (#10824)
In the interest of expanding these tests and debugging weird behaviors,
I've moved the smoke tests out of the `cargo test` job and into
dedicated `smoke test` jobs. We explicitly build `uvx` in the `build
binary` jobs instead of relying on the implicit build for the test run.

I also added a `uvx` test case to the smoke tests: `uvx ruff --version`
2025-01-21 16:46:12 -06:00
Zanie Blue 399086d28f
Disable the distutils setuptools shim during interpreter query (#10819)
Addresses
https://github.com/astral-sh/uv/issues/4204#issuecomment-2604983670

Original context in https://github.com/astral-sh/uv/issues/2302
2025-01-21 18:34:13 +00:00
Zanie Blue 581a82d370
Install Python via uv in Windows CI (#10657)
Python 3.8 is a GHA cache miss now, so it is actually like 30-45s. uv
may be faster
2025-01-21 09:02:14 -06:00
Zanie Blue 4f31b44eac
Improve log when distutils is missing (#10713)
See https://github.com/astral-sh/uv/issues/4204 for motivation

This doesn't really reach the user experience I'd expect — i.e., we end
up saying a virtual environment "does not exist" which is a little
silly. However, I think improving the error messaging on interpreter
queries in general should be solved separately. I did one small
"general" change in
89e11d0222
— otherwise we don't show the message at all.

---------

Co-authored-by: konsti <konstin@mailbox.org>
2025-01-20 17:29:29 +00:00
Zanie Blue 896435faec
Use `D:` drive for Windows CI (#10180)
When using the standard Windows runners (as opposed to the _larger_
GitHub runners), an undocumented `D:` drive is available and performant.
We can save some money on by using this on a standard runner instead of
a larger runner with an ReFS drive. Switching to the `D:` drive was not
acceptable for `cargo test` >25m runtime.

Inspired by https://github.com/pypa/pip/pull/13129
See https://github.com/actions/runner-images/issues/8755

Timings (grain of salt — GitHub is super noisy):

- clippy: 2m 18s -> 2m 11s
- build binary: 2m 3s -> 2m 35s
- trampoline check (x86-64): 2m 32s -> 1m 50s (other architectures
similar)
- trampoline test (x86-64): 4m 12s -> 6m 7s
- trampoline test (i686): 6m 44s -> 5m 35s
2025-01-17 13:57:09 -06:00
Zanie Blue 75a1a47859
Improve performance of our test drive in Windows CI (#10651)
Previously, we couldn't use a DevDrive
(https://github.com/astral-sh/uv/pull/3522#issuecomment-2111448930)
because our Windows version was not sufficient.

Recently, I upgraded our larger runners to Windows 2025 preview
(https://github.com/astral-sh/uv/pull/10298) which I presume has support
for this.

I removed ReFS in
953c3535c3
which didn't seem to do anything to performance.

I also found some notes on "trusted" DevDrives and "disabling anti-virus
filtering" which I simply have to try.
2025-01-16 12:07:09 -06:00
Aria Desires 80ac8db7db
Always spawn a main2 thread to normalize main stack size issues (#10479)
Also removes UV_STACK_SIZE and uses RUST_MIN_STACK instead, tweaking
docs to reflect the differences.

Fixes #10367
2025-01-14 22:35:17 -05:00
Charlie Marsh 5bc09a1e9e
Revert "improve shell compatibility of venv activate scripts (#10397)" (#10497)
## Summary

This reverts commit 2f7f9ea571
(https://github.com/astral-sh/uv/pull/10397). We're seeing some
user-reported failures, so we need to investigate further before
re-shipping.

Re-opens https://github.com/astral-sh/uv/issues/7480.

Closes https://github.com/astral-sh/uv/issues/10487.
2025-01-11 09:23:07 -05:00
Aria Desires 2f7f9ea571
improve shell compatibility of venv activate scripts (#10397)
The shellcheck action we uses misses some files, so they fell out of
spec for what we support. This PR first and foremost adds them to the
scanning list, and then fixes the issues found.

Fixes #7480
2025-01-08 13:12:29 -05:00
Zanie Blue bbf9558b16
Rename CI runners and use Windows 2025 preview on large runners (#10298)
I'm renaming our runners to be more explicit about their size,
architecture, and version.

Switching to Windows 2025 over 2022 in some of our jobs in the hope that
it's faster.
2025-01-05 14:29:37 -06:00
renovate[bot] 9d417da4e1
Update astral-sh/setup-uv action to v5 (#10116) 2024-12-23 08:47:58 -05:00
Zanie Blue 5e7f80ea46
Disable Depot runner for macOS (#9976)
Use GitHub instead; Depot do not provide the necessary concurrency to
use this here and in `python-build-standalone`
2024-12-17 11:20:47 -06:00
konsti b7df5dbaf3
Avoid `liblzma-dev` system dep in uv-dev and uv-bench (#9933)
Enable `lzma-sys/static` through the performance feature not only in uv,
but in uv-dev and uv-bench too, to avoid the system dependency on
`liblzma-dev`.

Ref #9880
2024-12-17 16:12:33 +01:00
Charlie Marsh bee54039b1
Add lzma to benchmark install (#9888) 2024-12-13 16:54:20 -05:00
Zanie Blue d8f945a100
Install `liblzma-dev` in CI (#9880) 2024-12-13 14:10:33 -06:00
Zanie Blue f7f300e608
Disable checkout during FreeBSD tests (#9670)
To save on that disk space and speed!
2024-12-06 08:28:08 -06:00
Zanie Blue 0805242ea2
Test `venv` in 3.13t integration test (#9665) 2024-12-05 20:57:08 -06:00
Zanie Blue d7b74f964e
Fix FreeBSD test by avoiding expensive copy of the uv binary (#9628) 2024-12-04 05:33:10 +00:00
Zanie Blue e311b0424d
Disable freebsd test until we resolve the upstream problem (#9620)
See

- https://github.com/acj/freebsd-firecracker/issues/1
- https://github.com/acj/freebsd-firecracker-action/issues/1
- #9619
2024-12-03 15:04:17 -06:00
konsti 0b0d0f44f8
Publish: Warn when keyring has no password (#8827)
When trying to upload without a password but with the keyring, check
that the keyring has a password for the upload URL and username and warn
if it doesn't.

Fixes #8781
2024-11-27 20:54:49 +01:00
Zanie Blue ba94d85d36
Allow disabling (most of) CI with `no-test` label (#9456) 2024-11-26 17:16:08 -06:00
Jo 77116bef26
windows ci: Run `cargo clippy` in the dev drive workspace to reuse the cache (#9411)
## Summary

In the Windows Clippy job, the workspace is transferred to
`UV_WORKSPACE`. However, `cargo clippy` continues to execute in the
`github.workspace`, and `Swatinem/rust-cache` only caches the
`UV_WORKSPACE/target`, resulting in `cargo clippy` having no cache.

This adjustment will take effect when any changes are made to
`Cargo.toml` or `Cargo.lock`, prompting `Swatinem/rust-cache` to updat
the cache.
2024-11-25 15:12:43 -06:00
renovate[bot] 064fcd92af
Update astral-sh/setup-uv action to v4 (#9407) 2024-11-24 20:48:57 -05:00
konsti de2e9cd0ff
Increase UV_STACK_SIZE to 3MB (#9311)
We're seeing CI failures on windows
2024-11-21 11:46:33 +00:00
Zanie Blue 14812ff79b
Use Depot runners instead of GitHub larger runners for Unix (#9154) 2024-11-15 17:07:53 -06:00
konsti 874aa29b57
Pin publish test to 3.12 (#8951)
The bump to 3.13 broke the test
2024-11-10 15:43:47 +01:00
Mathieu Kniewallner ecb3e98da0
ci: validate project metadata (#8973)
## Summary

As per https://github.com/astral-sh/uv/pull/8943#discussion_r1835065562,
adding a CI step to validate project metadata. Documentation for the
tool: https://validate-pyproject.readthedocs.io/en/stable/readme.html.
`store` is an extra that uses [this
package](https://github.com/henryiii/validate-pyproject-schema-store) to
get a weekly update of the schema in SchemaStore.

## Test Plan

Step passes on CI, and testing the same command locally while
voluntarily using a wrong classifier fails:
```console
$ uvx --from 'validate-pyproject[all,store]' validate-pyproject pyproject.toml
Invalid file: pyproject.toml
[ERROR] `project.classifiers[5]` must be trove-classifier
```
2024-11-09 08:48:45 -06:00
Zanie Blue 55502842c0 Use 3.13 in CI (#8014) 2024-11-07 14:29:54 -06:00
Jo 738f4245a5
Add `docs/configuration/environment.md` to code change list (#8859)
See #8858, the `cargo dev generate-all` step should not be skipped.
2024-11-06 11:44:42 -05:00
Jo 814b4d159c
Add MSRV build to CI (#8855)
## Summary

Closes #8451
2024-11-06 11:22:13 -05:00
Jo 9f81db7d1d
Use cache in windows clippy job (#8852)
Place the `Swatinem/rust-cache@v2` step after `setup-dev-drive.ps1` to
ensure the correct directories are cached.
2024-11-05 23:05:34 -06:00
Zanie Blue 8d3408fe39
Add support for installing versioned Python executables on Windows (#8663)
Incorporating #8637 into #8458 

- Adds `python-managed` feature selection to Windows CI for `python
install` tests
- Adds trampoline sniffing utilities to `uv-trampoline-builder`
- Uses a trampoline to install Python executables into the `PATH` on
Windows
2024-10-31 15:58:35 +00:00
Zanie Blue 4dd36b799f
Install versioned Python executables into the bin directory during `uv python install` (#8458)
Updates `uv python install` to link `python3.x` in the executable
directory (i.e., `~/.local/bin`) to the the managed interpreter path.

Includes

- #8569 
- #8571 

Remaining work

- #8663 
- #8650 
- Add an opt-out setting and flag
- Update documentation
2024-10-30 14:13:20 +00:00
Zanie Blue c335dc5e5d
Add a trampoline variant that just executes `python` (#8637)
Currently, our trampoline is used to convert `<command> [args]` to
`python <command> [args]` for script entrypoints installed into virtual
environments. For #8458, it'd be nice to convert a shim `python3.12
[args]` to `python [args]`. Here, we modify the trampolines to support
this use-case.

The only change we really need here is to avoid injecting `<command>`
into the child process. We change the "magic number" at the end of the
trampoline executables from `UVUV` to `UVSC` and `UVPY` which define
"script" and "python" variants to the trampoline. We then omit the
`<command>` injection in the latter case. We also omit writing the zip
script payload.

To support construction of the new variant, a new
`uv-trampoline-builder` crate is introduced — this avoids requirements
on `uv-install-wheel` in future work. I also use `uv-trampoline-builder`
to consolidate some of the test setup for `uv-trampoline`.

There should be no backwards compatibility concerns, since trampolines
are fully self-referential.

I rebased to fix the commits at the end, as this took many iterations to
get working via CI. This should roughly be reviewable by commit if you
prefer.
2024-10-29 09:21:15 -05:00
Zanie Blue e86c52d39c
Add note about trampoline tests on aarch64 (#8643)
Similar to https://github.com/astral-sh/uv/pull/8642, not sure why this
is incomplete.

We'll see if it works.
2024-10-28 19:53:23 +00:00
Zanie Blue 7948441121
Actually perform checks on alternate trampoline platforms (#8642)
It seems unintentional that we basically did nothing on these
alternative platforms? It seems like an artifact from some previous
change.

I'm not sure it's worth running Clippy multiple times. We could also
just reduce the matrix here.
2024-10-28 14:12:36 -05:00
Hamir Mahal dff507702b
fix: usage of `a deprecated Node.js version` in CI (#8506)
## Summary

[`ci.yml`](https://github.com/astral-sh/uv/blob/main/.github/workflows/ci.yml)
uses
[`gabrielfalcao/pyenv-action@v18`](https://github.com/gabrielfalcao/pyenv-action/),
which [uses `a deprecated Node.js
version`](https://github.com/astral-sh/uv/actions/runs/11483963555).

This pull request aims to remove any usage of `a deprecated Node.js
version` from
[`ci.yml`](https://github.com/astral-sh/uv/blob/main/.github/workflows/ci.yml).

<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

I attempted to test this but [canceled the run on my
fork](https://github.com/hamirmahal/uv/actions/runs/11484989508/job/31964058415)
after it waited for a runner for over 10 minutes with no result.

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

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-10-23 22:28:34 -04:00
Zanie Blue 76bcb89571
Use native Windows runner for trampoline checks (#8469)
As in https://github.com/astral-sh/uv/pull/8182 and #8468
2024-10-22 12:28:31 -05:00