Commit Graph

344 Commits

Author SHA1 Message Date
William Woodruff 7b3199f07c
Collect and upload PEP 740 attestations during `uv publish` (#16731)
Co-authored-by: konsti <konstin@mailbox.org>
2025-11-24 16:47:15 -05:00
Zanie Blue 7b8240dca9
Generate a README for crate members too (#16812)
We skip members with existing READMEs for now.

Follows #16809 and #16811
2025-11-21 15:44:05 -06:00
Zanie Blue ba46a448d4
Enumerate workspace members in the uv crate README (#16811) 2025-11-21 13:44:59 -06:00
Zanie Blue a8bf05d83b
Add manual release script (#16799)
Unfortunately I need this sometimes
2025-11-21 10:45:08 -06:00
Zanie Blue 4be1e0a83c
Bump version to 0.9.11 (#16794) 2025-11-20 16:24:01 -06:00
Zanie Blue dfe89047bb
Publish to `crates.io` (#16770) 2025-11-20 21:26:44 +00:00
William Woodruff f78ddf05c4
Add an integration test for publishing to pyx (#16740) 2025-11-18 12:13:57 -05:00
Zanie Blue 2652244655
Bump version to 0.9.6 (#16500)
Signed-off-by: William Woodruff <william@astral.sh>
Co-authored-by: William Woodruff <william@astral.sh>
2025-10-29 14:08:49 -05:00
David Peter b50c1be100
Only add actual schema in schemastore PRs (#16346)
## Summary

Last time I ran the `update_schemastore.py` script in ty, due to what I
assume was a `npm` version mismatch, the `package-lock.json` file was
updated while running `npm install` in the `schemastore`. Due to the use
of `git commit -a`, it was accidentally included in the commit for the
semi-automated schemastore PR. The solution here is to only add the
actual file that we want to commit.

Same as https://github.com/astral-sh/ty/pull/1391

## Test Plan

I did a dry-run of this script (by commenting out the final `push`) and
verified that the commit did include the schema, but not the updated
`package-lock.json` file.
2025-10-17 19:35:53 +00:00
Zanie Blue 39b6886536
Bump version to 0.9.0 (#16161)
Co-authored-by: konsti <konstin@mailbox.org>
2025-10-07 23:17:42 +00:00
Charlie Marsh 170ab1cd7f
Ignore origin when comparing installed tools (#16055)
## Summary

This field gets dropped when you serialize and deserialize, so we should
ignore it when comparing indexes.

Closes https://github.com/astral-sh/uv/issues/16051.
2025-09-29 17:23:18 +00:00
Zanie Blue 15975b00ea
Upgrade rooster to v0.1.0 (#16025) 2025-09-25 09:11:04 -05:00
konsti 663053b0d1
packse: Use our own rendering exclusively, and use pylock.toml (#15796)
This PR contains two changes: The companion PR to
https://github.com/astral-sh/packse/pull/277, which moderately
simplifies the uv side, and switching to pylock.toml for packse as
dogfooding. These changes can be applied independent from each other.

Since all files, including the vendored build dependencies, are now on
GitHub Pages under the same root, we only need a packse index root URL.
2025-09-16 15:25:11 +02:00
konsti 2ec71bd608
Update packse to 0.3.52: Fix requires python 3.12 (#15786)
Pull in the latest packse changes to make all test work with the new
default Python requirement, 3.12.
2025-09-11 13:19:34 +00:00
Zanie Blue ab2880f389
Upgrade to the latest rooster version (#15749)
For all my latest bells and whistles...

It's not published yet since it has breaking changes, so we're using the
commit. (This is what ty does)
2025-09-10 14:34:43 -05:00
Zanie Blue 32bcfdff0a Add case for `uv auth login` in registry integration tests (#15593)
Adds an alternative third-party registry test mode that uses `uv auth
login` instead of the environment variables to provide configuration.
2025-09-02 13:16:52 -05:00
Zanie Blue 53599d9f56 Add test case for `uv auth login` in publish integration tests (#15592) 2025-09-02 13:16:52 -05:00
Zanie Blue a60312a9b8
Improve publish test error when no versions are found (#15594) 2025-08-30 10:35:54 -05:00
Chris Hughes 9346b4d0f6
fix: Handle dotted package names in script path resolution (#15300)
<!--
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 WindowsRunnable::from_script_path to correctly append extensions
instead of replacing them when resolving executable paths. This resolves
https://github.com/astral-sh/uv/issues/15165#issue-3304086689.

- Add add_extension_to_path helper that appends extensions properly
- Update extension resolution to use the new helper
- Add tests

## Test Plan

Added unit tests for the new and existing functionality that the change
touches. Tested manually locally on Windows.
<!-- How was it tested? -->

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-08-15 16:44:59 -05:00
Zanie Blue 278295ef02
Add test cases for `find_uv_bin` (#15110)
Adds test cases to unblock

- https://github.com/astral-sh/uv/pull/14181
- https://github.com/astral-sh/uv/pull/14182
- https://github.com/astral-sh/uv/pull/14184
- https://github.com/astral-sh/uv/pull/14184
- https://github.com/tox-dev/pre-commit-uv/issues/70

We use a package with a symlink to the Python module to get a mock
installation of uv without building (or packaging) the uv binary. This
lets us test real patterns like `uv pip install --prefix` without
encoding logic about where things are placed during those installs.

---------

Co-authored-by: konstin <konstin@mailbox.org>
2025-08-07 07:14:01 -05:00
Charlie Marsh fa24d9a5e2
Include wheel hashes from local Simple indexes (#14993)
## Summary

This just looks like an oversight. We weren't including hashes from
local Simple API indexes if a package had both a wheel and a source
distribution.

Closes https://github.com/astral-sh/uv/issues/14883
2025-07-31 14:20:49 +00:00
Zanie Blue 6856a27711
Add `extra-build-dependencies` (#14735)
Replaces https://github.com/astral-sh/uv/pull/14092

Adds `tool.uv.extra-build-dependencies = {package = [dependency, ...]}`
which extends `build-system.requires` during package builds.

These are lowered via workspace sources, are applied to transitive
dependencies, and are included in the wheel cache shard hash.

There are some features we need to follow-up on, but are out of scope
here:

- Preferring locked versions for build dependencies
- Settings for requiring locked versions for build depencies

There are some quality of life follow-ups we should also do:

- Warn on `extra-build-dependencies` that do not apply to any packages
- Add test cases and improve error messaging when the
`extra-build-dependencies` resolve fails


-------

There ~are~ were a few open decisions to be made here

1. Should we resolve these dependencies alongside the
`build-system.requires` dependencies? Or should we resolve separately?
(I think the latter is more powerful? because you can override things?
but it opens the door to breaking your build)
2. Should we install these dependencies into the same environment? Or
should we layer it on top as we do elsewhere? (I think it's fine to
install into the same environment)
3. Should we respect sources defined in the parent project? (I think
yes, but then we need to lower the dependencies earlier — I don't think
that's a big deal, but it's not implemented)
4. Should we respect sources defined in the child project? (I think no,
this gets really complicated and seems weird to allow)
5. Should we apply this to transitive dependencies? (I think so)

---------

Co-authored-by: Aria Desires <aria.desires@gmail.com>
Co-authored-by: konstin <konstin@mailbox.org>
2025-07-30 09:53:07 -05:00
Zanie Blue 7c2819d1f6
Match `--bounds` formatting for `uv_build` bounds in `uv init` (#14731)
Closes #14724 

https://chatgpt.com/codex/tasks/task_e_687a53ba646c8331baa4140c5b2bec70

---------

Co-authored-by: konstin <konstin@mailbox.org>
2025-07-21 09:48:38 +00:00
Zanie Blue 1a339b76e8 Add release notes and bump version for 0.8.0 (#14690)
[Rendered](https://github.com/astral-sh/uv/blob/zb/release-notes/CHANGELOG.md)
2025-07-17 17:20:21 -05:00
Zanie Blue 1f49fbd53c
Display `sys.executable` names in check system jobs (#14656)
Cherry-picked from https://github.com/astral-sh/uv/pull/14652

This is useful for debugging
2025-07-16 09:17:01 -05:00
John Mumm e40d3d5dff
Re-enable Artifactory in the registries integration test (#14408)
Having worked out the account issue, I've re-enabled Artifactory in the
registries test.
2025-07-02 13:50:35 +02:00
Zanie Blue 1ff8fc0947
Use Flit instead of Poetry for uninstall tests (#14285)
Investigating https://github.com/astral-sh/uv/issues/14158
2025-06-26 18:09:04 +00:00
John Mumm a27e60a22f
Temporarily disable Artifactory registry test (#14276)
I'm waiting on a response to get our subscription back up. Then I can
re-enable this. But for now, this would cause failing CI tests.
2025-06-26 09:47:18 -05:00
konsti ee0ba65eb2
Unify test venv `python` command creation (#14117)
Refactoring in preparation for
https://github.com/astral-sh/uv/pull/14080
2025-06-18 15:06:09 +02:00
konsti 499c8aa808
Fix PyPI publish test script (#14116)
The script stumbled over a newline introduced in
https://github.com/pypi/warehouse/pull/18266 (which is valid).

Also fixed: Don't read versions for the same package from other indexes.
We were using `project_name` here instead of `target`, while using the
latter and only reading from a single index simplifies the code too.
2025-06-18 09:51:53 +02:00
John Mumm 2fc922144a
Add script for testing uv against different registries (#13615)
This PR provides a script that uses environment variables to determine
which registries to test. This script is being used to run automated
registry tests in CI for AWS, Azure, GCP, Artifactory, GitLab,
Cloudsmith, and Gemfury.

You must configure the following required env vars for each registry:
```
    UV_TEST_<registry_name>_URL            URL for the registry
    UV_TEST_<registry_name>_TOKEN       authentication token
    UV_TEST_<registry_name>_PKG          private package to install
```

The username defaults to "\_\_token\_\_" but can be optionally set with:
```
    UV_TEST_<registry_name>_USERNAME
```

For each configured registry, the test will attempt to install the
specified package. Some registries can fall back to PyPI internally, so
it's important to choose a package that only exists in the registry you
are testing.

Currently, a successful test means that it finds the line “ +
<package_name>” in the output. This is because in its current form we
don’t know ahead of time what package it is and hence what the exact
expected output would be. The advantage if that anyone can run this
locally, though they would have to have access to the registries they
want to test.

You can also use the `--use-op` command line argument to derive these
test env vars from a 1Password vault (default is "RegistryTests" but can
be configured with `--op-vault`). It will look at all items in the vault
with names following the pattern `UV_TEST_<registry_name>` and will
derive the env vars as follows:

```
    `UV_TEST_<registry_name>_USERNAME` from the `username` field
    `UV_TEST_<registry_name>_TOKEN` from the `password` field
    `UV_TEST_<registry_name>_URL` from a field with the label `url`
    `UV_TEST_<registry_name>_PKG` from a field with the label `pkg`
```
2025-06-18 09:43:45 +02:00
Zanie Blue c25c800367
Fix Ruff linting (#14111) 2025-06-17 17:28:23 +00:00
konsti 5b0133c0ec
Hint at `tool.uv.required-environments` (#13575)
For the case where there was no matching wheel on sync, we previously
added a note about which wheels are available vs. on which platform you
are on. We extend this error message to link directly towards
`tool.uv.required-environments`, which otherwise has a discovery
problem.

On Linux (Setting `tool.uv.required-environments` doesn't help here
either, but it's a clear example):

```
[project]
name = "debug"
version = "0.1.0"
requires-python = "==3.10.*"
dependencies = ["tensorflow-macos>=2.13.1"]
```

```
Resolved 41 packages in 24ms
error: Distribution `tensorflow-macos==2.16.2 @ registry+https://pypi.org/simple` can't be installed because it doesn't have a source distribution or wheel for the current platform

hint: You're on Linux (`manylinux_2_39_x86_64`), but there are no wheels for the current platform, consider configuring `tool.uv.required-environments`.
hint: `tensorflow-macos` (v2.16.2) only has wheels for the following platform: `macosx_12_0_arm64`.
```


![image](https://github.com/user-attachments/assets/b6b49461-10d6-4e1d-bc0a-5d35d98e33d0)

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-06-06 19:15:52 +00:00
Zanie Blue 56ce40b0f4
Update packse scenarios (#13688)
Closes #13676 

See https://github.com/astral-sh/packse/pull/242 and
https://github.com/astral-sh/packse/releases/tag/0.3.47
2025-05-28 08:58:38 -05:00
Tim Felgentreff 878c2acdf3
Add downloading of GraalPy (#13172)
## Summary

This adds GraalPy download metadata so that `uv python install graalpy`
works. See https://github.com/astral-sh/uv/issues/13114

## Test Plan

The existing integration test was changed to test this functionality.
2025-05-06 11:02:27 -05:00
Zanie Blue 1e8e08def2 Bump version to 0.7.0 and write changelog (#13201)
The changelog diff is deranged. Rendered at
https://github.com/astral-sh/uv/blob/zb/changelog-07/CHANGELOG.md#070

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2025-04-29 16:37:00 -05:00
Zanie Blue de1479c4ef Use index URL instead of package URL for keyring credential lookups (#12651)
Some registries (like Azure Artifact) can require you to authenticate
separately for every package URL if you do not authenticate for the
/simple endpoint. These changes make the auth middleware aware of index
URL endpoints and attempts to fetch keyring credentials for such an
index URL when making a request to any URL it's a prefix of.

The current uv behavior is to cache credentials either at the request
URL or realm level. But with these changes, we also need to cache
credentials at the index level. Note that when uv does not detect an
index URL for a request URL, it will continue to apply the old behavior.

Addresses part of #4056
Closes #4583
Closes #11236
Closes #11391
Closes #11507
2025-04-29 16:37:00 -05:00
Zanie Blue daeae612aa
Add `--version` to smoke tests (#12516) 2025-03-27 20:45:25 +00:00
Zanie Blue a28db37f33
Add smoke test script in Python (#11628)
I wanted to consolidate these anyway, and apparently it's a huge pain to
make a Windows task fail early via GitHub's PowerShell setup so I
implement this in Python instead.
2025-03-27 15:35:21 -05:00
Zanie Blue 37c25f2a9d
Use `keyring --mode creds` when `authenticate = "always"` (#12316)
Previously, we required a username to perform a fetch from the keyring
because the `keyring` CLI only supported fetching password for a given
service and username. Unfortunately, this is different from the keyring
Python API which supported fetching a username _and_ password for a
given service. We can't (easily) use the Python API because we don't
expect `keyring` to be installed in a specific environment during
network requests. This means that we did not have parity with `pip`.

Way back in https://github.com/jaraco/keyring/pull/678 we got a `--mode
creds` flag added to `keyring`'s CLI which supports parity with the
Python API. Since `keyring` is expensive to invoke and we cannot be
certain that users are on the latest version of keyring, we've not added
support for invoking keyring with this flag. However, now that we have a
mode that says authentication is _required_ for an index (#11896), we
might as well _try_ to invoke keyring with `--mode creds` when there is
no username. This will address use-cases where the username is
non-constant and move us closer to `pip` parity.
2025-03-19 16:30:32 -05:00
Charlie Marsh 2a9bade4df
Use `uv sync` in workspace tests (#12181) 2025-03-15 20:52:43 +00:00
Zanie Blue 4f70d144d7
Reverse and format the archived changelogs (#12099)
I think it's important for the breaking changes to be at the _top_ of
the file instead of the bottom.

Now that it's not being rendered by GitHub's Releases markdown, we can
remove the prettier ignores.
2025-03-12 11:58:51 -05:00
konsti aa629c4a54
Re-add 3 retries in `uv publish` (#12041)
In the publish client, we have to set the client retries to 0 as the
retry middleware is incompatible with upload bodies. This however also
sets `client.retry_policy()` to a zero-retry policy, so we need to
construct our own policy.

Fixes #12027

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-03-10 12:38:08 +01:00
konsti bf4c7afe8b
A minimal build backend for uv: uv_build (#11446)
uv itself is a large package with many dependencies and lots of
features. To build a package using the uv build backend, you shouldn't
have to download and install the entirety of uv. For platform where we
don't provide wheels, it should be possible and fast to compile the uv
build backend. To that end, we're introducing a python package that
contains a trimmed down version of uv that only contains the build
backend, with a minimal dependency tree in rust.

The `uv_build` package is publish from CI just like uv itself. It is
part of the workspace, but has much less dependencies for its own
binary. We're using cargo deny to enforce that the network stack is not
part of the dependencies. A new build profile ensure we're getting the
minimum possible binary size for a rust binary.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-03-06 13:27:20 -06:00
Hugo van Kemenade 6578885a45
Update top-pypi-packages filename (#11959)
<!--
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? -->

To stay within quota, it now has just under 30 days of data, so the
filename has been updated. Both will be available for a while. See
https://github.com/hugovk/top-pypi-packages/pull/46.


## Test Plan

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

```sh
curl https://hugovk.github.io/top-pypi-packages/top-pypi-packages-30-days.min.json | jq -r ❯ 
curl https://hugovk.github.io/top-pypi-packages/top-pypi-packages.min.json | jq -r ".rows | .
diff pypi_8k_downloads_original.txt pypi_8k_downloads_new.txt
```
2025-03-04 18:23:02 -05:00
konsti dc39d6622b
Fix non-directory in workspace on Windows (#11833)
Fixes #11793

On Windows, trying to read a file inside what is not a directory but
another file results in a not found error, while on Unix we get a not a
directory error. We check explicitly if something included in a
workspace glob is a non-directory to fix the behavior on Windows.
2025-02-28 13:40:19 +01:00
konsti 929e7c3ad9
Revert "Temporarily disable cloudsmith test" (#11590)
Cloudsmith increased our limit, we can test on cloudsmith again.

This reverts commit f675c119dd.
2025-02-18 10:00:09 +01:00
konsti 8996d5c358
Temporarily disable cloudsmith test (#11581)
We've run into a ratelimit, disable the test until that's bumped.
2025-02-17 12:27:52 -06:00
Zanie Blue 591f38c25e
Bump version to v0.6.0 (#11496)
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2025-02-14 11:55:54 -06:00
konsti bd9607bbf9
Properly format test publish error (#11001) 2025-01-27 21:03:21 +01:00