Skip to content

Pixi and Uv match()/parse() use pyproject "tools" key instead of "tool" #92

@jezdez

Description

@jezdez

pixi.py:63,71 and uv.py:163,186 read self.proj.pyproject.get("tools", ...) (plural). PEP 518 defines the table as [tool.<name>] (singular), and every other spec in projspec uses "tool". The same Uv class even uses the singular "tool" correctly at line 166, making the typo unambiguous.

Effect: a pyproject.toml with only [tool.pixi.workspace] (or [tool.uv]) is never matched. The standalone manifest paths (pixi.toml, uv.lock, uv.toml, .python-version) mask this.

Repro:

import tempfile, os, projspec
d = tempfile.mkdtemp()
with open(os.path.join(d, "pyproject.toml"), "w") as f:
    f.write('[tool.pixi.workspace]\nname="x"\nchannels=["conda-forge"]\nplatforms=["linux-64"]\n')
print("pixi" in projspec.Project(d))   # False, expected True

Four-line s/"tools"/"tool"/ fix. Happy to send a PR if useful.

(Noticed while preparing #91. The documentation.py:172 use of cfg.get("build", {}).get("tools", {}).get("python") is correct — that reads RTD's .readthedocs.yaml, where build.tools.python is the actual key — and is not part of this bug.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions