Clarify what's a breaking change in commitizen
Description
https://github.com/commitizen-tools/commitizen/issues/1435#issuecomment-2891305051
Possible Solution
No response
Additional context
No response
Additional context
No response
Relevant commit: 94c02b3
I'll probably do something like the following in defaults.py
# mymodule.py
import warnings
# ✅ Non-deprecated export
NEW_CONSTANT = "new value"
# ⚠️ Deprecated export (will warn on access)
_OLD_CONSTANT = "old value"
def __getattr__(name):
if name == "OLD_CONSTANT":
warnings.warn(
"OLD_CONSTANT is deprecated and will be removed in a future version. Use NEW_CONSTANT instead.",
category=DeprecationWarning,
stacklevel=2,
)
return _OLD_CONSTANT
raise AttributeError(f"module {__name__} has no attribute {name}")
I'll probably do something like the following in
defaults.pymymodule.py
import warnings
✅ Non-deprecated export
NEW_CONSTANT = "new value"
⚠️ Deprecated export (will warn on access)
_OLD_CONSTANT = "old value"
def getattr(name): if name == "OLD_CONSTANT": warnings.warn( "OLD_CONSTANT is deprecated and will be removed in a future version. Use NEW_CONSTANT instead.", category=DeprecationWarning, stacklevel=2, ) return _OLD_CONSTANT raise AttributeError(f"module {name} has no attribute {name}")
Yep, PEP562 is definitely something we should use 🙂
I think the change in the following aspect should be viewed as a breaking changes.
- How the
czcommand is used. - config used to be there, but removed
- Change of
BaseCommitizen,VersionProvider,VersionProtocolpublice interface