Skip to content

Comments

Allow passing custom reqwest client to RegistryClient#15281

Merged
zanieb merged 2 commits intoastral-sh:mainfrom
nilskch:nk/custom-reqwest-client
Aug 14, 2025
Merged

Allow passing custom reqwest client to RegistryClient#15281
zanieb merged 2 commits intoastral-sh:mainfrom
nilskch:nk/custom-reqwest-client

Conversation

@nilskch
Copy link
Contributor

@nilskch nilskch commented Aug 14, 2025

Summary

We are using UV as a library and we would like to provide an custom reqwest client to the RegistryClient/BaseClient. We have a central place in our repo where we configure the reqwest client to our needs (certs, proxy, ...) and it is safer for us to just pass the same client to UV rather than trying to reproduce the same client config with the APIs that UV exposes.

Are you ok with that change?

Test Plan

@nilskch nilskch marked this pull request as ready for review August 14, 2025 14:42
@zanieb
Copy link
Member

zanieb commented Aug 14, 2025

I'm pretty wary of this change but I don't have a strong reason to deny it. I'm mostly worried about the increased complexity in a very critical component of uv. Perhaps we could refactor this to avoid the big if / else branch somehow?

@zanieb zanieb added the rustlib Related to our Rust library API label Aug 14, 2025
@nilskch
Copy link
Contributor Author

nilskch commented Aug 14, 2025

I moved the logic of creating the raw_client and raw_dangerous_client into a separate function.

I totally see your point. This would make our life much easier, but I would absolutely understand if you do not feel comfortable maintaining this change.

@zanieb zanieb merged commit 4bc6c77 into astral-sh:main Aug 14, 2025
95 checks passed
@nilskch nilskch deleted the nk/custom-reqwest-client branch August 14, 2025 17:06
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 16, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.8.9` -> `0.8.11` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.8.11`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0811)

[Compare Source](astral-sh/uv@0.8.10...0.8.11)

##### Python

- Add Python 3.14.0rc2
- Update Pyodide to 0.28.1

##### Enhancements

- Add Debian 13 trixie to published Docker images ([#&#8203;15269](astral-sh/uv#15269))
- Add `extra-build-dependencies` hint for any missing module on build failure ([#&#8203;15252](astral-sh/uv#15252))
- Make 'v' prefix cyan in overlap warnings ([#&#8203;15259](astral-sh/uv#15259))

##### Bug fixes

- Fix missing uv version in extended Docker image tags ([#&#8203;15263](astral-sh/uv#15263))
- Persist cache info when re-installing cached wheels ([#&#8203;15274](astral-sh/uv#15274))

##### Rust API

- Allow passing custom `reqwest` clients to `RegistryClient` ([#&#8203;15281](astral-sh/uv#15281))

### [`v0.8.10`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0810)

[Compare Source](astral-sh/uv@0.8.9...0.8.10)

##### Python

- Add support for installing Pyodide versions ([#&#8203;14518](astral-sh/uv#14518))

##### Enhancements

- Allow Python requests with missing segments, e.g., just `aarch64` ([#&#8203;14399](astral-sh/uv#14399))

##### Preview

- Move warnings for conflicting modules into preview ([#&#8203;15253](astral-sh/uv#15253))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42Ni4yIiwidXBkYXRlZEluVmVyIjoiNDEuNzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rustlib Related to our Rust library API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants