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";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.4.2";
|
2021-09-18 10:52:07 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
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}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-SXUPzFDVw8+CmD/Jxm/EB70UBdOmauQs69hNr0l3l90=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# build C version if it exists
|
|
|
|
preBuild = ''
|
|
|
|
version_str=$(python -c 'import sys; print("_".join(map(str, sys.version_info[:2])))')
|
|
|
|
if test -f src/frozendict/c_src/$version_str/frozendictobject.c; then
|
|
|
|
export CIBUILDWHEEL=1
|
|
|
|
export FROZENDICT_PURE_PY=0
|
|
|
|
else
|
|
|
|
export CIBUILDWHEEL=0
|
|
|
|
export FROZENDICT_PURE_PY=1
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
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-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-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ pbsds ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|