Skip to content

parse python clones pylsp fork into project root, then panics with "multiple pyproject.toml files found" #185

@Valen-C12

Description

@Valen-C12

parse python clones pylsp fork into project root, then panics with "multiple pyproject.toml files found"

Repo: cloudwego/abcoder
Labels: bug, language/python

Summary

When abcoder parse python <path> runs for the first time and pylsp isn't on the system, the auto-installer (lib.go) does:

git clone -b abc https://github.com/Hoblovski/python-lsp-server.git pylsp
pip install -e ./pylsp

…in the current working directory, then registers it as an editable pip install pointing at <cwd>/pylsp. Every subsequent abcoder parse python . from that project then panics in lang/python/spec.go:

panic: multiple pyproject.toml files found
  spec.go:75
  spec.go:80 (PythonSpec.WorkSpace)
  collect/export.go:99 (Collector.Export)
  parse.go:205 (collectSymbol)

…because the workspace walker now sees ./pyproject.toml and ./pylsp/pyproject.toml. --exclude pylsp does not help: the walk in Export is independent of the parse exclude list.

Reproduction

cd /some/python-project-with-pyproject-toml
abcoder parse python . -o /tmp/ast.json
# … "Installing pylsp via pip ..." then "pylsp installed."
ls ./pylsp        # <-- left behind in project root, registered as editable
abcoder parse python . -o /tmp/ast.json
# panic: multiple pyproject.toml files found

Expected

  • pylsp should be cloned into a stable user cache directory (e.g. ${XDG_CACHE_HOME:-~/.cache}/abcoder/pylsp or ~/.abcoder/pylsp), never into CWD.
  • --exclude should also apply to the workspace walk in PythonSpec.WorkSpace / Collector.Export, so users can opt out of nested pyproject.toml files even when they exist.

Workaround

mv ./pylsp ~/.abcoder/pylsp
pip install -e ~/.abcoder/pylsp   # re-register editable install at new location

Environment

  • abcoder v0.0.0-20260427034146-9d8ecc5873be+dirty
  • macOS 25.3.0 (arm64)
  • Python 3.10 (miniconda) for pylsp, Python 3.12 (uv .venv) for project
  • python-lsp-server fork: Hoblovski/python-lsp-server@abc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions