Skip to content

uv pip install --group fails when used with a subfolder #13571

Open
@Artalus

Description

@Artalus

Summary

Was demonstrating dependency-groups to a colleague, and got a bit confused.
uv pip install ./subdir works fine - yet if you do uv pip install ./subdir --group x, it fails with error: File not found: pyproject.toml.
If I do cd ./subdir and then uv pip install . --group x, it works as expected. Same if -e . is used instead of ., and even if I use just uv pip install --group x
uv pip install --help suggests that I probably misunderstood something, as it indicates that either PACKAGE or --group <GROUP> should be used:

Usage: uv pip install [OPTIONS] <PACKAGE|--requirements <REQUIREMENTS>|--editable <EDITABLE>|--group <GROUP>>
Arguments:
  [PACKAGE]...  Install all listed packages
Options:
      --group <GROUP>                          Install the specified dependency group from a `pyproject.toml`

Given the novelty of PEP-735 and the engaging discussion on supporting it in pip, I am a bit unsure whether it's actually a bug, or if I should do more reading to understand the intention behind the PEP and/or this feature.


Full MRE:

[artalus@idpad uv]$ uv --version
uv 0.7.6

[artalus@idpad uv]$ uv venv
Using CPython 3.13.2 interpreter at: /usr/bin/python
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate

[artalus@idpad uv]$ uv init ./foo
Initialized project `foo` at `/tmp/uv/foo`

[artalus@idpad uv]$ echo -e '\n[dependency-groups]\ndev=["mypy"]' >> foo/pyproject.toml

[artalus@idpad uv]$ uv pip install -e ./foo
...
 + foo==0.1.0 (from file:///tmp/uv/foo)

[artalus@idpad uv]$ uv pip install -e ./foo --group dev
error: File not found: `pyproject.toml`

[artalus@idpad uv]$ cd foo

[artalus@idpad foo]$ uv pip install -e . --group dev
Using Python 3.13.2 environment at: /tmp/uv/.venv
...
 ~ foo==0.1.0 (from file:///tmp/uv/foo)
 + mypy==1.15.0
 + mypy-extensions==1.1.0
 + typing-extensions==4.13.2

Platform

MacOS, Windows, Manjaro Linux

Version

uv 0.7.6

Python version

Python 3.13.2

Metadata

Metadata

Assignees

Labels

error messagesMessaging when something goes wrong

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions