Skip to content

Settings deprecation support for the docs #35

@flying-sheep

Description

@flying-sheep

Description of feature

Our deprecated isn’t integrated with our Settings docs: option: Annotated[int, Field(deprecated=...)] doesn’t result in a .. version-deprecated in the docs.

Once we have an answer in python/cpython#150076, we can change our API to just be a subclass of warnings.deprecated instead of having Deprecation, while still being able to specify version.

I’d recommend:

class deprecated(warnings.deprecated):
    __init__(
        # same as warnings.deprecated:
        self, msg: LiteralString, *, category: type[Warning] = FutureWarning, stacklevel: int = 1,
        # ours
        version: str | Version,  # still mandatory, could be renamed
        version_removed: str | Version | None = None,
    ) -> None: ... 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions