Skip to content

Commit

Permalink
python312Packages.manim: 0.18.1 -> 0.19.0 (#375320)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage authored Jan 21, 2025
2 parents b480e5a + 12c287b commit 7f67e68
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 41 deletions.
56 changes: 28 additions & 28 deletions pkgs/development/python-modules/manim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -36,6 +36,17 @@
tqdm,
typing-extensions,
watchdog,

# optional-dependencies
jupyterlab,
notebook,

# tests
ffmpeg,
pytest-cov-stub,
pytest-xdist,
pytestCheckHook,
versionCheckHook,
}:

let
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -257,25 +253,29 @@ 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
create precise animations programmatically, as seen in the videos of
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 = [ ];
};
}
40 changes: 27 additions & 13 deletions pkgs/development/python-modules/manim/pytest-report-header.patch
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",

0 comments on commit 7f67e68

Please sign in to comment.