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

75 lines
1.3 KiB
Nix

{ lib
, buildPythonPackage
, ciso8601
, fetchFromGitHub
, msgpack
, orjson
, pendulum
, pytest-mock
, pytestCheckHook
, pythonOlder
, pyyaml
, setuptools
, tomli
, tomli-w
, typing-extensions
}:
buildPythonPackage rec {
pname = "mashumaro";
version = "3.11";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "Fatal1ty";
repo = "mashumaro";
rev = "refs/tags/v${version}";
hash = "sha256-7gRbTNNK8elWsL0ub7c/EeswIk4xxJOxKVk8HmvWMZA=";
};
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
typing-extensions
];
passthru.optional-dependencies = {
orjson = [
orjson
];
msgpack = [
msgpack
];
yaml = [
pyyaml
];
toml = [
tomli-w
] ++ lib.optionals (pythonOlder "3.11") [
tomli
];
};
nativeCheckInputs = [
ciso8601
pendulum
pytest-mock
pytestCheckHook
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
pythonImportsCheck = [
"mashumaro"
];
meta = with lib; {
description = "Serialization library on top of dataclasses";
homepage = "https://github.com/Fatal1ty/mashumaro";
changelog = "https://github.com/Fatal1ty/mashumaro/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ tjni ];
};
}