1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch2,
6 poetry-core,
7 pytestCheckHook,
8 pythonOlder,
9 dahlia,
10 ixia,
11}:
12
13buildPythonPackage rec {
14 pname = "oddsprout";
15 version = "0.1.1";
16 pyproject = true;
17
18 disabled = pythonOlder "3.9";
19
20 src = fetchFromGitHub {
21 owner = "trag1c";
22 repo = "oddsprout";
23 rev = "refs/tags/v${version}";
24 hash = "sha256-BOUYq4yny3ScgzCzx2cpeK4e7nxxwTj8mJ42nr59mFA=";
25 };
26
27 build-system = [ poetry-core ];
28
29 dependencies = [
30 dahlia
31 ixia
32 ];
33
34 patches = [
35 # https://github.com/trag1c/oddsprout/pull/8
36 (fetchpatch2 {
37 name = "allow-periods-in-path.patch";
38 url = "https://github.com/trag1c/oddsprout/commit/59713a797e7748d48f59f92397981c93a81f2c28.patch";
39 hash = "sha256-GAIQQi5s4D6KbTSgmP2hlBizLATxtJ/hzpWqPX4O0U4=";
40 })
41 ];
42
43 # has one test `test_main_recursion_error`
44 # that has a very low (~1%) but nonzero chance to fail,
45 # this is known upstream (https://github.com/trag1c/oddsprout/issues/5)
46 nativeCheckInputs = [ pytestCheckHook ];
47
48 pythonImportsCheck = [ "oddsprout" ];
49
50 meta = with lib; {
51 changelog = "https://github.com/trag1c/oddsprout/blob/${src.rev}/CHANGELOG.md";
52 description = "Generate random JSON with no schemas involved";
53 license = licenses.mit;
54 homepage = "https://trag1c.github.io/oddsprout";
55 maintainers = with maintainers; [
56 itepastra
57 sigmanificient
58 ];
59 };
60}