Skip to content

Releases: tsuruko12/triggon

triggon v2.0.1

20 Mar 14:03

Choose a tag to compare

  • Fixed rollback() so stale co_filename paths 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 when rollback() cannot find the caller's source file

triggon v2.0.0

17 Mar 13:47

Choose a tag to compare

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() and from_labels() for clearer construction
  • Added add_label() and add_labels() for registering labels after initialization
  • Added unregister_refs() and the rollback() context manager
  • Added reschedule support to set_trigger() and revert()
  • Improved TrigFunc so 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 by register_ref() and register_refs()
  • exit_point() has been replaced by the capture_return() context manager
  • trigger_func() has been renamed to trigger_call()
  • trigger_return() works only inside capture_return()
  • is_triggered() and is_registered() return a single bool and support match_all
  • Several public argument names were adjusted for consistency, including new to new_values and index to indices where 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, and TRIGGON_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

26 Aug 13:28

Choose a tag to compare

  • switch_var() raises an error for unsupported value switches

🚀 triggon v1.0.0 – Official Release!

24 Aug 23:52
1a1c084

Choose a tag to compare

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() and is_registered()
  • The debug keyword 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 all keyword argument to activate all labels at once
  • Added the index keyword argument to specify label index values when switching variables
  • Added the after keyword argument to specify a delay before labels become active

switch_lit

  • Functions deferred by TrigFunc are now executed automatically when returning a value

switch_var

  • Functions deferred by TrigFunc are now executed automatically when returning a value

revert

  • Added the cond keyword argument to set a condition for deactivating labels
  • Added the after keyword argument to specify a delay before labels become inactive

trigger_return

  • Added support for passing multiple labels to the label argument
  • Functions deferred by TrigFunc are now executed automatically when returning a value

trigger_func

  • Added support for passing multiple labels to the label argument

Changes

  • Some cases that previously raised InvalidArgumentError now raise TypeError
  • Improved debug output
  • Strengthened error checking across the library

Removals

  • alter_literal() and alter_var()
  • The label argument from exit_point()

Bug Fixes

  • Various bug fixes

triggon v0.1.0b4

21 Jul 19:40

Choose a tag to compare

triggon v0.1.0b4 Pre-release
Pre-release

Changes

  • Added support for empty sequences and dictionaries as values
  • Labels and the index keyword now accept variables and attribute chains

Bug Fixes

  • Fixed issues related to debug mode
  • Fixed an IndexError that could occur in certain cases

triggon v0.1.0b3

17 Jul 07:48

Choose a tag to compare

triggon v0.1.0b3 Pre-release
Pre-release

New Features

  • Added aliases: switch_lit() for alter_literal() and switch_var() for alter_var()
  • set_trigger() supports the cond keyword for conditional triggers
  • revert() supports the all keyword to revert all labels at once
  • trigger_return() supports the ret keyword 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

08 Jul 01:29
a6bf300

Choose a tag to compare

triggon v0.1.0b2 Pre-release
Pre-release

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