nixpkgs/pkgs/development/python-modules/commentjson/default.nix
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

45 lines
885 B
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
six,
lark,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "commentjson";
version = "0.9.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "vaidik";
repo = "commentjson";
rev = "v${version}";
hash = "sha256-dPnIcv7TIeyG7rU938w7FrDklmaGuPpXz34uw/JjOgY=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "lark-parser>=0.7.1,<0.8.0" "lark"
# NixOS is missing test.test_json module
rm -r commentjson/tests/test_json
'';
propagatedBuildInputs = [
lark
six
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "commentjson" ];
meta = {
description = "Add JavaScript or Python style comments in JSON";
homepage = "https://github.com/vaidik/commentjson/";
license = lib.licenses.mit;
maintainers = [ ];
};
}