Skip to content

Prevent setting an index as both explicit and default #8985

Closed
@mkniewallner

Description

@mkniewallner

Unless I'm missing a use case, it seems to me that default = true won't actually do anything when set on an index that also sets explicit = true.

Consider for instance:

[project]
name = "foo"
version = "0.0.1"
dependencies = ["mypy==1.13.0"]

[[tool.uv.index]]
name = "test-pypi"
url = "https://test.pypi.org/simple"
explicit = true
default = true

default = true allows disabling default PyPi index, but in that specific case, it won't, which is expected, since the index is an explicit one, so mypy will correctly be resolved from public PyPi.

If there really is no use case for having both explicit = true and default = true for an index, should uv error out, to better convey that this is not a real use case?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions