pydantic is a missing runtime dependency #276
Unanswered
skupr-anaconda
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
This statement in the docs https://fastapi.tiangolo.com/fastapi-cli/?h=fastapi+cli#fastapi-cli says:
When you install FastAPI (e.g. with pip install "fastapi[standard]"), it includes a package called fastapi-cli, this package provides the fastapi command in the terminal.Which means that you can run the command
fastapiafter installingfastapi-cliitself. The same applies to this section https://github.com/fastapi/fastapi-cli/tree/0.0.20?tab=readme-ov-file#description.I guess it's not designed to run without the
fastapipackage, but the code itself has pydantic, which is not mentioned in runtime dependencies.pydanticis a missing runtime dependency and is not mentioned here https://github.com/fastapi/fastapi-cli/blob/0.0.20/pyproject.toml#L34-L39, but it's used at runtime here https://github.com/fastapi/fastapi-cli/blob/0.0.20/src/fastapi_cli/cli.py#L6 and here https://github.com/fastapi/fastapi-cli/blob/0.0.20/src/fastapi_cli/config.py#L5.This line of the
fastapicode https://github.com/fastapi/fastapi/blob/master/fastapi/cli.py#L2 says that it directly relies onfastapi_cli.Basically, an entry point
fastapi = fastapi_cli.cli:mainbelongs to thefastapi-clipackage.Operating System
Other
Operating System Details
unix and win platforms
Python Version
py310-py314
Additional Context
If I run
fastapi --helporfastapi --versionwithoutpydantic >=2.0.0in the test environment, I get:But if I add
pydanticto the runtime dependencies, it works fine:Beta Was this translation helpful? Give feedback.
All reactions