nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 httpx,
7 iconv,
8 pytestCheckHook,
9 requests,
10 json-stream-rs-tokenizer,
11 setuptools,
12}:
13
14buildPythonPackage rec {
15 pname = "json-stream";
16 version = "2.4.1";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "daggaz";
21 repo = "json-stream";
22 tag = "v${version}";
23 hash = "sha256-oZYVRgDSl15/UJmhTAoLk3UoVimQeLGNOjNXLH6GTtY=";
24 };
25
26 build-system = [ setuptools ];
27
28 dependencies = [ json-stream-rs-tokenizer ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ iconv ];
29
30 optional-dependencies = {
31 httpx = [ httpx ];
32 requests = [ requests ];
33 };
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 pythonImportsCheck = [ "json_stream" ];
38
39 disabledTests = [ "test_writer" ];
40
41 meta = {
42 description = "Streaming JSON parser";
43 homepage = "https://github.com/daggaz/json-stream";
44 license = lib.licenses.mit;
45 maintainers = with lib.maintainers; [ fab ];
46 };
47}