Commit graph

158 commits

Author SHA1 Message Date
Zanie Blue
09ae7a93d1
Add integration test for PyPy (#5048) 2024-07-15 11:11:51 -05:00
Charlie Marsh
b629ab89c5
Set absolute URLs prior to uploading to PyPI (#5038)
## Summary

Closes https://github.com/astral-sh/uv/issues/5030.
2024-07-13 17:29:21 +00:00
Jo
4bdcec9622
Fix Fedora system test (#5034)
Seems like the latest
[`fedora:41`](https://hub.docker.com/layers/library/fedora/rawhide/images/sha256-c037a87094660ceda037ee319b17f59559241d2a3580d1d0f414e72b0a8f3827?context=explore)
(pushed at Jul 12, 2024 at 22:05 UTC) docker image has removed the
`python3` package, causing our current [CI
failure](2740152817).
2024-07-13 10:25:03 -05:00
Ibraheem Ahmed
a4e9b63d5b
Fix benchmarks CI job (#5023) 2024-07-12 17:57:12 -04:00
Ibraheem Ahmed
aff9c9bd91
Switch to Current-Thread Tokio Runtime (#4934)
## Summary

Move completely off tokio's multi-threaded runtime. We've slowly been
making changes to be smarter about scheduling in various places instead
of depending on tokio's general purpose work-stealing, notably
https://github.com/astral-sh/uv/pull/3627 and
https://github.com/astral-sh/uv/pull/4004. We now no longer benefit from
the multi-threaded runtime, as we run on all I/O on the main thread.
There's one remaining instance of `block_in_place` that can be swapped
for `rayon::spawn`.

This change is a small performance improvement due to removing some
unnecessary overhead of the multi-threaded runtime (e.g. spawning
threads), but nothing major. It also removes some noise from profiles.

## Test Plan

```
Benchmark 1: ./target/profiling/uv (resolve-warm)
  Time (mean ± σ):      14.9 ms ±   0.3 ms    [User: 3.0 ms, System: 17.3 ms]
  Range (min … max):    14.1 ms …  15.8 ms    169 runs
 
Benchmark 2: ./target/profiling/baseline (resolve-warm)
  Time (mean ± σ):      16.1 ms ±   0.3 ms    [User: 3.9 ms, System: 18.7 ms]
  Range (min … max):    15.1 ms …  17.3 ms    162 runs
 
Summary
  ./target/profiling/uv (resolve-warm) ran
    1.08 ± 0.03 times faster than ./target/profiling/baseline (resolve-warm)
```
2024-07-09 18:21:16 -04:00
samypr100
eee90a340c
feat: re-enable std in uv-trampoline (#4722)
## Summary

Partially closes #1917

This PR picks up on some of the great work from #1864 and opted to keep
`panic_immediate_abort` (for size reasons). I split the PR in different
isolated commits in case we want to separate/cherry-pick them out.

1. The first commit ports mostly all std changes from that PR into this
PR. Binary sizes stayed the same ~16kb.
2. The second commit migrates our existing usage of windows-sys to
windows for a safer ffi calls with Results!. It also changes all large
unsafe blocks to be isolated to the actual unsafe calls, and switches
some areas to use std such as getenv port ( which seemed buggy! ) from
launcher.c. In addition, this also adds more error checking in order to
match some missing assertions from distlib's launcher.c. Note, due to
the additional .text data, the binary sizes increased to ~20.5kb, but we
can cut back on some of the added error msgs as needed.
3. The third commit switches to using xwin for building on all 3
supported trampoline targets for sanity, and adds a CI bloat check for
core::fmt and panic as a precaution. Sadly, this will invalidate the
xwin cache on the first run.

## Test Plan

Most changes were tested on a couple of local GUI apps and console apps,
also tested some of the error states manually by using SetLastError at
different points in the code and/or passing in invalid handles.

I'm not sure how far we can get with migrating some of the other calls
without increasing binary size substantially. An initial attempt at
using std::path didn't seem so bad size wise when I tried it (~1k). On
other cases, such as std::process::exit added ~10k to the total binary
size.

---------

Co-authored-by: konstin <konstin@mailbox.org>
2024-07-06 20:38:45 +00:00
Charlie Marsh
1e8f5926e6
Upgrade to cargo-dist v0.18.0 (#4792)
## Summary

This enables us to get rid of `allow-dirty`!
2024-07-03 22:39:51 +00:00
Zanie Blue
dd7da6af5f
Change "toolchain" to "python" (#4735)
Whew this is a lot.

The user-facing changes are:

- `uv toolchain` to `uv python` e.g. `uv python find`, `uv python
install`, ...
- `UV_TOOLCHAIN_DIR` to` UV_PYTHON_INSTALL_DIR`
- `<UV_STATE_DIR>/toolchains` to `<UV_STATE_DIR>/python` (with
[automatic
migration](https://github.com/astral-sh/uv/pull/4735/files#r1663029330))
- User-facing messages no longer refer to toolchains, instead using
"Python", "Python versions" or "Python installations"

The internal changes are:

- `uv-toolchain` crate to `uv-python`
- `Toolchain` no longer referenced in type names
- Dropped unused `SystemPython` type (previously replaced)
- Clarified the type names for "managed Python installations"
- (more little things)
2024-07-03 07:44:29 -05:00
konsti
42415997b1
Reactivate python 3.13 in CI (#4761)
https://github.com/actions/setup-python/issues/888#issuecomment-2205466950
2024-07-03 11:28:45 +02:00
samypr100
f43a8bbd6f
Upgrade to Rust 1.79 (#4754)
## Summary

Updates default toolchain to
[1.79](https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html).
There didn't seem to be any breaking changes besides xwin now requiring
lld llvm linker.

## Test Plan

Existing tests.
2024-07-02 23:50:47 -05:00
Zanie Blue
88c2a8e30f
Add uvx.exe binary to Windows artifacts (#4756)
Closes https://github.com/astral-sh/uv/issues/4755
2024-07-02 23:16:20 -05:00
Zanie Blue
9d58c2a810
Add test cases for uvx in binary build workflow (#4744) 2024-07-02 18:21:37 -05:00
Zanie Blue
66a4b8e6b7
Add uvx to binary artifacts (#4743) 2024-07-02 17:15:28 -05:00
Zanie Blue
948c0f151b
Add retries to system-test-opensuse setup which flakes during database updates (#4622)
e.g. failure at
2681531811

Seems to be some sort of issue where they're updating their package
repository / database causing a spurious failure. I've seen this fail a
lot lately.
2024-06-28 15:24:43 -05:00
Charlie Marsh
6b45c41d76
Update cargo-dist to v0.17.0 (#4608)
## Summary

See: https://github.com/axodotdev/cargo-dist/releases/tag/v0.17.0.

Relevant:

> The only reason you might want to override this setting is if you're
using [dispatch-releases =
true](https://opensource.axo.dev/cargo-dist/book/reference/config.html#dispatch-releases)
and you really want your git tag to be the last operation in your
release process (because creating a GitHub Release necessarily creates
the git tag if it doesn't yet exist, and many organizations really don't
like when you delete/change git tags). In this case setting
github-release = "announce" will accomplish that, but the above race
conditions would then apply.

We _do_ use `dispatch-releases = true`, and we _do_ want the git tag to
be the last operation, so we need to set `github-release = "announce"`
to preserve our current behavior.
2024-06-28 10:59:09 -04:00
Zanie Blue
1ee201da5a
Add structured documentation (#4426)
A ton of work remaining here, pushing so I can preview things rendered.

Here's the [latest rendered
documentation](https://astral-sh.github.io/uv/).
2024-06-26 11:28:42 -05:00
Zanie Blue
d2108bf360
Separate CI test runs from the matrix (#4518)
So we can skip them when there are not code changes and still enforce
our required checks (xref #4438)

Otherwise, the names are dynamic and they are forever expected (see
#4426 for example)
2024-06-25 10:29:30 -05:00
renovate[bot]
8a0a3b47db
Update docker/build-push-action action to v6 (#4462) 2024-06-24 00:14:16 +00:00
Zanie Blue
7e574f5e20
Avoid running most of CI for non-code changes (#4438)
Running these test suites is both expensive and wasteful when there
aren't relevant changes.
2024-06-21 16:42:01 +00:00
Zanie Blue
b412a53e85
Add mdbook to docs workflow (#4437)
Based on
https://github.com/rust-lang/mdBook/wiki/Automated-Deployment%3A-GitHub-Actions
2024-06-21 16:33:55 +00:00
Zanie Blue
baa86f2edf
Fix the documentation branch target (#4428)
Doh.
2024-06-20 17:35:56 +00:00
Zanie Blue
30eedb35c6
Add documentation publishing workflow (#4427)
Exploring publishing documentation to GitHub Pages. Not intended for
public consumption yet.
2024-06-20 12:24:20 -05:00
Zanie Blue
76c26db444
Move virtual environment test context into main context (#4370)
It was becoming problematic that the virtual environment test context
diverged from the other one i.e. we had to implement filtering twice.
This combines the contexts and tweaks the `TestContext` API and
filtering mechanisms for Python versions. Combined with my previous
changes to the test context at #4364 and
https://github.com/astral-sh/uv/pull/4368 this finally unblocks the
snapshots for test cases in #4360 and
https://github.com/astral-sh/uv/pull/4362.
2024-06-18 09:11:47 -05:00
Zanie Blue
631994c485
Remove cargo dev fetch-python (#4337)
This has been fully replaced by `uv toolchain install`
2024-06-17 18:49:06 +00:00
Charlie Marsh
1f2ad8faa2
Re-add aarch64-unknown-linux-gnu binary to release assets (#4254)
This PR re-adds the `aarch64-unknown-linux-gnu` binary, which will also
add the `manylinux_2_28` wheel for `aarch64` (in addition to the now
dual-tagged `musllinux_1_1` and `manylinux_2_217` wheel for `aarch64`).
We can consider dropping that _wheel_, but in my assessment removing a
release asset should now be treated as a breaking change -- so removing
it in a patch release was incorrect.

Closes https://github.com/astral-sh/uv/issues/4122.
2024-06-11 19:46:09 -04:00
konsti
bbd961c251
Fix python3.13 on windows CI job by pinning older version (#4192)
See https://github.com/actions/setup-python/issues/888

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-10 11:49:24 +00:00
Charlie Marsh
e7c573cfcb
Fix existing typos and enable typos in CI (#4184) 2024-06-10 01:50:54 +00:00
konsti
f92447772e
Support x86 windows (#3873)
Add trampolines for x86 windows.

Closes https://github.com/astral-sh/uv/issues/3660.
2024-05-28 16:07:39 +00:00
Zanie Blue
30e780e1dd
Add persistent storage of installed toolchains (#3797)
Extends #3726 

Moves toolchain storage out of `UV_BOOTSTRAP_DIR` (`./bin`) into the
proper user data directory as defined by #3726.

Replaces `UV_BOOTSTRAP_DIR` with `UV_TOOLCHAIN_DIR` for customization.
Installed toolchains will be discovered without opt-in, but the idea is
still that these are not yet user-facing.
2024-05-27 03:54:49 +00:00
Zanie Blue
c2a58cd303
Add integration test for GitHub Actions CI patterns (#3805) 2024-05-23 23:25:06 -05:00
Ibraheem Ahmed
0d2f3fc4e4
Add airflow benchmark (#3643)
## Summary

This seems to be one of the most consistent benchmark cases we have in
terms of standard deviation:
```
➜  hyperfine "target/profiling/main pip compile scripts/requirements/airflow.in" --runs 200
Benchmark 1: target/profiling/main pip compile scripts/requirements/airflow.in
  Time (mean ± σ):     292.6 ms ±   6.6 ms    [User: 414.1 ms, System: 194.2 ms]
  Range (min … max):   282.7 ms … 320.1 ms    200 runs
```

For smaller benchmarks, scispacy and dtlssocket seem to be a bit more
consistent than our current jupyter benchmark, but it hasn't given us
any problems so I'll leave it for now.
2024-05-23 13:25:54 -04:00
Charlie Marsh
bb61c2d534
Revert "Revert "ci: drop native manylinux wheel for dual-tagged one (#3685)" (#3762)" (#3778)
Now that we have https://github.com/astral-sh/uv/pull/3761, it should be
safe to drop these.
2024-05-22 20:02:30 -04:00
Zanie Blue
17ec349437
Add test case for Conda CI (#3773)
Integration test coverage for #3769 

Failure against `main` on
2530051001

Rebased against #3771 to check for fix
2024-05-22 21:37:26 +00:00
Charlie Marsh
dc4f63d2e5
Revert "ci: drop native manylinux wheel for dual-tagged one (#3685)" (#3762)
## Summary

Reverts https://github.com/astral-sh/uv/pull/3685. We need to figure out
how to update the installer to handle this correctly.
2024-05-22 15:53:17 -04:00
Zanie Blue
845d788c91
Drop Python patch test flag from default features (#3746) 2024-05-22 17:19:25 +00:00
Charlie Marsh
472ab144d5
Remove maturin_editable test (#3718)
## Summary

I personally think this isn't worth continuing to maintain.
2024-05-22 11:10:04 +02:00
Zanie Blue
d540d0f28b
Rewrite Python interpreter discovery (#3266)
Updates our Python interpreter discovery to conform to the rules
described in #2386, please see that issue for a full description of the
behavior. Briefly, we now will search for interpreters that satisfy a
requested version without stopping at the first Python executable.
Additionally, if retrieving information about an interpreter fails we
will continue to search for a working interpreter. We also add the
plumbing necessary to request Python implementations other than CPython,
though we do not add support for other implementations at this time.

A major internal goal of this work is to prepare for user-facing managed
toolchains i.e. fetching a requested version during `uv run`. These APIs
are not introduced, but there is some managed toolchain handling as
required for our test suite.

Some noteworthy implementation changes:

- The `uv_interpreter::find_python` module has been removed in favor of
a `uv_interpreter::discovery` module.
- There are new types to help structure interpreter requests and track
sources
- Executable discovery is implemented as a big lazy iterator and is a
central authority for source precedence
- `uv_interpreter::Error` variants were split into scoped types in each
module
- There's much more unit test coverage, but not for Windows yet

Remaining work:

- [x] Write new test cases
- [x] Determine correct behavior around executables in the current
directory
- _Future_: Combine `PythonVersion` and `VersionRequest`
- _Future_: Consider splitting `ManagedToolchain` into local and remote
variants
- _Future_: Add Windows unit test coverage
- _Future_: Explore behavior around implementation precedence (i.e.
CPython over PyPy)

Refactors split into:

- #3329 
- #3330 
- #3331
- #3332

Closes #2386
2024-05-21 14:37:23 -05:00
Zanie Blue
dfd6ccf0f9
Move maturin test coverage into CI (#3714)
This test can take over 60s to run, which is too much for a unit test.
We'll run it in a separate CI job to retain coverage.
2024-05-21 19:17:48 +00:00
Henry Schreiner
906f653062
ci: drop native manylinux wheel for dual-tagged one (#3685)
<!--
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? -->

Followup to #3624. Drops the native manylinux wheel in favor of the
statically linked musl one with a manylinux2014 tag.

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

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-05-21 11:55:08 +02:00
Ben Beasley
53c2551fac
Pin the zip crate to 0.6 (#3645)
## Summary

Restore API-compatibility with pre-1.1.0 versions of the `zip` crate,
and pin the dependency to the 0.6 series, due to concerns discussed in
https://github.com/astral-sh/uv/issues/3642.

## Test Plan

```
cargo run -p uv-dev -- fetch-python
cargo test
```
2024-05-18 17:31:53 +00:00
Henry Schreiner
a0c5948a0b
ci: retag the musl aarch64 for manylinux2014 (#3624)
<!--
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

Fix #3439 by retagging the statically linked musl binary for
manylinux2014. This is the most conservative option;
the regular manylinux one could be removed as well, and I expect other
archs could probably do this as well.

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

## Test Plan

Testing on manylinux.

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

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-05-17 10:54:43 +02:00
samypr100
d88bef9704
feat: move to cargo-xwin for clippy (#3600)
## Summary

Move to cargo-xwin for clippy

Closes #3507
2024-05-16 21:15:03 -05:00
Henry Schreiner
f7b9ca9533
ci: add musl ppc64le (#3537)
## Summary

Working on followup to #3523. I expect some changes will be required to
match the glibc versions above.
2024-05-14 23:39:37 -04:00
Zanie Blue
759d40ceb9
Revert "Use manylinux: auto for aarch64 builds (#3444)" (#3576)
This reverts #3444 which appears to be the cause of SSL failures when
building aarch64 Linux images on macOS hosts (see
https://github.com/astral-sh/uv/issues/3570)

Closes https://github.com/astral-sh/uv/issues/3570
2024-05-14 08:51:07 -05:00
samypr100
790206beb1
feat: speed up windows jobs using ReFS (#3522)
## Summary

Switch to using Virtual HD + ReFS to speed up windows jobs.

Closes #3508
2024-05-13 11:15:54 -05:00
Charlie Marsh
aa6b853d78
Run cargo shear in CI (#3534) 2024-05-12 21:44:58 -04:00
Henry Schreiner
df43dc9e70
ci: build musllinux_1_1 wheels (#3523)
This is needed to include uv in manylinux, which has both the
musllinux_1_1 and musllinux_1_2 images.

## Summary

We are looking into including uv in the `pypa/manylinux` docker images,
so that cibuildwheel will be able to use it. But to do so, we need all
actively supported images to be able to take it, including
musllinux_1_1.

## Test Plan

The test was updated to make sure Alpine 3.12, which musllinux was based
on, can run uv.

The binary build does need to be triggered on this PR to make sure it
works. Ah,
5b6040184d/.github/workflows/build-binaries.yml (L15-L20)
is a good idea, nice.

Will need a followup to fill out the other platforms `pypa/manylinux`
supports for musllinux.

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-05-11 12:35:40 -04:00
Charlie Marsh
8bcb2365bf
Use manylinux: auto for aarch64 builds (#3444)
See: https://github.com/astral-sh/uv/issues/3439
2024-05-08 23:58:03 -04:00
Alex Waygood
3830e90770
Tell renovate not to try to update GitHub runners (#3427) 2024-05-07 16:09:21 +00:00
Charlie Marsh
e9490b92b5
Upgrade cargo-dist to v0.14.0 (#3414) 2024-05-06 13:48:41 -04:00