com um clique
flet-deprecation
// Use when adding or changing deprecations for Python controls/APIs in sdk/python/packages/, including V.deprecated fields, deprecated decorators, version lifecycle, and docs admonitions/labels.
// Use when adding or changing deprecations for Python controls/APIs in sdk/python/packages/, including V.deprecated fields, deprecated decorators, version lifecycle, and docs admonitions/labels.
Use when asked to prepare new Flet release by bumping versions and author release notes.
Use when testing or debugging Flet apps in maintainer/contributor development mode with local Python package sources and the local Flutter client, including web, desktop, browser, and computer-use verification workflows.
Use when writing or reviewing Flet documentation, including Python docstrings (Google style, reST roles, admonitions), Markdown docs (cross-references, images, code examples), and sidebar navigation.
Use when asked to add, revise, or review a changelog or release-notes entry in this repo. Inspect the existing changelog section style and the relevant PR, issue, and commit context first, then write a focused entry in the correct release section without overstating docs, tests, or chores unless they are the primary user-facing change.
Use whenever editing validation for Python controls in sdk/python/packages/: adding/changing constrained properties, `Raises: ValueError` docstrings, `before_update()` checks, `raise ValueError`, Annotated/V rules, or __validation_rules__.
Create or update Flet control screenshots and GIFs that are generated from integration tests and shown in docs. Use when working on `sdk/python/packages/flet/integration_tests/examples`, refreshing static or interactive golden screenshots, or replacing old example media images or GIFs with generated test assets.
| name | flet-deprecation |
| description | Use when adding or changing deprecations for Python controls/APIs in sdk/python/packages/, including V.deprecated fields, deprecated decorators, version lifecycle, and docs admonitions/labels. |
Use this skill when you:
Annotated[..., V.deprecated(...)],flet.utils.deprecated helpers,deprecated label).Do not use this skill for non-deprecation validation logic; use
flet-validation.
sdk/python/packages/flet/src/flet/utils/deprecated.pysdk/python/packages/flet/src/flet/utils/validation.py (V.deprecated)sdk/python/packages/flet/src/flet/utils/griffe_deprecations.pyUse this order and stop at the first option that fits:
Annotated[..., V.deprecated(...)].@deprecated(...).@deprecated_class(...).Do not add parallel custom warning logic in before_update() when V.deprecated
already covers the field.
Follow the non-copying model:
before_update().Removal phase:
delete_version cleanup, remove old Python property/deprecation and remove
Dart fallback in the same migration.0.82.0 -> remove in 0.85.0.delete_version unless there is an approved exception.When working on a release for {new_version}, treat deprecations with
delete_version == {new_version} as mandatory audit items.
@deprecated(...), @deprecated_class(...),
and V.deprecated(...) entries whose delete_version equals {new_version}.rg -n 'delete_version\\s*=\\s*"{new_version}"|delete_version\\s*=\\s*\\x27{new_version}\\x27' -S sdk/python/packages{new_version} cleanup
edits into one grouped commit instead of splitting them across multiple commits.
Use commit message format: release: remove deprecated APIs for {new_version}{new_version} removals remain.version.delete_version using the 3-minor policy by default.reason plain text for runtime warnings.docs_reason for docs-only markdown text.reason and docs_reason.from typing import Annotated, Optional
from flet.utils.validation import V
class ExampleControl:
old_prop: Annotated[
Optional[str],
V.deprecated(
"new_prop",
version="0.17.0",
delete_version="0.20.0",
reason="Use new_prop instead.",
docs_reason="Use :attr:`new_prop` or [`new_prop`](../controls/examplecontrol.md#flet.ExampleControl.new_prop) instead.",
),
] = None
from flet.utils.deprecated import deprecated
class ExampleControl:
@deprecated(
reason="Use new_func instead.",
docs_reason="Use :meth:`new_func` or [`new_func()`](../controls/examplecontrol.md#flet.ExampleControl.new_func) instead.",
version="0.17.0",
delete_version="0.20.0",
)
def old_func(self):
...
from flet.utils.deprecated import deprecated_class
@deprecated_class(
reason="Use NewControl instead.",
docs_reason="Use :class:`~flet.NewControl` or [`NewControl`](../controls/newcontrol.md) instead.",
version="0.17.0",
delete_version="0.20.0",
)
class OldControl:
...
from flet.utils.deprecated import deprecated
class ExampleControl:
@property
@deprecated(
reason="Use new_value instead.",
docs_reason="Use :attr:`new_value` or [`new_value`](../controls/examplecontrol.md#flet.ExampleControl.new_value) instead.",
version="0.17.0",
delete_version="0.20.0",
)
def value(self):
...
reason vs docs_reasonreason.docs_reason; fallback is reason.reason to avoid noisy runtime output.docs_reasonIn docs_reason, use reST roles for simple references when the auto-derived label is
sufficient, and use Markdown links when you need more control over the displayed text.
See docs-conventions for details on supported cross-ref patterns and their syntax.
For supported patterns, docs should auto-render:
Deprecated admonition section,deprecated label/badge on the item.Do not duplicate with manual deprecation admonitions in docstrings unless there is a special case not covered by the extension.
When adding a user-visible deprecation, also update the release docs in the
same change. These pages are the canonical upgrade path, not a separate
Deprecations page.
website/docs/release/breaking-changes/.
DragTargetEvent.x,
DragTargetEvent.y, and DragTargetEvent.offset belong in one
coordinate-fields guide.:::note accuracy callout,
Summary, Context, Migration guide, Timeline, and References.References, link relevant API docs, relevant GitHub issue/PR links,
and release notes entry for that release.website/docs/release/breaking-changes/index.md under the release's
Deprecations subsection.website/sidebars.yml under:
Stay up to date -> Breaking changes and deprecations -> vX.Y.Z.
This keeps individual guide pages in the docs sidebar while grouping them by
release.website/docs/release/release-notes.md so the release links to the
combined Breaking changes and deprecations section.cd website && yarn crocodocs:generate after sidebar
edits, then run cd website && yarn build.Do not add one-off tests for every API that gets deprecated when it uses an
existing, already-tested pattern (V.deprecated, @deprecated, or
@deprecated_class). For routine deprecation metadata updates, rely on the
shared helper and docs extraction tests.
Add or update tests only when the change affects deprecation infrastructure or introduces meaningful new behavior, for example:
Prefer these locations for infrastructure tests:
sdk/python/packages/flet/tests/test_deprecated.pysdk/python/packages/flet/tests/test_griffe_deprecations.pysdk/python/packages/flet/tests/test_validation.py (for V.deprecated)reason.delete_version when a removal target is already known.docs_reason.