[Python] UV package manager cannot find my workspace member

Discussão em 'Python' iniciado por Stack, Agosto 11, 2025.

  1. Stack

    Stack Membro Participativo

    I intended to use git submodule to bring my other source code(backend) into my-app. Then I wanted utilize uv's workspace so that it manages the dependencies of both my-app and the backend altogether.

    Tree structure (the root directory name is also my-app it's denoted by . here):

    .
    ├── my-app
    │ ├── __init__.py
    │ ├── __pycache__
    │ ├── api
    │ ├── clients
    |
    ├── justfile
    ├── model.py
    ├── packages
    │ └── backend ###### here
    ├── pyproject.toml
    ├── README.md
    ├── tests
    │ ├── __pycache__
    │ ├── conftest.py
    ├── uv.lock


    my-app's pyproject.toml:

    [project]
    name = "my-app"
    version = "0.1.0"
    description = "Add your description here"
    readme = "README.md"
    requires-python = "==3.11.4"
    dependencies = [
    ...
    "rich>=13.8.1",
    "backend" ##### here
    ]

    [tool.uv.sources]
    backend = { workspace = true }

    [tool.uv.workspace]
    members = ["packages/*"]

    [build-system]
    requires = ["uv_build>=0.8.7,<0.9.0"]
    build-backend = "uv_build"

    # other configs


    And here is the error message:

    error: Failed to generate package metadata for `my-app==0.1.0 @ editable+.`
    Caused by: Failed to parse entry: `backend`
    Caused by: `backend` references a workspace in `tool.uv.sources` (e.g., `backend = { workspace = true }`), but is not a workspace member


    with those two blocks in toml file I specified that backend should be a member. In fact the example in the documentation did the same thing. The location of the directories are also the same between my directories and the docs example.

    let me know if I have to provide more information

    Continue reading...

Compartilhe esta Página