flet-deprecation

Manages deprecation lifecycle for Flet Python controls, APIs, and documentation.

16.6k|685|Updated Mar 24, 2022
One-click install
npx skills add https://github.com/flet-dev/flet --skill flet-deprecation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flet-deprecation
Source: https://github.com/flet-dev/flet/tree/main/.agents/skills/flet-deprecation
Command: npx skills add https://github.com/flet-dev/flet --skill flet-deprecation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Deprecating APIs in the Flet framework requires coordinating runtime decorators, field-level validation metadata, version removal policies, and documentation updates across multiple files. This Skill standardizes that entire workflow so deprecations are consistent, correctly versioned, and properly rendered in docs.

Core Features & Use Cases

  • Deprecation Pattern Selection: Guides the choice between V.deprecated for fields, @deprecated for functions/methods, and @deprecated_class for controls, with ready-to-use code patterns.
  • Version Lifecycle Management: Enforces the 3-minor-release removal policy and audits delete_version entries matching a target release before shipping.
  • Docs Integration: Ensures deprecations auto-render as admonitions and labels, and walks through migration guide creation, sidebar updates, and release notes edits.
  • Use Case: When renaming a control property like DragTargetEvent.x, use this Skill to add the correct V.deprecated annotation, set the removal version, and publish the grouped migration guide in one change.

Quick Start

Use the flet-deprecation skill to deprecate the old_prop field on ExampleControl with removal in version 0.20.0 and update the release docs.

Frequently Asked Questions about flet-deprecation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deprecate a control field in Flet Python?

Use Annotated with V.deprecated on the field, specifying the replacement name, version, delete_version, reason, and docs_reason. Do not add custom warning logic in before_update() since V.deprecated already handles field-level deprecation.

How to deprecate a function or class in the Flet SDK?

Apply @deprecated from flet.utils.deprecated for functions and methods, or @deprecated_class for classes and controls. Always set version and delete_version, and name the replacement API explicitly in both reason and docs_reason.

What is the difference between reason and docs_reason in Flet deprecations?

reason is plain text shown in runtime warnings, while docs_reason contains markdown and cross-references rendered in documentation admonitions. Keep markdown out of reason to avoid noisy runtime output; docs falls back to reason if docs_reason is absent.

When are deprecated Flet APIs removed?

The default policy removes deprecated APIs after 3 minor releases, so an API deprecated in 0.82.0 is removed in 0.85.0. Before a release, audit all entries whose delete_version equals the target version and batch confirmed removals into one commit.

Do I need to write tests for every deprecated API in Flet?

No, routine deprecations using existing patterns like V.deprecated or @deprecated rely on shared helper and docs extraction tests. Add tests only when changing deprecation infrastructure, warning formatting, docs extraction behavior, or introducing new patterns.