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

Bug: extra indexes break uv add, uv remove without manual intervention #7494

Closed
Mateuscvieira opened this issue Sep 18, 2024 · 3 comments
Closed

Comments

@Mateuscvieira
Copy link

The problem

I am currently working with a package that is only available in an external index. Here are the commands to build my project:

uv init
uv add "ceic-api-client<=2.7" --extra-index-url https://downloads.ceicdata.com/python

Now, let's say I want to add another package, like pandas:

uv add pandas

Output:

No solution found when resolving dependencies: 
Because ceic-api-client was not found in the package registry and your project depends on ceic-api-client<=2.7, we can conclude that your project's requirements are unsatisfiable

The same happens if I add Pandas first, then my package, then try to remove Pandas. It's funny because I can run uv sync, uv run, etc. just fine, and I checked the lockfile and the external sources are there:

[[package]]
name = "ceic-api-client"
version = "2.6.1.148"
source = { registry = "https://downloads.ceicdata.com/python" }
dependencies = [
    { name = "certifi" },
    { name = "python-dateutil" },
    { name = "six" },
    { name = "urllib3" },
]
sdist = { url = "https://downloads.ceicdata.com/python/ceic-api-client/ceic_api_client-2.6.1.148.tar.gz" }

What solves it

I have noticed that manually adding the sources to pyproject.toml fixes the issue:

[tool.uv]
extra-index-url = ["https://downloads.ceicdata.com/python"]

I think this should be added automatically, as it already is to the lockfile.

Info

I'm running uv 0.4.11 on Windows 10

@zanieb
Copy link
Member

zanieb commented Sep 18, 2024

Thanks for the report! Adding indexes during uv add just isn't implemented yet — but we're working on it.

@maxstrobel

This comment has been minimized.

@zanieb
Copy link
Member

zanieb commented Feb 13, 2025

I think we add the index if you use the new --index flag instead.

@zanieb zanieb closed this as completed Feb 13, 2025
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

No branches or pull requests

3 participants