1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 flit-scm,
6 pytestCheckHook,
7 pythonAtLeast,
8 pythonOlder,
9 typing-extensions,
10}:
11
12buildPythonPackage rec {
13 pname = "exceptiongroup";
14 version = "1.3.0";
15 pyproject = true;
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "agronholm";
21 repo = "exceptiongroup";
22 tag = version;
23 hash = "sha256-b3Z1NsYKp0CecUq8kaC/j3xR/ZZHDIw4MhUeadizz88=";
24 };
25
26 build-system = [ flit-scm ];
27
28 dependencies = lib.optionals (pythonOlder "3.13") [ typing-extensions ];
29
30 nativeCheckInputs = [ pytestCheckHook ];
31
32 doCheck = pythonAtLeast "3.11"; # infinite recursion with pytest
33
34 pythonImportsCheck = [ "exceptiongroup" ];
35
36 meta = with lib; {
37 description = "Backport of PEP 654 (exception groups)";
38 homepage = "https://github.com/agronholm/exceptiongroup";
39 changelog = "https://github.com/agronholm/exceptiongroup/blob/${version}/CHANGES.rst";
40 license = with licenses; [ mit ];
41 maintainers = with maintainers; [ fab ];
42 };
43}