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.2";
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-19taP6adzmO4zH2As1OTXeYNFj6KwjhxBr09X+SrZRk=";
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 pythonImportsCheck = [
37 "exceptiongroup"
38 ];
39
40 meta = with lib; {
41 description = "Backport of PEP 654 (exception groups)";
42 homepage = "https://github.com/agronholm/exceptiongroup";
43 changelog = "https://github.com/agronholm/exceptiongroup/blob/${version}/CHANGES.rst";
44 license = with licenses; [ mit ];
45 maintainers = with maintainers; [ fab ];
46 };
47}