summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/imageio-ffmpeg/default.nix
blob: 3b8d432016a5c70e5056c9fb198e66a536a00f71 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  replaceVars,
  ffmpeg,

  # build-system
  setuptools,

  # checks
  psutil,
  pytestCheckHook,
  python,
}:

buildPythonPackage rec {
  pname = "imageio-ffmpeg";
  version = "0.6.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "imageio";
    repo = "imageio-ffmpeg";
    tag = "v${version}";
    hash = "sha256-Yy2PTNBGPP/BAR7CZck/9qr2g/s4ntiuydqXz77hR7E=";
  };

  patches = [
    (replaceVars ./ffmpeg-path.patch {
      ffmpeg = lib.getExe ffmpeg;
    })
  ];

  build-system = [ setuptools ];

  nativeCheckInputs = [
    psutil
    pytestCheckHook
  ];

  disabledTestPaths = [
    # network access
    "tests/test_io.py"
    "tests/test_special.py"
    "tests/test_terminate.py"
  ];

  postCheck = ''
    ${python.interpreter} << EOF
    from imageio_ffmpeg import get_ffmpeg_version
    assert get_ffmpeg_version() == '${ffmpeg.version}'
    EOF
  '';

  pythonImportsCheck = [ "imageio_ffmpeg" ];

  meta = {
    changelog = "https://github.com/imageio/imageio-ffmpeg/releases/tag/${src.tag}";
    description = "FFMPEG wrapper for Python";
    homepage = "https://github.com/imageio/imageio-ffmpeg";
    license = lib.licenses.bsd2;
    maintainers = [ lib.maintainers.pmiddend ];
  };
}