depot/third_party/nixpkgs/pkgs/development/python-modules/hjson/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

54 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
makeWrapper,
pytestCheckHook,
python,
pythonOlder,
setuptools,
}:
buildPythonPackage rec {
pname = "hjson";
version = "3.0.2";
pyproject = true;
disabled = pythonOlder "3.5";
src = fetchFromGitHub {
owner = "hjson";
repo = "hjson-py";
rev = "refs/tags/v${version}";
hash = "sha256-VrCLHfXShF45IEhGVQpryBzjxreQEunyghazDNKRh8k=";
};
build-system = [ setuptools ];
nativeBuildInputs = [ makeWrapper ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "hjson" ];
postInstall = ''
rm $out/bin/hjson.cmd
wrapProgram $out/bin/hjson \
--set PYTHONPATH "$PYTHONPATH" \
--prefix PATH : ${lib.makeBinPath [ python ]}
'';
disabledTestPaths = [
# AttributeError: b'/build/source/hjson/tool.py:14: Deprecati[151 chars]ools' != b''
"hjson/tests/test_tool.py"
];
meta = with lib; {
description = "User interface for JSON";
homepage = "https://github.com/hjson/hjson-py";
changelog = "https://github.com/hjson/hjson-py/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ bhipple ];
mainProgram = "hjson";
};
}