Releases: tsuruko12/triggon
Releases · tsuruko12/triggon
triggon v2.0.1
- Fixed
rollback()so staleco_filenamepaths caused by file renames or cached bytecode no longer break source discovery when the module__file__is still available - Added
RollbackSourceError, a public error raised whenrollback()cannot find the caller's source file
triggon v2.0.0
triggon 2.0.0 is a major update focused on cleaner APIs, more flexible runtime control, and better diagnostics.
This release introduces new label registration APIs, a new rollback context manager, improved deferred-call handling with TrigFunc, environment-variable-based debug configuration, and a more consistent public API.
Highlights
- Added
from_label()andfrom_labels()for clearer construction - Added
add_label()andadd_labels()for registering labels after initialization - Added
unregister_refs()and therollback()context manager - Added
reschedulesupport toset_trigger()andrevert() - Improved
TrigFuncso deferred targets can be reused across scopes and passed more flexibly - Improved debug logging, filtering, and general error reporting
Breaking Changes
switch_var()has been replaced byregister_ref()andregister_refs()exit_point()has been replaced by thecapture_return()context managertrigger_func()has been renamed totrigger_call()trigger_return()works only insidecapture_return()is_triggered()andis_registered()return a singlebooland supportmatch_all- Several public argument names were adjusted for consistency, including
newtonew_valuesandindextoindiceswhere multiple labels are supported
Improvements
- Non-string sequences can be treated as a single registered value by wrapping them in any outer sequence, not just a list or tuple
- Debug configuration can be controlled with
TRIGGON_LOG_VERBOSITY,TRIGGON_LOG_FILE, andTRIGGON_LOG_LABELS - Validation and error messages have been strengthened across the API
- Package structure, documentation, and type information have been refreshed for the 2.0.0 API
Notes
- This release ships with updated API docstrings, README documentation, and a broader automated test suite
- If you are upgrading from 1.x, review the breaking changes above before updating existing code
triggon v1.0.1
switch_var()raises an error for unsupported value switches
🚀 triggon v1.0.0 – Official Release!
This release adds new helper APIs, expands support for deferred execution with TrigFunc, and improves trigger and revert behavior across the library. It also refines error handling and removes several older APIs.
New Features
- New helper functions:
is_triggered()andis_registered() - The
debugkeyword argument now supports sorting labels in debug output - Added support for deferring calls to functions from existing libraries
TrigFunc
- Added support for delaying functions from existing libraries
set_trigger
- Added the
allkeyword argument to activate all labels at once - Added the
indexkeyword argument to specify label index values when switching variables - Added the
afterkeyword argument to specify a delay before labels become active
switch_lit
- Functions deferred by
TrigFuncare now executed automatically when returning a value
switch_var
- Functions deferred by
TrigFuncare now executed automatically when returning a value
revert
- Added the
condkeyword argument to set a condition for deactivating labels - Added the
afterkeyword argument to specify a delay before labels become inactive
trigger_return
- Added support for passing multiple labels to the
labelargument - Functions deferred by
TrigFuncare now executed automatically when returning a value
trigger_func
- Added support for passing multiple labels to the
labelargument
Changes
- Some cases that previously raised
InvalidArgumentErrornow raiseTypeError - Improved debug output
- Strengthened error checking across the library
Removals
alter_literal()andalter_var()- The
labelargument fromexit_point()
Bug Fixes
- Various bug fixes
triggon v0.1.0b4
Changes
- Added support for empty sequences and dictionaries as values
- Labels and the
indexkeyword now accept variables and attribute chains
Bug Fixes
- Fixed issues related to
debugmode - Fixed an
IndexErrorthat could occur in certain cases
triggon v0.1.0b3
New Features
- Added aliases:
switch_lit()foralter_literal()andswitch_var()foralter_var() set_trigger()supports thecondkeyword for conditional triggersrevert()supports theallkeyword to revert all labels at oncetrigger_return()supports theretkeyword to specify a return value- Added support for switching between multiple values for a single variable
switch_lit()(alter_literal()) supports multiple labels
Bug Fixes
- Fixed an issue when registering multiple variables
Known Issues
- Using a tuple as a value may raise an error. A fix is planned.
switch_var()may behave unexpectedly in certain cases.- In debug mode,
switch_var()may behave unexpectedly under certain conditions.
triggon v0.1.0b2
New Features
revert()accepts multiple labels at once (as a list or tuple)
Changes
- Minor updates to type hints in
revert()
Bug Fixes
- Fixed an issue where some variables were not properly registered in
alter_var() - Fixed a bug that could occur when multiple values were assigned to the same indexed label