Releases: tibordp/pyncette
Releases · tibordp/pyncette
v1.1.0
Features
- Added MongoDB backend support (
pip install pyncette[mongodb])- Uses Motor (async MongoDB driver) for efficient async operations
- Implements optimistic locking using version-based CAS (Compare-And-Swap)
- Compatible with MongoDB 4.2+
- Supports all Pyncette features including dynamic tasks and partitioning
- Added
forceparameter toschedule_taskto control behavior when updating dynamic task instances- Default (
force=False): Fails withTaskLockedExceptionif task is locked, preserves sooner execution time to prevent schedule postponement - With
force=True: Unconditionally overwrites task state including locks and schedule
- Default (
- Added new task state query API for inspecting both static and dynamic tasks
get_task(task, instance_name=None)- Query the state of any task (static or dynamic)- For static tasks:
get_task(my_task) - For dynamic tasks:
get_task(template, "instance")orget_task(concrete_instance)
- For static tasks:
list_tasks(parent_task, limit=None, continuation_token=None)- List all instances of a dynamic task with pagination- Returns
TaskStateobjects containing task, scheduled_at, locked_until, and locked_by - Implemented across all backends: PostgreSQL, MySQL, SQLite, DynamoDB, Redis, MongoDB
Bug Fixes
- Fixed race condition in
schedule_taskwhere calling it while a task was executing could clear locks and cause duplicate execution - Fixed schedule starvation issue where repeated
schedule_taskcalls would indefinitely postpone task execution
Performance Improvements
- Switched MySQL backend to READ COMMITTED isolation level to eliminate gap lock deadlocks and improve concurrency
- Optimized Postgres and MySQL
register_taskto use upsert (INSERT ON CONFLICT/INSERT ON DUPLICATE KEY UPDATE) for force mode
API Changes
- Added
TaskLockedExceptionexception type for clearer error handling when tasks are locked - Updated
register_taskacross all backends to acceptforceparameter - Added new
get_task_state()method to Repository interface for querying individual task state - Added new
list_task_states()method to Repository interface for paginated listing of dynamic task instances - Added new public API methods to
PyncetteContext:get_task(task, instance_name=None)- Query state of static or dynamic taskslist_tasks(parent_task, limit=None, continuation_token=None)- List dynamic task instances with pagination
- Added new model classes:
TaskState(task state snapshot) andListTasksResponse(paginated results)
v1.0.0
After 6 years since the initial release in 2019, Pyncette has reached 1.0.0.
Breaking Changes
- Dropped Python 3.8 support - Minimum Python version is now 3.9
Packaging and Tooling
- Migrated from setup.py to PEP 621 pyproject.toml with hatchling
- Replaced tox with uv for dependency management and testing
- Migrated documentation from Sphinx/RST to MkDocs Material/Markdown
- Replaced mypy with ty for type checking
- Consolidated linting to Ruff (replacing black, isort, pyupgrade)
- Documentation now hosted on GitHub Pages at https://tibordp.github.io/pyncette/
Bug Fixes
- Fixed Python 3.14 compatibility: Standardized SQLite parameter binding to use named parameters
- Fixed lease comparison bug in poll_task (UUID vs string type mismatch)
- Fixed optimistic locking in poll_dynamic_task that wasn't working due to incorrect parameter binding
v0.11.0
v0.10.1
v0.10.0
v0.9.0
v0.8.1
v0.8.0
- Added Amazon DynamoDB backend
- Added MySQL backend
- Added support for partitioned dynamic tasks