biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / av / default.nix
blob249c5af0bec29dcac251b4731fe20b0a3b14bc0f
2   lib,
3   stdenv,
4   buildPythonPackage,
5   cython,
6   fetchFromGitHub,
7   fetchurl,
8   linkFarm,
9   ffmpeg-headless,
10   numpy,
11   pillow,
12   pkg-config,
13   pytestCheckHook,
14   pythonOlder,
15   setuptools,
18 buildPythonPackage rec {
19   pname = "av";
20   version = "13.0.0";
21   pyproject = true;
23   disabled = pythonOlder "3.9";
25   src = fetchFromGitHub {
26     owner = "PyAV-Org";
27     repo = "PyAV";
28     rev = "refs/tags/v${version}";
29     hash = "sha256-blvtHSUqSl9xAM4t+dFJWmXiOjtnAUC9nicMaUY1zuU=";
30   };
32   build-system = [
33     cython
34     setuptools
35   ];
37   nativeBuildInputs = [ pkg-config ];
39   buildInputs = [ ffmpeg-headless ];
41   preCheck =
42     let
43       # Update with `./update-test-samples.bash` if necessary.
44       testSamples = linkFarm "pyav-test-samples" (
45         lib.mapAttrs (_: fetchurl) (lib.importTOML ./test-samples.toml)
46       );
47     in
48     ''
49       # ensure we import the built version
50       rm -r av
51       ln -s ${testSamples} tests/assets
52     '';
54   nativeCheckInputs = [
55     numpy
56     pillow
57     pytestCheckHook
58   ];
60   disabledTests = [
61     # av.error.InvalidDataError: [Errno 1094995529] Invalid data found when processing input: 'custom_io_output.mpd'
62     "test_writing_to_custom_io_dash"
63   ];
65   # `__darwinAllowLocalNetworking` doesn’t work for these; not sure why.
66   disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
67     "tests/test_timeout.py"
68   ];
70   pythonImportsCheck = [
71     "av"
72     "av.audio"
73     "av.buffer"
74     "av.bytesource"
75     "av.codec"
76     "av.container"
77     "av._core"
78     "av.datasets"
79     "av.descriptor"
80     "av.dictionary"
81     "av.enum"
82     "av.error"
83     "av.filter"
84     "av.format"
85     "av.frame"
86     "av.logging"
87     "av.option"
88     "av.packet"
89     "av.plane"
90     "av.stream"
91     "av.subtitles"
92     "av.utils"
93     "av.video"
94   ];
96   meta = with lib; {
97     description = "Pythonic bindings for FFmpeg";
98     mainProgram = "pyav";
99     homepage = "https://github.com/PyAV-Org/PyAV";
100     changelog = "https://github.com/PyAV-Org/PyAV/blob/v${version}/CHANGELOG.rst";
101     license = licenses.bsd2;
102     maintainers = [ ];
103   };