Commit Graph

221 Commits

Author SHA1 Message Date
konsti 4fdf5fc73f
Use a single lint task in CI (#7540) 2024-09-19 13:32:08 +02:00
Zanie Blue 4611412757
Allow Python pre-releases to be used if they are first on the `PATH` (#7470)
Closes https://github.com/astral-sh/uv/issues/7469
2024-09-18 10:19:10 -05:00
Charlie Marsh c87ce7aaf8
Run `cargo upgrade` (#7448)
Co-authored-by: konstin <konstin@mailbox.org>
2024-09-17 12:39:58 +02:00
Zanie Blue f22e5ef69a
Avoid selecting prerelease Python installations without opt-in (#7300)
Similar to our semantics for packages with pre-release versions.

We will not use prerelease versions unless there are only prerelease
versions available, a specific version is requested,
or the prerelease version is found in a reasonable source (active
environment, explicit path, etc. but not `PATH`).

For example, `uv python install 3.13 && uv run python --version` will no
longer use `3.13.0rc2` unless that is the only Python version available,
`--python 3.13` is used, or that's the Python version that is present in
`.venv`.
2024-09-11 15:49:33 -05:00
Zanie Blue ebd73d83f8
Allow explicitly requesting an system interpreter version in `check_system_python` (#7306)
Needed for #7300
2024-09-11 19:41:42 +00:00
Zanie Blue d7ec546e71
Add Python 3.13 system test for Linux (#7302)
Previously we only had coverage on Windows

e.g. for more test coverage in cases like
https://github.com/astral-sh/uv/pull/7300#discussion_r1755343870

I picked Linux over macOS because the 3.13 prereleases are not available
via HomeBrew?
2024-09-11 14:25:09 -05:00
Tom 7021b15a42
Fix PPC64 page size in binary builds. (#7298)
## Summary

Add maturin build flag to set 64kb page size on PPC64 and PPC64LE
architectures. Not aware of modern systems that use 4kb pages.

Resolves #6528

## Test Plan

ppc64le gnu dynamic-linked and musl static-linked binary builds were
tested successfully on an IBM Power9 system running RHEL 8.8. I do not
have access to other types of PPC64 systems for testing.
2024-09-11 14:13:49 -04:00
Ibraheem Ahmed 4f03d204df
Run benchmarks with `--profile profiling` (#5927)
## Summary

The CodSpeed flamegraphs are currently useless after
https://github.com/astral-sh/uv/pull/5745.
2024-09-10 14:25:53 -04:00
renovate[bot] ee74d74605
Update peter-evans/create-pull-request action to v7 (#7206) 2024-09-08 20:37:18 -04:00
Zanie Blue b36b7badff
Upgrade to the latest cargo-dist version (#7092)
Notably includes support for
[`UV_INSTALL_DIR`](https://github.com/axodotdev/cargo-dist/blob/main/CHANGELOG.md#app-branded-installer-environment-variables)
2024-09-05 13:30:33 -05:00
Charlie Marsh 2da795ae8c
Document official `setup-uv` action (#7056)
## Summary

Closes https://github.com/astral-sh/uv/issues/7047.
2024-09-05 13:59:01 -04:00
Jo d0fa9ccdfa
Use astral-sh/setup-uv action (#7084)
## Summary

Use the now official `astral-sh/setup-uv` action in
`sync-python-release.yml` workflow.
2024-09-05 13:04:46 -04:00
samypr100 595f5909b6
ci(docker)!: adjust entrypoint and cmd for inherited images (#7054)
## Summary

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

This removes our custom `ENTRYPOINT` just for the additional docker
tags, and makes it empty (to avoid possible upstream surprises if any)
and moves running uv to `CMD` for consistency.

This approach is probably the in-between solution from the discussion in
https://github.com/astral-sh/uv/issues/7030#issuecomment-2329443719 and
would work for everyone's use cases.

## Test Plan

Tested release workflow in
https://github.com/samypr100/uv/actions/runs/10711049920

The default CMD still gives a nice default.

```shell
> docker run ghcr.io/samypr100/uv:0.4.5-alpine
An extremely fast Python package manager.

Usage: uv [OPTIONS] <COMMAND>

Commands:
  run      Run a command or script
  init     Create a new project
  add      Add dependencies to the project
  remove   Remove dependencies from the project
  sync     Update the project's environment
  lock     Update the project's lockfile
  export   Export the project's lockfile to an alternate format
  tree     Display the project's dependency tree
  tool     Run and install commands provided by Python packages
  python   Manage Python versions and installations
  pip      Manage Python packages with a pip-compatible interface
  venv     Create a virtual environment
  build    Build Python packages into source distributions and wheels
  cache    Manage uv's cache
  version  Display uv's version
  help     Display documentation for a command
```
2024-09-04 18:55:21 -05:00
samypr100 37e25e2b1d
feat: introduce more docker tags for uv (#6053)
## Summary

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

This PR introduces additional images with the uv/uvx binaries from
scratch for both amd64/arm64 and make the mapping easy to configure by
generating the Dockerfile on the fly. This approach focuses on
minimizing CI time by taking advantage of dedicating a worker per
mapping (20-30s~ per job).

This PR also fixes `org.opencontainers.image.version` for all tags
(including the one from `scratch) to contain the right release version
instead of branch name `main` (default when no tag patterns are
specified).

For example, on release `x.y.z`, this will publish the following image
tags with format `ghcr.io/astral-sh/uv:{tag}` with manifests for both
amd64/arm64. This also include `x.y` tags for each respective additional
tag.

* From **scratch**: `latest`, `x.y.z`, `x.y` (currently being published)
* From **alpine:3.20**: `alpine`, `alpine3.20`, `x.y.z-alpine`,
`x.y.z-alpine3.20`
* From **debian:bookworm-slim**: `debian-slim`, `bookworm-slim`,
`x.y.z-debian-slim`, `x.y.z-bookworm-slim`
* From **buildpack-deps:bookworm**: `debian`, `bookworm`,
`x.y.z-debian`, `x.y.z-bookworm`
* From **python:3.12-alpine**: `python3.12-alpine`,
`x.y.z-python3.12-alpine`
* From **python:3.11-alpine**: `python3.11-alpine`,
`x.y.z-python3.11-alpine`
* From **python:3.10-alpine**: `python3.10-alpine`,
`x.y.z-python3.10-alpine`
* From **python:3.9-alpine**: `python3.9-alpine`,
`x.y.z-python3.9-alpine`
* From **python:3.8-alpine**: `python3.8-alpine`,
`x.y.z-python3.8-alpine`
* From **python:3.12-bookworm**: `python3.12-bookworm`,
`x.y.z-python3.12-bookworm`
* From **python:3.11-bookworm**: `python3.11-bookworm`,
`x.y.z-python3.11-bookworm`
* From **python:3.10-bookworm**: `python3.10-bookworm`,
`x.y.z-python3.10-bookworm`
* From **python:3.9-bookworm**: `python3.9-bookworm`,
`x.y.z-python3.9-bookworm`
* From **python:3.8-bookworm**: `python3.8-bookworm`,
`x.y.z-python3.8-bookworm`
* From **python:3.12-slim-bookworm**: `python3.12-slim-bookworm`,
`x.y.z-python3.12-slim-bookworm`
* From **python:3.11-slim-bookworm**: `python3.11-slim-bookworm`,
`x.y.z-python3.11-slim-bookworm`
* From **python:3.10-slim-bookworm**: `python3.10-slim-bookworm`,
`x.y.z-python3.10-slim-bookworm`
* From **python:3.9-slim-bookworm**: `python3.9-slim-bookworm`,
`x.y.z-python3.9-slim-bookworm`
* From **python:3.8-slim-bookworm**: `python3.8-slim-bookworm`,
`x.y.z-python3.8-slim-bookworm`
2024-09-03 08:44:01 -05:00
renovate[bot] ea0a0db7a7
Update fedora Docker tag to v42 (#6924) 2024-09-02 14:01:51 -04:00
Mathieu Kniewallner fe5f085299
chore: run `cargo dev generate-all` on CI and locally (#6899)
## Summary

Noticed that running `cargo dev generate-all` on `main` produced changes
and saw that that the command is not run on the CI nor as a pre-commit
hook.

Not sure if having the command running as a pre-commit hook is something
we want, so I can remove it if you prefer. I find that nice to have as
it's probably easy to forget to run it, especially for new contributors
(and it will only run if there are changes in `uv_cli` or `uv_settings`
crates).

## Test Plan

- Added `cargo dev generate-all --mode check` on the CI, which produced
[this failing
job](https://github.com/astral-sh/uv/actions/runs/10648055597/job/29516699393)
- Ran `cargo dev generate-all` locally and committed the changes, which
produced [this succeeding
job](https://github.com/astral-sh/uv/actions/runs/10648076910/job/29516744942)
2024-08-31 19:03:53 -04:00
Amos Wenger 3e207da3bc
ci(windows): Introduce setup-dev-drive.ps1, maximize dev drive usage (#6858)
As suggested by @samypr100 on #6680:
https://github.com/astral-sh/uv/pull/6680#issuecomment-2313607984

## Summary

Instead of using `UV_INTERNAL__TEST_DIR`, it simply exports `TEMP` when
running Windows jobs.

## Test Plan

I'm going to run this manually under ProcMon on my Windows machine and
see where uv writes temp files, hopefully to the dev drive and not
`%(LOCAL)APPDATA%` or something.

I'm going to commit a dummy code change and look at build time changes
in CI.
2024-08-30 08:54:25 -04:00
Zanie Blue bc52596cd9
Use the larger x64 macOS runner for release builds (#6767)
Closes https://github.com/astral-sh/uv/issues/6766
2024-08-29 15:11:53 -05:00
Zanie Blue c730530b4e
Add timeouts to all of the CI jobs (#6769)
Noticed
https://github.com/astral-sh/uv/actions/runs/10601946253/job/29382920849?pr=6767
hung. This seems like best practice.
2024-08-28 18:57:22 +00:00
Zanie Blue b9d027b67a
Use `uvx` for Python linting in CI (#6771) 2024-08-28 13:54:34 -05:00
samypr100 3eee70dfa1
feat: publish tag without patch version (#6734)
## Summary

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

This change would publish an additional tag that includes only
`major.minor`.

For a release with x.y.z, this would publish the tags:
* `ghcr.io/astral-sh/uv:latest`
* `ghcr.io/astral-sh/uv:x.y.z`
* `ghcr.io/astral-sh/uv:x.y`
2024-08-28 08:31:53 -05:00
Amos Wenger 2c5cc62106
ci: Make Windows tests ~27% faster by putting temp folder in dev drive (#6680)
## Summary

This PR makes `cargo test | windows` faster in CI.

### Before

![Windows tests take
5m44s](https://github.com/user-attachments/assets/8dd9c619-9b7b-4ebd-a027-56e7967b6d34)

### After

![Windows tests take
5m12s](https://github.com/user-attachments/assets/7702fdba-3034-4db8-b211-85207a1feffa)

## Also

This PR disables the `brotli` feature of `async-compression` since it's
not strictly needed, but this has little to do with the improvements
(it's still less code to build).

This PR introduces additional code in uv tool uninstall to ignore errors
(that only seem to happen on ReFS, ie. on Dev Drives) akin to "the thing
we're trying to delete cannot be deleted because it's already being
deleted".

If `raw_os_error` was stable we could do u32 matching instead of that
`.to_string().contains()` abomination.
2024-08-27 15:25:05 -05:00
Zanie Blue 6d38d42b41
Always run both public and private documentation checks (#6707)
Avoiding failures like https://github.com/astral-sh/uv/pull/6705

Context in https://github.com/astral-sh/uv/pull/6099

## Test plan

Even though I opened the pull request, the public build was still
tested.
2024-08-27 17:35:43 +00:00
renovate[bot] b68406bb56
Update tj-actions/changed-files action to v45 (#6632) 2024-08-25 22:12:03 -04:00
samypr100 a959772074
feat: use multi-runner on docker publish (#6556)
## Summary

This PR parallelizes multi-platform builds using multiple workers (hence
the new docker-build / docker-publish jobs), this seems to save about ~8
minutes.

This is partial work extracted from
https://github.com/astral-sh/uv/pull/6053 than is standalone
2024-08-23 18:50:46 -05:00
Zanie Blue f9348a6ea3
Run tests when `docs/reference` generated files change (#6551)
Short-term fix for https://github.com/astral-sh/uv/issues/6352
2024-08-23 17:35:53 -05:00
Andrew Gallant b9ff03d73c ci: increase dev drive size
For working around linked errors:
https://github.com/astral-sh/uv/actions/runs/10371457087/job/28711821180?pr=5887
2024-08-13 08:35:46 -07:00
Zanie Blue e097f948c9
Bump version to 0.2.35 (#5984) 2024-08-09 19:21:06 -05:00
Ibraheem Ahmed ddb82a01c8
Add basic universal benchmarks to CI (#5938)
## Summary

Resolves https://github.com/astral-sh/uv/issues/4921.
2024-08-09 12:52:28 -04:00
Zanie Blue e9dd4876b8
Skip git tests on Windows (#5891)
Might be pushing it on test coverage, but these are some of our slowest
tests we might get a significant speedup here.

Part of #5713
2024-08-08 10:37:24 -05:00
Zanie Blue 7523673f39
Setup Rust after restoring the cache (#5892)
This saves about 10-20s

Part of #5713
2024-08-07 16:33:12 -05:00
Zanie Blue 858d75d0af
Use a larger runner for Linux test jobs (#5883)
From 8 to 16 cores, 32 to 64 GB RAM for a 2x per minute cost increase.

As in:

- #5874 
- #5873
2024-08-07 18:39:31 +00:00
Zanie Blue c77f213acd
Use a larger runner for macOS test jobs (#5874)
From 3 to 6 (+8 GPU) cores, 7 to 14 GB ram.

Related:
- https://github.com/astral-sh/uv/pull/5873
2024-08-07 12:32:08 -05:00
Zanie Blue 8dad1ac2d4
Use a larger runner for Windows test jobs (#5873)
From 8 to 16 cores, 32 to 64 GB ram. Testing on Windows first because
it's the bottleneck.

Previously tested in #2515 to no effect, maybe better now that we have a
development drive?
2024-08-07 12:31:59 -05:00
samypr100 2cd63f06dc
feat: more rust in trampoline (#5750)
## Summary

This is an experimental PR to replace more unsafe calls with more rust
while still trying to keep the binary size small enough. These changes
roughly increase the size of the trampolines to about 40kb~. This is a
alternate PR to https://github.com/astral-sh/uv/pull/5751.

The primary changes here include
* Switch to use rust path components for ease of path management
* Leverage `std::process::exit` for process exit and cleanup
* Use `std::io::Error::last_os_error` for IO Errors to remove
`FormatMessage` complexity
* Use `std::env::current_exe` to get the current executable instead of
`GetModuleFileNameA`

## Test Plan

Added one more existing test case to trampoline tests.
Still need to verify dunce::canonicalize is desired or not on
find_python_exe.

---------

Co-authored-by: konstin <konstin@mailbox.org>
2024-08-07 08:19:38 +00:00
konsti db371560bc
Use prettier to format the documentation (#5708)
To enforce the 100 character line limit in markdown files introduced in
https://github.com/astral-sh/uv/pull/5635, and to automate the
formatting of markdown files, i've added prettier and formatted our
markdown files with it.

I've excluded the changelog and the generated references documentation
from this for having too many changes, but we can also include them.

I'm not particular on which style we use. My main motivations are
(major) not having to reflow markdown files myself anymore and (minor)
consistence between all markdown files. I've chosen prettier for similar
reason as we chose black, it's a single good style that's automated and
shared in the community. I do prefer prettier's style of not breaking
inside of a link name though.

This PR is in two parts, the first adds prettier to CI and documents
using it, while the second actually formats the docs. When merge
conflicts arise, we can drop the last commit and regenerate it with `npx
prettier --prose-wrap always --write BENCHMARKS.md CONTRIBUTING.md
README.md STYLE.md docs/*.md docs/concepts/**/*.md docs/guides/**/*.md
docs/pip/**/*.md`.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-02 08:58:31 -05:00
Zanie Blue c558d70690
Install Python versions with previous uv release (#5717)
Part of https://github.com/astral-sh/uv/issues/5713

Shaves 50s or ~25% off the Ubuntu test run. Maybe 30s or 8% off macOS.
Windows already uses the GitHub distributions.

Note this is some of our only test coverage for Python version installs,
we may want to add separate coverage to compensate.
2024-08-01 18:59:28 -05:00
Charlie Marsh 5d727cb0af
Deprecate the `--isolated` flag (#5466)
## Summary

This PR deprecates the `--isolated` flag. The treatment varies across
the APIs:

- For non-preview APIs, we warn but treat it as equivalent to
`--no-config`.
- For preview APIs, we warn and ignore it, with two exceptions...
- For `tool run` and `run` specifically, we don't even warn, because we
can't differentiate the command-specific `--isolated` from the global
`--isolated`.
2024-07-30 22:40:38 +00:00
Charlie Marsh e6ad0cd2f9
Remove PyO3 updates from renovate (#5559) 2024-07-29 14:38:12 +00:00
renovate[bot] 8f378ec2c9
Update CodSpeedHQ/action action to v3 (#5549)
=
2024-07-29 10:03:04 -04:00
renovate[bot] 5365794023
Update hynek/setup-cached-uv action to v2 (#5550) 2024-07-29 09:44:03 -04:00
konsti 2452314f20
Add exclude-newer to benches case priming (#5554)
Uses the same cutoff that the benchmark itself uses
2024-07-29 13:48:38 +02:00
konsti 78be9a6a6b
Add trampoline tests to CI (#5331)
Add the tests added in #5204 to CI. The crate is not part of the
workspace (it requires nightly) and is windows only, so we have to test
it separately.

---------

Co-authored-by: samypr100 <3933065+samypr100@users.noreply.github.com>
2024-07-29 11:43:50 +02:00
Jo 62e72f51ff
Remove an extra quote in `sync-python-releaes.yml` (#5393) 2024-07-24 02:53:00 +00:00
Jo 17d63b0e07
Update `python-build-standalone` workflow (#5390)
## Summary

After #5337, `fetch-download-metadata.py` fetches not just from
`python-build-standalone`, so updates the workflow to
`sync-python-releases.yml`.

Also includes `crates/uv-python/download-metadata.json` in `add-paths`.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-07-24 02:11:52 +00:00
Zanie Blue aced05d427
Use the docs bot email for docs publish commits (#5369) 2024-07-23 16:04:12 -05:00
Jo 7ddf67a72b
Add PyPy finder (#5337)
## Summary

This PR adds PyPy finder and adds PyPy to uv managed Python versions.

## Test Plan

```console
$ cargo run -- python install
```
2024-07-23 14:58:04 -05:00
Jo 43084249ee
Add mypy type check for uv-python scripts (#5332)
## Summary

Per https://github.com/astral-sh/uv/pull/4853#issuecomment-2212505407

> If we're going to aim for full type coverage, we should probably
follow this by adding type checking in CI too otherwise it seems too
easy for it to become out of date.
2024-07-23 09:14:05 -05:00
Jo 025f2f3162
Fix `python-build-standalone` workflow (#5327)
## Summary

The script reads `GITHUB_TOKEN` instead. And since #4853 merged, there
is no need to use `uv run --with`.
2024-07-23 08:20:36 -04:00
Charlie Marsh dc108e373a
Add an automated job to sync `python-build-standalone` releases (#5261)
## Summary

Perhaps in the future we can trigger this directly on release in
`python-build-standalone`, but for now it's a cron job.
2024-07-22 14:55:47 -04:00