2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-12-17 10:02:37 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, flit-scm
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2023-01-20 10:41:00 +00:00
|
|
|
, pythonAtLeast
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "exceptiongroup";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "1.1.0";
|
2022-12-17 10:02:37 +00:00
|
|
|
format = "pyproject";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "agronholm";
|
|
|
|
repo = "exceptiongroup";
|
|
|
|
rev = version;
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-XQcYYz4MOxWj9QlgM6KuwBaCHjYzGRkQw3cN5WBSnAo=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-12-17 10:02:37 +00:00
|
|
|
flit-scm
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
doCheck = pythonAtLeast "3.11"; # infinite recursion with pytest
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-12-17 10:02:37 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
disabledTests = if (pythonAtLeast "3.11") then [
|
|
|
|
# regression in 3.11.4
|
|
|
|
# https://github.com/agronholm/exceptiongroup/issues/64
|
|
|
|
"test_catch_handler_raises"
|
|
|
|
] else null;
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"exceptiongroup"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Backport of PEP 654 (exception groups)";
|
|
|
|
homepage = "https://github.com/agronholm/exceptiongroup";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/agronholm/exceptiongroup/blob/${version}/CHANGES.rst";
|
2022-04-27 09:35:20 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|