Stability Policy¶
CascadeUI follows Semantic Versioning. This page defines what that covers from 4.0.0 on: which names are public, what a minor or patch release may change, and how a public name is retired.
In short: code written against 4.0.0 keeps working on every later 4.x release that supports its Python and discord.py versions, and a panel posted by one 4.x release keeps answering clicks after an upgrade to a later one. Anything that would break either waits for 5.0.0, and reaches it through a deprecation warning first.
What Is Public¶
Names in __all__. Every name listed in cascadeui.__all__ is public,
along with the eight names in cascadeui.testing. The subpackages
cascadeui.components, cascadeui.persistence, cascadeui.state,
cascadeui.theming, cascadeui.utils, and cascadeui.views each re-export
the public names defined inside them and keep doing so. The rest (the
exceptions, the validators, setup_middleware, and the devtools cog and
inspector) are imported from the package root. Every other module
(cascadeui.views.base, cascadeui.state.store, cascadeui.validation) is
internal and may move in any release, so import from the package root or a
subpackage, never from the module a name happens to live in.
What a public name promises. For a public class or function that means
its documented parameters and their defaults, its documented return value,
the exceptions the reference says it raises, and its documented behavior.
For a view class it also means the class attributes, on_* hooks, and
*_message attributes the reference lists, with their defaults.
Persisted data. A persistent panel stays restorable across 4.x
upgrades. The custom_ids the library composes inside a persistent view, the
registry rows it writes, and the tables it creates change only in ways a
newer 4.x release can still read: when a table changes, the library migrates
it forward on the first start after the upgrade. Migration runs one way. A
table a newer release migrated refuses to load under an older one with
PersistenceSchemaError, rather than being read wrong.
What Is Not Covered¶
- Names that start with an underscore. The eight deprecated ones listed under Deprecations keep working until 5.0.0, and nothing else is promised about them: any 4.x release can add one, change one, or remove one. A subclass whose class body defines a name its base already uses that way is named when the class is defined (see Private Names, which lists what the check cannot see), so a clash a new release brings shows at import rather than on a click.
- The custom_ids the library generates for a view that is not persistent. They are derived again on every render.
- Log messages, the text of exception messages, and warning text.
- The output of the
/cascadeuiDevTools commands and the Inspector's layout. They are written for people reading them, not for code. - Behavior the documentation does not describe.
Fixes and Additions¶
A fix is a fix, even when code relied on the old behavior. When the library does something its documentation says it does not, the correction ships in a minor or patch release. Its CHANGELOG entry says what changes for code that depended on the old behavior.
Minor releases add. New names, new keyword arguments whose defaults keep the old behavior, new class attributes whose defaults match what the library did before, new warnings, and new log lines. A new method on a public class can share a name with one your subclass already defines. Your method keeps its place in your class, and when the library calls the new method itself, the CHANGELOG entry says that it does, so a subclass whose method means something else can rename its own.
Python and discord.py Versions¶
A minor release may raise the minimum Python version to drop one that has reached its upstream end of life, and may raise the minimum discord.py version when a fix or feature needs the newer release. Either change is listed under Removed in the CHANGELOG.
Neither breaks an installed bot. The package metadata declares both minimums, so pip keeps a bot on an older Python at the last release that supports it, and upgrades discord.py alongside CascadeUI unless the project pins it, in which case pip keeps the last CascadeUI release that accepts the pin.
Deprecations¶
A public name is retired in three steps:
- The old name keeps working and warns with
DeprecationWarning. The warning points at the line in your code that uses the name, not at the library. - The CHANGELOG lists it under Deprecated, naming the replacement and the release that removes the old name.
- It is removed no earlier than the next major release, and only after at least one release has shipped the warning.
A removed method name is refused rather than ignored. The library calls only
the new name, so a view class, or a mixin it lists, that still defines the
old name without the new one raises TypeError when the class is defined,
naming the new name. 4.0.0 removed _build_refresh_button() and
_safe_defer() this way, deprecated in 3.14.0 and 3.14.1.
These eight were renamed in 4.0.0 and are removed in 5.0.0. Until then an override of an old name is called through the new one and warns when its class is defined, and a call to an old name warns and runs the library's method:
| Old name | Public name |
|---|---|
_build_extra_items() |
build_extra_items() |
_build_category_item() |
build_category_item() |
_build_category_button() |
build_category_button() |
_build_category_card() (menu) |
build_menu_card() |
_build_tab_rows() |
build_tab_rows() |
_build_progress_header() |
build_progress_header() |
_freeze_components() |
freeze_components() |
_extract_page() (V1 paginator) |
page_kwargs() |
The roles pattern (RolesLayoutView, PersistentRolesLayoutView, and RoleCategory) is deprecated in 4.0.0 and
removed in 5.0.0. A panel class defined on it warns when the class is defined, and
Roles says what to build instead.
Python hides DeprecationWarning by default outside __main__ and test
runners. To see them in a running bot, start it with
python -W default::DeprecationWarning bot.py. To fail a test suite on
them, add filterwarnings = ["error::DeprecationWarning"] under
[tool.pytest.ini_options] in pyproject.toml.