From fc72e5e59f1346b77b388a49e1e724db4e72d773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Mon, 19 Jan 2026 21:27:08 +0900 Subject: [PATCH] gnu: Add python-blockbuster. * gnu/packages/python-check.scm (python-blockbuster): Add variable. Change-Id: I7cbdea1d62f700d75d92b8fd98929dc716e038e0 Signed-off-by: Sharlatan Hellseher --- gnu/packages/python-check.scm | 36 +++++++++++++++++++++++++++++++++++ gnu/packages/python-xyz.scm | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 4edb1dcf460..e5fc392032c 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -481,6 +481,42 @@ all the files it generates a report.") written in pure Python.") (license license:expat))) +(define-public python-blockbuster + (package + (name "python-blockbuster") + (version "1.5.26") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cbornet/blockbuster") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "16ycwblivp6d7s78sxq97f9xb4vxcjfr5srxhpkpssv770lp37fs")))) + (build-system pyproject-build-system) + ;; test_ssl_socket wants to connects to the Internet. + (arguments (list #:test-flags #~'("-k" "not test_ssl_socket"))) + (native-inputs (list python-hatchling + python-pytest + python-pytest-asyncio + python-requests)) + (propagated-inputs (list python-forbiddenfruit)) + (home-page "https://github.com/cbornet/blockbuster") + (synopsis "Utility to detect blocking calls in Python async event loop") + (description + "Blockbuster is a Python package designed to detect and prevent +blocking calls within an asynchronous event loop. It is particularly useful +when executing tests to ensure that your asynchronous code +does not inadvertently call blocking operations, +which can lead to performance bottlenecks and unpredictable behavior. + +It does this by wrapping common blocking functions +and raising an exception when they are called within an asynchronous context. +Note that Blockbuster currently only detects @code{asyncio} event loops +and is tested only with CPython.") + (license license:asl2.0))) + (define-public python-codacy-coverage (package (name "python-codacy-coverage") diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 716d6af3ba2..3b38a7ea182 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -166,7 +166,7 @@ ;;; Copyright © 2024 Markku Korkeala ;;; Copyright © 2025 Jordan Moore ;;; Copyright © 2025 Dariqq -;;; Copyright © 2025 Nguyễn Gia Phong +;;; Copyright © 2025-2026 Nguyễn Gia Phong ;;; Copyright © 2025, Cayetano Santos ;;; Copyright © 2025 Jake Forster ;;; Copyright © 2025 Luis Felipe López Acevedo