2020-08-20 17:08:02 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2021-06-28 23:13:55 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, hypothesis
|
2023-10-09 19:29:22 +00:00
|
|
|
, marshmallow-enum
|
|
|
|
, poetry-core
|
|
|
|
, poetry-dynamic-versioning
|
2021-06-28 23:13:55 +00:00
|
|
|
, pytestCheckHook
|
2023-10-09 19:29:22 +00:00
|
|
|
, pythonOlder
|
|
|
|
, typing-inspect
|
2020-08-20 17:08:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dataclasses-json";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.6.3";
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lidatong";
|
|
|
|
repo = pname;
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-UVYLyRVLRdt38obSLkSsQdroO95lwpwzerw+gYBIJ7w=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'version = "0.0.0"' 'version = "${version}"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
poetry-dynamic-versioning
|
|
|
|
];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
typing-inspect
|
|
|
|
marshmallow-enum
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
hypothesis
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# fails with the following error and avoid dependency on mypy
|
2022-10-06 18:32:54 +00:00
|
|
|
# mypy_main(None, text_io, text_io, [__file__], clean_exit=True)
|
|
|
|
# TypeError: main() takes at most 4 arguments (5 given)
|
2023-07-15 17:15:38 +00:00
|
|
|
"tests/test_annotations.py"
|
2022-10-06 18:32:54 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"dataclasses_json"
|
|
|
|
];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Simple API for encoding and decoding dataclasses to and from JSON";
|
|
|
|
homepage = "https://github.com/lidatong/dataclasses-json";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/lidatong/dataclasses-json/releases/tag/v${version}";
|
2020-08-20 17:08:02 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ albakham ];
|
|
|
|
};
|
|
|
|
}
|