1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 makeWrapper,
6 pytestCheckHook,
7 python,
8 pythonOlder,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "hjson";
14 version = "3.0.2";
15 pyproject = true;
16
17 disabled = pythonOlder "3.5";
18
19 src = fetchFromGitHub {
20 owner = "hjson";
21 repo = "hjson-py";
22 tag = "v${version}";
23 hash = "sha256-VrCLHfXShF45IEhGVQpryBzjxreQEunyghazDNKRh8k=";
24 };
25
26 build-system = [ setuptools ];
27
28 nativeBuildInputs = [ makeWrapper ];
29
30 nativeCheckInputs = [ pytestCheckHook ];
31
32 pythonImportsCheck = [ "hjson" ];
33
34 postInstall = ''
35 rm $out/bin/hjson.cmd
36 wrapProgram $out/bin/hjson \
37 --set PYTHONPATH "$PYTHONPATH" \
38 --prefix PATH : ${lib.makeBinPath [ python ]}
39 '';
40
41 disabledTestPaths = [
42 # AttributeError: b'/build/source/hjson/tool.py:14: Deprecati[151 chars]ools' != b''
43 "hjson/tests/test_tool.py"
44 ];
45
46 meta = with lib; {
47 description = "User interface for JSON";
48 homepage = "https://github.com/hjson/hjson-py";
49 changelog = "https://github.com/hjson/hjson-py/releases/tag/v${version}";
50 license = licenses.mit;
51 maintainers = with maintainers; [ bhipple ];
52 mainProgram = "hjson";
53 };
54}