2021-08-26 19:38:07 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2023-01-21 14:49:01 +00:00
|
|
|
, fetchFromGitHub
|
2021-08-26 19:38:07 +00:00
|
|
|
, pytestCheckHook
|
2023-01-21 14:49:01 +00:00
|
|
|
, pythonAtLeast
|
|
|
|
, pythonOlder
|
2021-08-26 19:38:07 +00:00
|
|
|
}:
|
2018-04-21 16:48:10 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "frozendict";
|
2023-02-19 02:33:13 +00:00
|
|
|
version = "2.3.5";
|
2021-08-26 19:38:07 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2023-01-21 14:49:01 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2018-04-21 16:48:10 +00:00
|
|
|
|
2023-01-21 14:49:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Marco-Sulla";
|
|
|
|
repo = "python-frozendict";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-02-19 02:33:13 +00:00
|
|
|
hash = "sha256-IlKhqQvNaYz4+U8UJ/fGUNNTC3RjyGKCJUzJ6J431Vw=";
|
2018-04-21 16:48:10 +00:00
|
|
|
};
|
|
|
|
|
2023-01-21 14:49:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/Marco-Sulla/python-frozendict/pull/69
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'if impl == "PyPy":' 'if impl == "PyPy" or not src_path.exists():'
|
|
|
|
'';
|
2021-08-26 19:38:07 +00:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2021-08-26 19:38:07 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-01-21 14:49:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"frozendict"
|
|
|
|
];
|
|
|
|
|
2021-08-26 19:38:07 +00:00
|
|
|
preCheck = ''
|
2022-01-14 00:58:20 +00:00
|
|
|
pushd test
|
2021-08-26 19:38:07 +00:00
|
|
|
'';
|
|
|
|
|
2023-01-21 14:49:01 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.11") [
|
|
|
|
# https://github.com/Marco-Sulla/python-frozendict/issues/68
|
|
|
|
"test_c_extension"
|
|
|
|
];
|
2018-04-23 13:29:50 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2023-01-21 14:49:01 +00:00
|
|
|
description = "Module for immutable dictionary";
|
2022-07-26 04:20:00 +00:00
|
|
|
homepage = "https://github.com/Marco-Sulla/python-frozendict";
|
2023-01-21 14:49:01 +00:00
|
|
|
changelog = "https://github.com/Marco-Sulla/python-frozendict/releases/tag/v${version}";
|
2022-07-26 04:20:00 +00:00
|
|
|
license = licenses.lgpl3Only;
|
2023-01-21 14:49:01 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2018-04-21 16:48:10 +00:00
|
|
|
};
|
|
|
|
}
|