summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/rendercanvas/default.nix
blob: 07eef09a597b6df18327fe100c44264c1c4f1fad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
  lib,
  fetchFromGitHub,
  buildPythonPackage,

  # build-system
  flit-core,

  # nativeCheckInputs
  pytestCheckHook,
  imageio,
  glfw,
  numpy,
  trio,
  wgpu-py,
}:
buildPythonPackage rec {
  pname = "rendercanvas";
  version = "2.5.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "pygfx";
    repo = "rendercanvas";
    tag = "v${version}";
    hash = "sha256-fOjiGNxEUVI+jddrwqrlBYT+CAMDQCIPNHwGonBH4Hk=";
  };

  postPatch = ''
    rm -r rendercanvas/__pyinstaller
  '';

  env = {
    # This relaxes the timeing assertions thus making the tests less flaky
    CI = "1";
  };

  build-system = [ flit-core ];

  nativeCheckInputs = [
    pytestCheckHook
    glfw
    imageio
    numpy
    trio
    # break circular dependency cycle
    (wgpu-py.overrideAttrs { doInstallCheck = false; })
  ];

  disabledTests = [
    # flaky timing and / or interrupt based tests
    "test_offscreen_event_loop"
    "test_call_later_thread"

    # AssertionError
    "test_that_we_are_on_lavapipe"
  ];
  disabledTestPaths = [
    "tests/test_loop.py"
    "tests/test_scheduling.py"
  ];

  pythonImportsCheck = [ "rendercanvas" ];

  meta = {
    description = "One canvas API, multiple backends";
    homepage = "https://github.com/pygfx/rendercanvas";
    changelog = "https://github.com/pygfx/rendercanvas/releases/tag/${src.tag}";
    platforms = lib.platforms.all;
    license = lib.licenses.bsd2;
    maintainers = [ lib.maintainers.bengsparks ];
  };
}