1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, flit-scm
5, pytestCheckHook
6, pythonOlder
7, pythonAtLeast
8}:
9
10buildPythonPackage rec {
11 pname = "exceptiongroup";
12 version = "1.1.0";
13 format = "pyproject";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "agronholm";
19 repo = "exceptiongroup";
20 rev = version;
21 hash = "sha256-XQcYYz4MOxWj9QlgM6KuwBaCHjYzGRkQw3cN5WBSnAo=";
22 };
23
24 nativeBuildInputs = [
25 flit-scm
26 ];
27
28 SETUPTOOLS_SCM_PRETEND_VERSION = version;
29
30 doCheck = pythonAtLeast "3.11"; # infinite recursion with pytest
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 ];
35
36 disabledTests = if (pythonAtLeast "3.11") then [
37 # regression in 3.11.4
38 # https://github.com/agronholm/exceptiongroup/issues/64
39 "test_catch_handler_raises"
40 ] else null;
41
42 pythonImportsCheck = [
43 "exceptiongroup"
44 ];
45
46 meta = with lib; {
47 description = "Backport of PEP 654 (exception groups)";
48 homepage = "https://github.com/agronholm/exceptiongroup";
49 changelog = "https://github.com/agronholm/exceptiongroup/blob/${version}/CHANGES.rst";
50 license = with licenses; [ mit ];
51 maintainers = with maintainers; [ fab ];
52 };
53}