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

Add hint for DevPi indexes without /+simple #11136

Open
zanieb opened this issue Jan 31, 2025 · 6 comments
Open

Add hint for DevPi indexes without /+simple #11136

zanieb opened this issue Jan 31, 2025 · 6 comments
Labels
enhancement New feature or improvement to existing functionality error messages Messaging when something goes wrong

Comments

@zanieb
Copy link
Member

zanieb commented Jan 31, 2025

Summary

Without the /+simple suffix, we'll report no versions on devpi indexes, e.g.:

We may be able to sniff it is a devpi index with <h1><a href="https://<host>/">devpi</a></h1> and hint the fix to the user.

This is an alternative to adding support as described in #4907

Example

  × No solution found when resolving dependencies:
  ╰─▶ Because there are no versions of package and you require package, we can conclude that the requirements
      are unsatisfiable.

hint: It looks like you are using a DevPi index but did not suffix the index URL with `/+simple` which is
      required for uv to use the index.
@zanieb zanieb added enhancement New feature or improvement to existing functionality error messages Messaging when something goes wrong labels Jan 31, 2025
@charliermarsh
Copy link
Member

Good idea.

@zanieb
Copy link
Member Author

zanieb commented Jan 31, 2025

Seems kind of painful to thread through, but might not be that bad.

@charliermarsh
Copy link
Member

It's probably hard to thread through the hint, but could we fail entirely when we read from this URL, rather than making it a hint?

@zanieb
Copy link
Member Author

zanieb commented Jan 31, 2025

I'm not sure how much I trust the heuristic I shared, we might need something clearer if we're going to fail hard.

@charliermarsh
Copy link
Member

We can probably use (or misuse) IndexCapabilities for this. It's how we show the 401 errors, etc.

@charliermarsh
Copy link
Member

It... turns out that devpi sniffs the user agent to determine if a request is coming from something that "looks like" an installer: https://github.com/devpi/devpi/blob/18a53a169865f770defa2932d69b75dbf4f869a4/server/devpi_server/views.py#L75.

So if you have devpi running locally per the quickstart, this works:

curl http://testuser:123@localhost:3141/testuser/dev/flask -H "Accept: application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html;q=0.2, text/html;q=0.01" --user-agent "uv/1.0"

But this does not:

curl http://testuser:123@localhost:3141/testuser/dev/flask -H "Accept: application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html;q=0.2, text/html;q=0.01"

uv was added in July. So newer versions should "just work", but older versions do not work automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality error messages Messaging when something goes wrong
Projects
None yet
Development

No branches or pull requests

2 participants