nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 pytestCheckHook,
7}:
8
9buildPythonPackage rec {
10 pname = "json-repair";
11 version = "0.55.2";
12 pyproject = true;
13
14 src = fetchFromGitHub {
15 owner = "mangiucugna";
16 repo = "json_repair";
17 tag = "v${version}";
18 hash = "sha256-CzoGu6JNOaqdLZK4DyDUv+TMIA+k9AlZZy1fKnpMbkE=";
19 };
20
21 build-system = [ setuptools ];
22
23 nativeCheckInputs = [ pytestCheckHook ];
24
25 disabledTestPaths = [
26 # Disable benchmark tests
27 "tests/test_performance.py"
28 ];
29
30 pythonImportsCheck = [ "json_repair" ];
31
32 meta = {
33 description = "Module to repair invalid JSON, commonly used to parse the output of LLMs";
34 homepage = "https://github.com/mangiucugna/json_repair/";
35 changelog = "https://github.com/mangiucugna/json_repair/releases/tag/${src.tag}";
36 license = lib.licenses.mit;
37 maintainers = with lib.maintainers; [ greg ];
38 mainProgram = "json_repair";
39 };
40}