python311Packages.mashumaro: refactor

This commit is contained in:
Fabian Affolter 2023-11-30 18:31:22 +01:00
parent faef749c0e
commit 8c7245f5b9

View file

@ -1,29 +1,30 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub
, pythonOlder
, setuptools
, typing-extensions
, orjson
, msgpack
, pyyaml
, tomli-w
, tomli
, pytestCheckHook
, ciso8601 , ciso8601
, fetchFromGitHub
, msgpack
, orjson
, pendulum , pendulum
, pytest-mock , pytest-mock
, pytestCheckHook
, pythonOlder
, pyyaml
, setuptools
, tomli
, tomli-w
, typing-extensions
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "mashumaro"; pname = "mashumaro";
version = "3.10"; version = "3.10";
format = "pyproject"; pyproject = true;
disabled = pythonOlder "3.7";
disabled = pythonOlder "3.8";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Fatal1ty"; owner = "Fatal1ty";
repo = pname; repo = "mashumaro";
rev = "refs/tags/v${version}"; rev = "refs/tags/v${version}";
hash = "sha256-PvMEwIxurDGwYMCmNFThedxDY4vwATHYwMlXkucNuwM="; hash = "sha256-PvMEwIxurDGwYMCmNFThedxDY4vwATHYwMlXkucNuwM=";
}; };
@ -37,10 +38,20 @@ buildPythonPackage rec {
]; ];
passthru.optional-dependencies = { passthru.optional-dependencies = {
orjson = [ orjson ]; orjson = [
msgpack = [ msgpack ]; orjson
yaml = [ pyyaml ]; ];
toml = [ tomli-w ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; msgpack = [
msgpack
];
yaml = [
pyyaml
];
toml = [
tomli-w
] ++ lib.optionals (pythonOlder "3.11") [
tomli
];
}; };
nativeCheckInputs = [ nativeCheckInputs = [
@ -55,7 +66,7 @@ buildPythonPackage rec {
]; ];
meta = with lib; { meta = with lib; {
description = "Fast and well tested serialization library on top of dataclasses"; description = "Serialization library on top of dataclasses";
homepage = "https://github.com/Fatal1ty/mashumaro"; homepage = "https://github.com/Fatal1ty/mashumaro";
changelog = "https://github.com/Fatal1ty/mashumaro/releases/tag/v${version}"; changelog = "https://github.com/Fatal1ty/mashumaro/releases/tag/v${version}";
license = licenses.asl20; license = licenses.asl20;