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

35 lines
886 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 = with lib; {
description = "Add JavaScript or Python style comments in JSON";
homepage = "https://github.com/vaidik/commentjson/";
license = licenses.mit;
maintainers = with maintainers; [ ];
};
}