From 12c287be6c4374bf8bfb4e40c8974a0151486e0a Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 20 Jan 2025 15:01:36 +0100 Subject: [PATCH] python312Packages.manim: 0.18.1 -> 0.19.0 Diff: https://github.com/ManimCommunity/manim/compare/refs/tags/v0.18.1...v0.19.0 Changelog: https://docs.manim.community/en/latest/changelog/0.19.0-changelog.html --- .../python-modules/manim/default.nix | 56 +++++++++---------- .../manim/pytest-report-header.patch | 40 ++++++++----- 2 files changed, 55 insertions(+), 41 deletions(-) diff --git a/pkgs/development/python-modules/manim/default.nix b/pkgs/development/python-modules/manim/default.nix index 14bc1ad76be96..0fb223a910caa 100644 --- a/pkgs/development/python-modules/manim/default.nix +++ b/pkgs/development/python-modules/manim/default.nix @@ -2,26 +2,26 @@ lib, buildPythonPackage, fetchFromGitHub, + texliveInfraOnly, + + # build-system poetry-core, - pytest-xdist, - pytestCheckHook, - pythonOlder, + # buildInputs cairo, - ffmpeg, - texliveInfraOnly, + # dependencies + av, + beautifulsoup4, click, cloup, decorator, isosurfaces, - jupyterlab, manimpango, mapbox-earcut, moderngl, moderngl-window, networkx, - notebook, numpy, pillow, pycairo, @@ -36,6 +36,17 @@ tqdm, typing-extensions, watchdog, + + # optional-dependencies + jupyterlab, + notebook, + + # tests + ffmpeg, + pytest-cov-stub, + pytest-xdist, + pytestCheckHook, + versionCheckHook, }: let @@ -175,41 +186,26 @@ in buildPythonPackage rec { pname = "manim"; pyproject = true; - version = "0.18.1"; - disabled = pythonOlder "3.9"; + version = "0.19.0"; src = fetchFromGitHub { owner = "ManimCommunity"; repo = "manim"; tag = "v${version}"; - hash = "sha256-o+Wl3NMK6yopcsRVFtZuUE9c1GABa5d8rbQNHDJ4OiQ="; + hash = "sha256-eQgp/GwKsfQA1ZgqfB3HF2ThEgH3Fbn9uAtcko9pkjs="; }; build-system = [ poetry-core ]; - pythonRelaxDeps = [ - "cloup" - "isosurfaces" - "pillow" - "skia-pathops" - "watchdog" - ]; - patches = [ ./pytest-report-header.patch ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--no-cov-on-fail --cov=manim --cov-report xml --cov-report term" "" - - substituteInPlace manim/_config/default.cfg \ - --replace "ffmpeg_executable = ffmpeg" "ffmpeg_executable = ${lib.getExe ffmpeg}" - ''; - buildInputs = [ cairo ]; dependencies = [ + av + beautifulsoup4 click cloup decorator @@ -257,16 +253,19 @@ buildPythonPackage rec { nativeCheckInputs = [ ffmpeg manim-tinytex + pytest-cov-stub pytest-xdist pytestCheckHook + versionCheckHook ]; + versionCheckProgramArg = [ "--version" ]; # about 55 of ~600 tests failing mostly due to demand for display disabledTests = import ./failing_tests.nix; pythonImportsCheck = [ "manim" ]; - meta = with lib; { + meta = { description = "Animation engine for explanatory math videos - Community version"; longDescription = '' Manim is an animation engine for explanatory math videos. It's used to @@ -274,8 +273,9 @@ buildPythonPackage rec { 3Blue1Brown on YouTube. This is the community maintained version of manim. ''; + changelog = "https://docs.manim.community/en/latest/changelog/${version}-changelog.html"; homepage = "https://github.com/ManimCommunity/manim"; - license = licenses.mit; + license = lib.licenses.mit; maintainers = [ ]; }; } diff --git a/pkgs/development/python-modules/manim/pytest-report-header.patch b/pkgs/development/python-modules/manim/pytest-report-header.patch index 7aa87d373e508..76894b080c4b4 100644 --- a/pkgs/development/python-modules/manim/pytest-report-header.patch +++ b/pkgs/development/python-modules/manim/pytest-report-header.patch @@ -1,17 +1,26 @@ -diff --git a/conftest.py b/conftest.py -index dacb730a..149c6702 100644 ---- a/conftest.py -+++ b/conftest.py -@@ -33,17 +33,3 @@ def temp_media_dir(tmpdir, monkeypatch, request): - with tempconfig({"media_dir": str(tmpdir)}): - assert config.media_dir == str(tmpdir) - yield tmpdir -- -- +diff --git a/tests/conftest.py b/tests/conftest.py +index 4de34bbb..07b4bea6 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -4,31 +4,11 @@ import logging + import sys + from pathlib import Path + +-import cairo +-import moderngl + import pytest + + import manim + + -def pytest_report_header(config): -- ctx = moderngl.create_standalone_context() -- info = ctx.info -- ctx.release() +- try: +- ctx = moderngl.create_standalone_context() +- info = ctx.info +- ctx.release() +- except Exception as e: +- raise Exception("Error while creating moderngl context") from e +- - return ( - f"\nCairo Version: {cairo.cairo_version()}", - "\nOpenGL information", @@ -20,3 +29,8 @@ index dacb730a..149c6702 100644 - f"renderer: {info['GL_RENDERER'].strip()}", - f"version: {info['GL_VERSION'].strip()}\n", - ) +- +- + def pytest_addoption(parser): + parser.addoption( + "--skip_slow",