Files
nixpkgs/pkgs/development/python-modules/dataclasses-json/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

66 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
hypothesis,
marshmallow,
poetry-core,
poetry-dynamic-versioning,
pytestCheckHook,
pythonOlder,
typing-inspect,
}:
buildPythonPackage rec {
pname = "dataclasses-json";
version = "0.6.7";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "lidatong";
repo = "dataclasses-json";
tag = "v${version}";
hash = "sha256-AH/T6pa/CHtQNox67fqqs/BBnUcmThvbnSHug2p33qM=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'documentation =' 'Documentation =' \
--replace-fail 'version = "0.0.0"' 'version = "${version}"'
'';
build-system = [
poetry-core
poetry-dynamic-versioning
];
dependencies = [
typing-inspect
marshmallow
];
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 = {
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 = lib.licenses.mit;
maintainers = with lib.maintainers; [ albakham ];
};
}