Skip to content

Not all transitive dependencies are installed #204

@samuelcolvin

Description

@samuelcolvin

micropip doesn't install some required transitive dependencies. (related to #201)

This is my current workaround for adding extra required transitive dependencies, maybe it's helpful in working out what's wrong?

def _add_extra_dependencies(dependencies: list[str]) -> list[str]:
    """Add extra dependencies we know some packages need.

    Workaround for micropip not installing some required transitive dependencies.

    pygments seems to be required to get rich to work properly, ssl is required for FastAPI and HTTPX.
    See also https://github.com/pyodide/micropip/issues/201#issuecomment-2645794486.
    """
    extras = []
    for d in dependencies:
        if d.startswith(('logfire', 'rich')):
            extras.append('pygments')
        elif d.startswith(('fastapi', 'httpx', 'pydantic_ai')):
            extras.append('ssl')

        if d.startswith('pydantic_ai'):
            extras.append('typing_extensions>=4.12')

        if len(extras) == 3:
            break

    return dependencies + extras

See pydantic/pydantic.run#44.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions