Skip to content

Pinning packages to an index with uv does not work #90

@valentinoli

Description

@valentinoli

uv supports pinning a package to an index. I tried this with hatch and it works:

[tool.hatch.envs.default]
installer = "uv"
dependencies = ["my-package"]

[tool.uv.sources]
my-package = { index = "foo" }

[[tool.uv.index]]
name = "foo"
url = "https://pkgs.dev.azure.com/foo/bar/_packaging/baz/pypi/simple/"
explicit = true

However, with hatch-pip-compile it does not work anymore:

[tool.hatch.envs.default]
type = "pip-compile"
pip-compile-resolver = "uv"
pip-compile-installer = "uv"
dependencies = ["my-package"]

[tool.uv.sources]
my-package = { index = "foo" }

[[tool.uv.index]]
name = "foo"
url = "https://pkgs.dev.azure.com/foo/bar/_packaging/baz/pypi/simple/"
explicit = true

I get an error that looks like:

  × No solution found when resolving dependencies:
  ╰─▶ Because my-package was not found in the package registry and you require my-package, we can conclude
      that your requirements are unsatisfiable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions