diff --git a/pkgs/development/python-modules/mediapy/default.nix b/pkgs/development/python-modules/mediapy/default.nix index de5dc2ed90eb..1081b0cc331e 100644 --- a/pkgs/development/python-modules/mediapy/default.nix +++ b/pkgs/development/python-modules/mediapy/default.nix @@ -1,40 +1,62 @@ { lib, + bash, buildPythonPackage, - fetchPypi, + fetchFromGitHub, flit-core, ipython, matplotlib, numpy, pillow, + absl-py, + ffmpeg-headless, + pytestCheckHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "mediapy"; - version = "1.2.5"; + version = "1.2.7"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-LHpMUXBLJmQnNxkKbl++qCYLAn/enZnGRKZwJVquhg8="; + src = fetchFromGitHub { + owner = "google"; + repo = "mediapy"; + tag = "v${finalAttrs.version}"; + hash = "sha256-+p88Zc7YuN0P4i1AzTQfQqCFo6Uc6hpDKgoDpdJxMaI="; }; - nativeBuildInputs = [ flit-core ]; + postPatch = '' + substituteInPlace mediapy_test.py \ + --replace-fail "/bin/bash" "${lib.getExe bash}" + ''; - propagatedBuildInputs = [ + build-system = [ flit-core ]; + + dependencies = [ ipython matplotlib numpy pillow ]; + nativeCheckInputs = [ + absl-py + ffmpeg-headless + pytestCheckHook + ]; + + disabledTests = [ + # AssertionError: np.float64(148.75258355982479) not less than 51.2 + "test_video_read_write_10bit" + ]; + pythonImportsCheck = [ "mediapy" ]; meta = { description = "Read/write/show images and videos in an IPython notebook"; homepage = "https://github.com/google/mediapy"; - changelog = "https://github.com/google/mediapy/releases/tag/v${version}"; + changelog = "https://github.com/google/mediapy/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ mcwitt ]; }; -} +})