## Summary
Closes https://github.com/astral-sh/uv/issues/17331
Certain applications on windows expect to be notified when environment
variables change such as conhost.exe (traditional cmd.exe host).
Without this notification conhost.exe will not pick up changes to
environment variables regardless of how many times conhost.exe is
re-launched after running `uv tool update-shell`.
## Test Plan
Before this change
1. Removed `%USERPROFILE%\.local\bin` from environment variables via UI
(which sends `WM_SETTINGCHANGE`)
2. Launched `%SYSTEMROOT%\System32\conhost.exe` and attempted to run any
tool preivously installed. It fails to find any.
3. Ran `uv tool update-shell`. Confirmed
`HKEY_CURRENT_USER\Environment\Path` was updated in registry.
4. Launched new `%SYSTEMROOT%\System32\conhost.exe` session. **Fails to
find installed tools**.
After this change
1. Removed `%USERPROFILE%\.local\bin` from environment variables via UI
(which sends `WM_SETTINGCHANGE`)
2. Launched `%SYSTEMROOT%\System32\conhost.exe` and attempted to run any
tool preivously installed. It fails to find any.
3. Ran `uv tool update-shell`. Confirmed
`HKEY_CURRENT_USER\Environment\Path` was updated in registry.
4. Launched new `%SYSTEMROOT%\System32\conhost.exe` session. **Finds the
installed tools**.
<!--
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 https://github.com/astral-sh/uv/issues/17174 mentioned the invalid
issues here:
results of diagnostics:
before:
```
--- TRAMPOLINE DIAGNOSTICS: STARTUP ---
STDIN: Handle=184
-> Console Mode: 503
STDOUT: Handle=536
-> Console Mode: 7
STDERR: Handle=540
-> Console Mode: 7
-------------------------------------------
--- TRAMPOLINE DIAGNOSTICS: AFTER CLOSE_HANDLES ---
STDIN: INVALID
STDOUT: INVALID
STDERR: Handle=540
-> Console Mode: 7
```
after:
```
--- TRAMPOLINE DIAGNOSTICS: STARTUP ---
STDIN: Handle=716
-> Console Mode: 503
STDOUT: Handle=580
-> Console Mode: 7
STDERR: Handle=604
-> Console Mode: 7
-------------------------------------------
--- TRAMPOLINE DIAGNOSTICS: AFTER CLOSE_HANDLES ---
STDIN: Handle=716
-> Console Mode: 503
STDOUT: Handle=580
-> Console Mode: 7
STDERR: Handle=604
-> Console Mode: 7
```
the problem was we were closing the handlers whatever they were from
pipes (byte streams) or consoles, this will make sure we close only the
handlers from pipes by using `FILE_TYPE_PIPE`
## Test Plan
<!-- How was it tested? -->
completely manual by adding debug statements and running a simple script
to open the pdb.
## Summary
For pyx, we can allow uploads that bypass the registry and send the file
directly to S3. This is an opt-in feature, enabled via the `--direct`
flag.
I've noticed this escapes the trampoline crates so these fail whenever
there's bad formatting in the workspace.
Co-authored-by: Claude <noreply@anthropic.com>
<!--
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? -->
This allows users to set the HTTP, HTTPS, and no proxy variables via the
configuration files like ~pyproject.toml~ and uv.toml.
Users can set like so:
`uv.toml`
```toml
https-proxy = "http://my_cool_proxy:10500"
http-proxy = "http://my_cool_proxy:10500"
no-proxy = [
"dontproxyme.com",
"localhost",
]
```
Resolves https://github.com/astral-sh/uv/issues/9472
## Test Plan
<!-- How was it tested? -->
It also adds a new integration test for the proxy support in
`uv-client`.
This was tested on some of our developer machines with our proxy setup
using `~/.config/uv/uv.toml` with values like:
```toml
https-proxy = "http://my_cool_proxy:10500"
http-proxy = "http://my_cool_proxy:10500"
no-proxy = [
"dontproxyme.com",
"localhost",
]
```
---------
Signed-off-by: Eli Uriegas <eliuriegas@meta.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
## Summary
Fixes https://github.com/astral-sh/uv/issues/17232
When `uv build` fails (e.g., due to missing `__init__.py`), partial
distribution
files were being left in the `dist/` directory.
### Changes
- Use `NamedTempFile` to write build output to a temporary file first
- Only persist the file to the final location on successful build
- If build fails, the temporary file is automatically cleaned up
- Added `Error::Persist` variant for handling persistence failures
## Test Plan
Added `no_partial_files_on_build_failure` test that verifies:
1. `build_source_dist` fails when `__init__.py` is missing
2. `build_wheel` fails when `__init__.py` is missing
3. The `dist/` directory remains empty after both failures (no partial
files)
---------
Co-authored-by: Hayashi Reo <reo@wantedly.com>
Formats the generated JSON schema with prettier so it doesn't fail CI
lints immediately after update.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Previously, we had a retry count both on the top level error type, and
on an error variant, and had a conversion step in between. When
reviewing #17274, I noticed we can simplify that.
## Summary
Fixes#17266.
The retry count was getting dropped by
`ErrorKind::from_retry_middleware` and `<Error as
From<ErrorKind>>::from` so we were doing more retries than we should
have.
## Test Plan
Added a testcase for the specific error path in the issue. Added an
expect to the other retry test too.
## Summary
Gates four tests in `python_find.rs` that call `python_install()` behind
the `python-managed` feature flag. These tests attempt to download
Python versions from the network (free-threaded and pre-release
versions) which fail in offline build environments.
Fixes#16431
## Test Plan
Verified that the gated tests match the pattern used elsewhere in the
codebase where the entire `python_install` module is already gated
behind `#[cfg(feature = "python-managed")]`.