Skip to content

uv (sync|run) --only-group doesn't include project #10752

Closed
@cjw296

Description

@cjw296

I'm attempting to build the docs for a new project on Read the Docs.

I want to keep dependencies for this in a doc group:

[project]
...
requires-python = ">=3.12"
dependencies = []

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[dependency-groups]
docs = [
    "furo>=2024.8.6",
    "sphinx>=8.1.3",
]

The will be more groups later (dev, maybe build, etc).

When I attempt to sync and run with only that group, my project is uninstalled:

$ uv sync --only-group docs
Resolved 27 packages in 1ms
Uninstalled 1 package in 0.69ms
 - paradigms==0.0.0.dev1 (from file:///Users/chris/vcs/git/paradigms)
$ uv run --only-group docs sphinx-build -T -b html docs docs/_build/html/
Running Sphinx v8.1.3
...
importlib.metadata.PackageNotFoundError: No package metadata was found for paradigms

How should I be getting the project to be included here?

What's weird is that any other combination of uv sync and uv run where either of them does not have --only-group docs works:

$ uv sync
Resolved 27 packages in 1ms
Installed 1 package in 3ms
 + paradigms==0.0.0.dev1 (from file:///Users/chris/vcs/git/paradigms)
$ uv run --only-group docs sphinx-build -T -b html docs docs/_build/html/
Running Sphinx v8.1.3
...build succeeded.
The HTML pages are in docs/_build/html.
$ uv sync --only-group docs
Resolved 27 packages in 1ms
Uninstalled 1 package in 0.69ms
 - paradigms==0.0.0.dev1 (from file:///Users/chris/vcs/git/paradigms)
(docs) tweedledee:paradigms chris:
$ uv run sphinx-build -T -b html docs docs/_build/html/
Installed 1 package in 3ms
...
The HTML pages are in docs/_build/html.

This second permutation definitely feels like a bug...

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsking for clarification or support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions