Skip to content

Installing pydantic-ai pollutes site-packages/ with a standalone README.md file #3520

@johnslavik

Description

@johnslavik

Initial Checks

Description

This is an unintended side effect rather than an important problem.
pydantic-ai is just a public packaging interface, with no content whatsoever, for installing other dependencies implemented in this monorepo. The reason installing pydantic-ai places the README.md file in site-packages/ is purely that any artifact is needed to just build the wheel and have pydantic-ai be a separate package. However, we can produce empty wheels with metadata only -- using bypass-selection.

See #92 for more prior discussion.

Example Code

uv venv &>/dev/null && \
    uv pip install pydantic-ai &>/dev/null && \
    tree -L1 --filesfirst .venv/lib/*/site-packages/ | \
    grep -E '(.venv/|README.md)' && \
    echo && head .venv/lib/*/site-packages/README.md

This repro outputs:

.venv/lib/python3.13/site-packages/
├── README.md

<div align="center">
  <a href="https://ai.pydantic.dev/">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://ai.pydantic.dev/img/pydantic-ai-dark.svg">
      <img src="https://ai.pydantic.dev/img/pydantic-ai-light.svg" alt="Pydantic AI">
    </picture>
  </a>
</div>
<div align="center">
  <h3>GenAI Agent Framework, the Pydantic way</h3>

I'd expect there was no unrelated README file in .venv/lib/*/site-packages/ instead.

Python, Pydantic AI & LLM client version

Python 3.13, no Pydantic, no LLM client
(not relevant)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions