Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add uv version to user agent #2136

Merged
merged 11 commits into from
Mar 4, 2024

Conversation

samypr100
Copy link
Contributor

@samypr100 samypr100 commented Mar 3, 2024

Summary

Closes #1977

This allows us to send uv's version in the uv-client User Agent header.

Here's how request headers look like to a server now:

...
Accept: application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html;q=0.2, text/html;q=0.01
User-Agent: uv/0.1.13
...

I went for a mix of Option 1 and 2 from #1977. Open to alternative naming as well, not tied too strongly here to the names picked.

Another possibility for this new crate is that we can use it to consolidate metadata that exists across crates to ultimately be able to create linehaul information described in #1958, but I haven't looked into what those changes might look like.

Test Plan

Added initial tests in the new crate to exercise its public API and added a new test to uv-client to validate the headers using a 1-time disposable server.

@samypr100 samypr100 marked this pull request as ready for review March 3, 2024 03:01
@charliermarsh charliermarsh enabled auto-merge (squash) March 4, 2024 19:39
@charliermarsh charliermarsh merged commit 93f5609 into astral-sh:main Mar 4, 2024
23 checks passed
@samypr100 samypr100 deleted the version-in-user-agent branch March 4, 2024 21:12
@samypr100 samypr100 mentioned this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User Agent includes uv's version
2 participants