2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
six,
|
2022-01-19 23:45:15 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "attrdict";
|
|
|
|
version = "2.0.1";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2022-01-19 23:45:15 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-01-19 23:45:15 +00:00
|
|
|
hash = "sha256-NckGmLVcaDlGCRF3F3qenAcToIYPDgSf69cmSczXe3A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace attrdict/merge.py \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "from collections" "from collections.abc"
|
2022-01-19 23:45:15 +00:00
|
|
|
substituteInPlace attrdict/mapping.py \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "from collections" "from collections.abc"
|
2022-01-19 23:45:15 +00:00
|
|
|
substituteInPlace attrdict/default.py \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "from collections" "from collections.abc"
|
2022-01-19 23:45:15 +00:00
|
|
|
substituteInPlace attrdict/mixins.py \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "from collections" "from collections.abc"
|
2022-01-19 23:45:15 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [ six ];
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
# Tests are not shipped and source is not tagged
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "attrdict" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Dict with attribute-style access";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/bcj/AttrDict";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/bcj/AttrDict/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2022-01-19 23:45:15 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|