2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2023-02-02 18:25:31 +00:00
|
|
|
, fetchFromGitHub
|
2021-09-18 10:52:07 +00:00
|
|
|
, pytestCheckHook
|
2023-02-02 18:25:31 +00:00
|
|
|
, pythonAtLeast
|
|
|
|
, pythonOlder
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "frozendict";
|
2023-02-22 10:55:15 +00:00
|
|
|
version = "2.3.5";
|
2021-09-18 10:52:07 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Marco-Sulla";
|
|
|
|
repo = "python-frozendict";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-02-22 10:55:15 +00:00
|
|
|
hash = "sha256-IlKhqQvNaYz4+U8UJ/fGUNNTC3RjyGKCJUzJ6J431Vw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +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-09-18 10:52:07 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"frozendict"
|
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
preCheck = ''
|
2022-02-10 20:34:41 +00:00
|
|
|
pushd test
|
2021-09-18 10:52:07 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.11") [
|
|
|
|
# https://github.com/Marco-Sulla/python-frozendict/issues/68
|
|
|
|
"test_c_extension"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-02-02 18:25:31 +00:00
|
|
|
description = "Module for immutable dictionary";
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://github.com/Marco-Sulla/python-frozendict";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/Marco-Sulla/python-frozendict/releases/tag/v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
license = licenses.lgpl3Only;
|
2023-02-02 18:25:31 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|