1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, poetry-core
5, pytest-asyncio
6, pytestCheckHook
7, pythonOlder
8}:
9
10buildPythonPackage rec {
11 pname = "async-interrupt";
12 version = "1.1.1";
13 format = "pyproject";
14
15 disabled = pythonOlder "3.8";
16
17 src = fetchFromGitHub {
18 owner = "bdraco";
19 repo = "async_interrupt";
20 rev = "refs/tags/v${version}";
21 hash = "sha256-mbvOj1ybCkDNr3je3PtFwmddkh2k/nHOerpC6hGSUYI=";
22 };
23
24 postPatch = ''
25 substituteInPlace pyproject.toml \
26 --replace " --cov=async_interrupt --cov-report=term-missing:skip-covered" ""
27 '';
28
29 nativeBuildInputs = [
30 poetry-core
31 ];
32
33 nativeCheckInputs = [
34 pytest-asyncio
35 pytestCheckHook
36 ];
37
38 pythonImportsCheck = [
39 "async_interrupt"
40 ];
41
42 meta = with lib; {
43 description = "Context manager to raise an exception when a future is done";
44 homepage = "https://github.com/bdraco/async_interrupt";
45 changelog = "https://github.com/bdraco/async_interrupt/blob/${version}/CHANGELOG.md";
46 license = licenses.asl20;
47 maintainers = with maintainers; [ fab ];
48 };
49}