2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "frozendict";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "2.4.4";
|
|
|
|
pyproject = true;
|
2021-09-18 10:52:07 +00:00
|
|
|
|
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-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-TgXhffUvx74fU2SgDV04R1yS9xGbiP/ksQ+3KGT5bdQ=";
|
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
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-05-15 15:35:15 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "frozendict" ];
|
2023-02-02 18:25:31 +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-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ pbsds ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|