depot/third_party/nixpkgs/pkgs/development/python-modules/dataclasses-json/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

65 lines
1.4 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, hypothesis
, marshmallow-enum
, poetry-core
, poetry-dynamic-versioning
, pytestCheckHook
, pythonOlder
, typing-inspect
}:
buildPythonPackage rec {
pname = "dataclasses-json";
version = "0.6.3";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "lidatong";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-UVYLyRVLRdt38obSLkSsQdroO95lwpwzerw+gYBIJ7w=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'version = "0.0.0"' 'version = "${version}"'
'';
nativeBuildInputs = [
poetry-core
poetry-dynamic-versioning
];
propagatedBuildInputs = [
typing-inspect
marshmallow-enum
];
nativeCheckInputs = [
hypothesis
pytestCheckHook
];
disabledTestPaths = [
# fails with the following error and avoid dependency on mypy
# mypy_main(None, text_io, text_io, [__file__], clean_exit=True)
# TypeError: main() takes at most 4 arguments (5 given)
"tests/test_annotations.py"
];
pythonImportsCheck = [
"dataclasses_json"
];
meta = with lib; {
description = "Simple API for encoding and decoding dataclasses to and from JSON";
homepage = "https://github.com/lidatong/dataclasses-json";
changelog = "https://github.com/lidatong/dataclasses-json/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ albakham ];
};
}