Skip to content

Conversation

@stefanvanburen
Copy link
Member

No description provided.

Comment on lines +51 to +53
[[tool.uv.index]]
url = "https://buf.build/gen/python"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to make the index explicit to just the two packages we want to use it for, that should hopefully avoid uv accidentally installing packages from there.

https://docs.astral.sh/uv/concepts/indexes/#pinning-a-package-to-an-index

Suggested change
[[tool.uv.index]]
url = "https://buf.build/gen/python"
[tool.uv.sources]
bufbuild-protovalidate-testing-protocolbuffers-python = { index = "bufbuild" }
google-cel-spec-protocolbuffers-python = { index = "bufbuild" }
[[tool.uv.index]]
name = "bufbuild"
url = "https://buf.build/gen/python"
explicit = true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh, this change just revealed an issue with this solution:

bufbuild-protovalidate-testing-protocolbuffers-python has a dependency on bufbuild-protovalidate-protocolbuffers-python.

With just flat-out specifying an index like in your PR, it will just install that as well, which leads to an import shadowing issue with buf.validate 😅

See the error below, which I got when running uv sync with my proposed changes.

  × No solution found when resolving dependencies for split (markers:
  │ python_full_version == '3.13.*'):
  ╰─▶ Because bufbuild-protovalidate-protocolbuffers-python
      was not found in the package registry and
      bufbuild-protovalidate-testing-protocolbuffers-python==26.0.0.1.20250717185736+ed3f62325d2e
      depends on
      bufbuild-protovalidate-protocolbuffers-python>=26.0.0.1.20250717185734,<26.0.0.2.dev0,
      we can conclude that
      bufbuild-protovalidate-testing-protocolbuffers-python==26.0.0.1.20250717185736+ed3f62325d2e
      cannot be used.
      And because protovalidate:dev depends on
      bufbuild-protovalidate-testing-protocolbuffers-python==26.0.0.1.20250717185736+ed3f62325d2e
      and your workspace requires protovalidate:dev, we can conclude that your
      workspace's requirements are unsatisfiable.

      hint: `bufbuild-protovalidate-protocolbuffers-python`
      was requested with a pre-release marker (e.g.,
      bufbuild-protovalidate-protocolbuffers-python>=26.0.0.1.20250717185734,<26.0.0.2.dev0),
      but pre-releases weren't enabled (try: `--prerelease=allow`)

      hint: While the active Python version is 3.9, the resolution failed for
      other Python versions supported by your project. Consider limiting your
      project's supported Python versions using `requires-python`.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bufbuild-protovalidate-testing-protocolbuffers-python has a dependency on bufbuild-protovalidate-protocolbuffers-python.

oof, yep, didn't even notice the dependency. That won't do — going to close this out.

@stefanvanburen stefanvanburen deleted the svanburen/generated-sdks-test-deps branch August 29, 2025 12:47
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.

3 participants