--- id: cysignals version: "1.12.6" license: GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this… (full text in the JSON record) license_treatment: copyleft maintenance: active --- # cysignals — Interrupt and signal handling for Cython License: copyleft · Maintenance: active · Downloads: 728.3K/mo ## What it is and what it does cysignals is a Cython extension that solves a fundamental problem: Cython code normally skips interrupt checks for speed, making long-running loops impossible to stop with CTRL-C. The package provides decorators and context managers (sig_on/sig_off) that tell Cython to check for pending signals at safe points, allowing interrupts and other OS signals to be handled gracefully. It also manages error recovery and provides hooks for custom signal handling. The package is maintained by the SageMath project and targets developers writing performance-critical Cython code who need to remain responsive to user interrupts and system signals. It requires Cython >= 3.1 and Python >= 3.12, with prebuilt wheels for macOS, Linux (including musl), and Windows across multiple architectures. No runtime dependencies means installation is straightforward once the compiled extension is available for your platform. Use it for: - Long-running numerical computations in Cython that must respond to CTRL-C without hanging the process. - Building interruptible scientific libraries (e.g., SageMath) where user cancellation is essential. - Wrapping C/C++ algorithms in Cython while maintaining signal safety and clean shutdown behavior. - Implementing custom signal handlers in Cython code that need to coexist with Python's signal machinery. - Debugging Cython code by catching and reporting signals that occur during execution. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides interrupt and signal handling mechanisms for Cython code, enabling CTRL-C interruption and other signal management in Cython programs that would otherwise run without checking for interrupts. Yes, if you are writing Cython code that runs for extended periods and needs to respond to interrupts. The package is actively maintained, has no runtime dependencies, and is essential for any Cython project that must be user-interruptible. The LGPLv3+ license is permissive for linking into proprietary extensions. Install only if you meet the Cython >= 3.1 and Python >= 3.12 requirements. ## Install pip install cysignals uv add cysignals poetry add cysignals ## Installing cysignals Before you install: Medium install friction due to compiled wheel distribution across multiple platforms and Python versions (3.12–3.14). Active maintenance with recent commits and no runtime dependencies simplifies deployment once installed. License in practice: LGPLv3+ copyleft license requires that derivative works and modifications be distributed under compatible terms; linking cysignals into proprietary Cython extensions is permitted under LGPL's library exception, but modifications to cysignals itself must remain open. Quickstart: pip install cysignals # In a .pyx file: from cysignals.signals cimport sig_on, sig_off cdef long fib(long n): sig_on() # Long-running computation here result = compute_fib(n) sig_off() return result Requires Cython >= 3.1 and Python >= 3.12; intended for use in Cython modules (.pyx files), not standalone Python code. Verify before relying: - Whether the package supports Python 3.11 or earlier despite the description stating Python >= 3.12 requirement. - Performance overhead of signal checking in tight loops compared to unguarded Cython code. - Compatibility with non-CPython implementations (PyPy, etc.) beyond CPython support shown in classifiers. ## Package facts - License: GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this… (full text in the JSON record) (copyleft) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 728.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags cython interrupt handling, cython signal management, cython ctrl-c support, cython signal handlers, cython exception handling, cython keyboard interrupt, cython async signal safe, cython-extension, signal-handling, interrupt-management [View on SkillFed](https://skillfed.io/packages/cysignals) · [View on PyPI](https://pypi.org/project/cysignals/)