Skip to content

Feature: automatically get project information from pyproject.toml and insert it in the FastAPI class #31

@ArielMAJ

Description

@ArielMAJ

Type of feature

📝 Documentation

Current behavior

E.g. Generated swagger does not have up-to-date information on project name/description/version.

Suggested solution

Example:

def get_version() -> str:
    pyproject_path = "path/to/pyproject.toml"
    with open(pyproject_path, "rb") as f:
        pyproject = tomllib.load(f)
    return pyproject.get("tool", {}).get("poetry", {}).get("version", "0.1.0")

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributing Docs

  • I agree to follow this project's Contribution Docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions