Merge pull request #120479 from friedelino/add-manim-com

manim: remove old manim(lib) package and init at 0.15.2

authored by

Sandro and committed by
GitHub
461c077f 7d7c7c05

+347 -69
+110 -40
pkgs/applications/video/manim/default.nix
··· 1 - { lib, buildPythonApplication, fetchFromGitHub, pythonOlder, file, fetchpatch 2 - , cairo, ffmpeg, sox, xdg-utils, texlive 3 - , colour, numpy, pillow, progressbar, scipy, tqdm, opencv , pycairo, pydub 4 - , pbr, fetchPypi 1 + { lib 2 + , fetchFromGitHub 3 + 4 + , cairo 5 + , ffmpeg 6 + , texlive 7 + 8 + , python3 5 9 }: 6 - buildPythonApplication rec { 10 + 11 + let 12 + # According to ManimCommunity documentation manim uses tex-packages packaged 13 + # in a custom distribution called "manim-latex", 14 + # 15 + # https://community.chocolatey.org/packages/manim-latex#files 16 + # 17 + # which includes another cutom distribution called tinytex, for which the 18 + # package list can be found at 19 + # 20 + # https://github.com/yihui/tinytex/blob/master/tools/pkgs-custom.txt 21 + # 22 + # these two combined add up to: 23 + manim-tinytex = { 24 + inherit (texlive) 25 + 26 + # tinytex 27 + scheme-infraonly amsfonts amsmath atbegshi atveryend auxhook babel bibtex 28 + bigintcalc bitset booktabs cm dehyph dvipdfmx dvips ec epstopdf-pkg etex 29 + etexcmds etoolbox euenc everyshi fancyvrb filehook firstaid float fontspec 30 + framed geometry gettitlestring glyphlist graphics graphics-cfg graphics-def 31 + grffile helvetic hycolor hyperref hyph-utf8 iftex inconsolata infwarerr 32 + intcalc knuth-lib kvdefinekeys kvoptions kvsetkeys l3backend l3kernel 33 + l3packages latex latex-amsmath-dev latex-bin latex-fonts latex-tools-dev 34 + latexconfig latexmk letltxmacro lm lm-math ltxcmds lua-alt-getopt luahbtex 35 + lualatex-math lualibs luaotfload luatex mdwtools metafont mfware natbib 36 + pdfescape pdftex pdftexcmds plain psnfss refcount rerunfilecheck stringenc 37 + tex tex-ini-files times tipa tools unicode-data unicode-math uniquecounter 38 + url xcolor xetex xetexconfig xkeyval xunicode zapfding 39 + 40 + # manim-latex 41 + standalone everysel preview doublestroke ms setspace rsfs relsize ragged2e 42 + fundus-calligra microtype wasysym physics dvisvgm jknapltx wasy cm-super 43 + babel-english gnu-freefont mathastext cbfonts-fd; 44 + }; 45 + in python3.pkgs.buildPythonApplication rec { 7 46 pname = "manim"; 8 - version = "0.1.10"; 47 + format = "pyproject"; 48 + version = "0.15.2"; 49 + disabled = python3.pythonOlder "3.8"; 9 50 10 - src = fetchPypi { 11 - pname = "manimlib"; 12 - inherit version; 13 - sha256 = "0vg9b3rwypq5zir74pi0pmj47yqlcg7hrvscwrpjzjbqq2yihn49"; 51 + src = fetchFromGitHub { 52 + owner = "ManimCommunity"; 53 + repo = pname; 54 + rev = "v${version}"; 55 + sha256 = "l5JiFWCMQbGnwRRtYzCHBXdVzWBrTNPdcIYaAt/wRNA="; 14 56 }; 15 57 16 - patches = [ ./remove-dependency-constraints.patch ]; 58 + nativeBuildInputs = [ 59 + python3.pkgs.poetry-core 60 + ]; 17 61 18 - nativeBuildInputs = [ pbr ]; 62 + postPatch = '' 63 + substituteInPlace pyproject.toml \ 64 + --replace 'cloup = "^0.13.0"' 'cloup = "*"' \ 65 + --replace 'mapbox-earcut = "^0.12.10"' 'mapbox-earcut = "*"' \ 66 + ''; 19 67 20 - propagatedBuildInputs = [ 68 + buildInputs = [ cairo ]; 69 + 70 + propagatedBuildInputs = with python3.pkgs; [ 71 + click 72 + click-default-group 73 + cloup 21 74 colour 75 + grpcio 76 + grpcio-tools 77 + importlib-metadata 78 + isosurfaces 79 + jupyterlab 80 + manimpango 81 + mapbox-earcut 82 + moderngl 83 + moderngl-window 84 + networkx 22 85 numpy 23 86 pillow 24 - progressbar 25 - scipy 26 - tqdm 27 - opencv 28 87 pycairo 29 88 pydub 89 + pygments 90 + pysrt 91 + rich 92 + scipy 93 + screeninfo 94 + skia-pathops 95 + srt 96 + tqdm 97 + watchdog 98 + ]; 30 99 31 - cairo sox ffmpeg xdg-utils 100 + makeWrapperArgs = [ 101 + "--prefix" "PATH" ":" (lib.makeBinPath [ 102 + ffmpeg 103 + (texlive.combine manim-tinytex) 104 + ]) 32 105 ]; 33 106 34 - # Test with texlive to see whether it works but don't propagate 35 - # because it's huge and optional 36 - # TODO: Use smaller TexLive distribution 37 - # Doesn't need everything but it's hard to figure out what it needs 38 - checkInputs = [ cairo sox ffmpeg xdg-utils texlive.combined.scheme-full ]; 107 + 108 + checkInputs = [ 109 + python3.pkgs.pytest-cov 110 + python3.pkgs.pytest-xdist 111 + python3.pkgs.pytestCheckHook 112 + 113 + ffmpeg 114 + (texlive.combine manim-tinytex) 115 + ]; 39 116 40 - # Simple test and complex test with LaTeX 41 - checkPhase = '' 42 - for scene in SquareToCircle OpeningManimExample 43 - do 44 - python3 manim.py example_scenes.py $scene -l 45 - tail -n 20 files/Tex/*.log # Print potential LaTeX erorrs 46 - ${file}/bin/file videos/example_scenes/480p15/$scene.mp4 \ 47 - | tee | grep -F "ISO Media, MP4 Base Media v1 [ISO 14496-12:2003]" 48 - done 49 - ''; 117 + # about 55 of ~600 tests failing mostly due to demand for display 118 + disabledTests = import ./failing_tests.nix; 50 119 51 - disabled = pythonOlder "3.7"; 120 + pythonImportsCheck = [ "manim" ]; 52 121 53 - meta = { 54 - description = "Animation engine for explanatory math videos"; 122 + meta = with lib; { 123 + description = "Animation engine for explanatory math videos - Community version"; 55 124 longDescription = '' 56 125 Manim is an animation engine for explanatory math videos. It's used to 57 126 create precise animations programmatically, as seen in the videos of 58 - 3Blue1Brown on YouTube. 127 + 3Blue1Brown on YouTube. This is the community maintained version of 128 + manim. 59 129 ''; 60 - homepage = "https://github.com/3b1b/manim"; 61 - license = lib.licenses.mit; 62 - maintainers = with lib.maintainers; [ johnazoidberg ]; 130 + homepage = "https://github.com/ManimCommunity/manim"; 131 + license = licenses.mit; 132 + maintainers = with maintainers; [ friedelino ]; 63 133 }; 64 134 }
+74
pkgs/applications/video/manim/failing_tests.nix
··· 1 + # reason for failure: tests try to open display 2 + [ 3 + "test_background_color" 4 + "test_scene_add_remove" 5 + "test_Circle" 6 + "test_wait_skip" 7 + "test_basic_scene_with_default_values" 8 + "test_dry_run_with_png_format" 9 + "test_dry_run_with_png_format_skipped_animations" 10 + "test_FixedMobjects3D" 11 + "test_basic_scene_l_flag" 12 + "test_n_flag" 13 + "test_s_flag_opengl_renderer" 14 + "test_s_flag_no_animations" 15 + "test_image_output_for_static_scene" 16 + "test_no_image_output_with_interactive_embed" 17 + "test_no_default_image_output_with_non_static_scene" 18 + "test_image_output_for_static_scene_with_write_to_movie" 19 + "test_s_flag" 20 + "test_r_flag" 21 + "test_play_skip" 22 + "test_write_to_movie_disables_window" 23 + "test_a_flag" 24 + "test_pixel_coords_to_space_coords" 25 + "test_t_values" 26 + "test_custom_folders" 27 + "test_t_values[15]" 28 + "test_t_values[30]" 29 + "test_t_values[60]" 30 + "test_dash_as_filename" 31 + "test_images_are_created_when_png_format_set_for_opengl" 32 + "test_t_values_with_skip_animations" 33 + "test_static_wait_detection" 34 + "test_non_static_wait_detection" 35 + "test_frozen_frame" 36 + "test_gif_format_output" 37 + "test_animate_with_changed_custom_attribute" 38 + "test_images_are_zero_padded_when_zero_pad_set_for_opengl" 39 + "test_mp4_format_output" 40 + "test_videos_not_created_when_png_format_set" 41 + "test_images_are_created_when_png_format_set" 42 + "test_images_are_zero_padded_when_zero_pad_set" 43 + "test_webm_format_output" 44 + "test_default_format_output_for_transparent_flag" 45 + "test_mov_can_be_set_as_output_format" 46 + "test_force_window_opengl_render_with_format" 47 + "test_get_frame_with_preview_disabled" 48 + "test_get_frame_with_preview_enabled" 49 + ] ++ 50 + 51 + # reason for failure: tests try to reach network 52 + [ 53 + "test_logging_to_file" 54 + "test_plugin_function_like" 55 + "test_plugin_no_all" 56 + "test_plugin_with_all" 57 + ] ++ 58 + 59 + # failing with: 60 + # E AssertionError: 61 + # E Not equal to tolerance rtol=1e-07, atol=1.01 62 + # E Frame no -1. You can use --show_diff to visually show the difference. 63 + # E Mismatched elements: 18525 / 1639680 (1.13%) 64 + # E Max absolute difference: 255 65 + # E Max relative difference: 255. 66 + [ 67 + "test_Text2Color" 68 + ] ++ 69 + 70 + # failing with: 71 + # TypeError: __init__() got an unexpected keyword argument 'msg' - maybe you meant pytest.mark.skipif? 72 + [ 73 + "test_force_window_opengl_render_with_movies" 74 + ]
-26
pkgs/applications/video/manim/remove-dependency-constraints.patch
··· 1 - diff --git i/requirements.txt w/requirements.txt 2 - index 556122ad..11fd49d5 100644 3 - --- i/requirements.txt 4 - +++ w/requirements.txt 5 - @@ -1,11 +1,10 @@ 6 - -argparse==1.4.0 7 - -colour==0.1.5 8 - -numpy==1.15.0 9 - -Pillow==5.2.0 10 - -progressbar==2.5 11 - -scipy==1.1.0 12 - -tqdm==4.24.0 13 - -opencv-python==3.4.2.17 14 - -pycairo==1.17.1; sys_platform == 'linux' 15 - -pycairo>=1.18.0; sys_platform == 'win32' 16 - -pydub==0.23.0 17 - +colour 18 - +numpy 19 - +Pillow 20 - +progressbar 21 - +scipy 22 - +tqdm 23 - +pycairo 24 - +pycairo>=1.18.1; sys_platform == 'win32' 25 - +pydub 26 - +pyreadline==2.1; sys_platform == 'win32'
+44
pkgs/development/python-modules/cloup/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchPypi 4 + , pytestCheckHook 5 + , click 6 + , setuptools-scm 7 + , pythonOlder 8 + }: 9 + 10 + buildPythonPackage rec { 11 + pname = "cloup"; 12 + version = "0.14.0"; 13 + 14 + disabled = pythonOlder "3.6"; 15 + 16 + src = fetchPypi { 17 + inherit pname version; 18 + sha256 = "4dec7e43905b7771884cda4f13ab8b7537bceaee467a92655e7660797ab08c47"; 19 + }; 20 + 21 + nativeBuildInputs = [ 22 + setuptools-scm 23 + ]; 24 + 25 + propagatedBuildInputs = [ 26 + click 27 + ]; 28 + 29 + checkInputs = [ 30 + pytestCheckHook 31 + ]; 32 + 33 + pythonImportsCheck = [ "cloup" ]; 34 + 35 + meta = with lib; { 36 + homepage = "https://github.com/janLuke/cloup"; 37 + description = "Click extended with option groups, constraints, aliases, help themes"; 38 + longDescription = '' 39 + Enriches Click with option groups, constraints, command aliases, help sections for subcommands, themes for --help and other stuff. 40 + ''; 41 + license = licenses.bsd3; 42 + maintainers = with maintainers; [ friedelino ]; 43 + }; 44 + }
+36
pkgs/development/python-modules/isosurfaces/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchPypi 4 + , numpy 5 + }: 6 + 7 + buildPythonPackage rec { 8 + pname = "isosurfaces"; 9 + version = "0.1.0"; 10 + 11 + src = fetchPypi { 12 + inherit pname version; 13 + sha256 = "fa1b44e5e59d2f429add49289ab89e36f8dcda49b7badd99e0beea273be331f4"; 14 + }; 15 + 16 + propagatedBuildInputs = [ numpy ]; 17 + 18 + # no tests defined upstream 19 + doCheck = false; 20 + 21 + pythonImportsCheck = [ "isosurfaces" ]; 22 + 23 + meta = with lib; { 24 + homepage = "https://github.com/jared-hughes/isosurfaces"; 25 + description = "Construct isolines/isosurfaces of a 2D/3D scalar field defined by a function"; 26 + longDescription = '' 27 + Construct isolines/isosurfaces of a 2D/3D scalar field defined by a 28 + function, i.e. curves over which f(x,y)=0 or surfaces over which 29 + f(x,y,z)=0. Most similar libraries use marching squares or similar over a 30 + uniform grid, but this uses a quadtree to avoid wasting time sampling 31 + many far from the implicit surface. 32 + ''; 33 + license = licenses.mit; 34 + maintainers = with maintainers; [ friedelino ]; 35 + }; 36 + }
+41
pkgs/development/python-modules/mapbox-earcut/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchPypi 4 + , fetchFromGitHub 5 + , numpy 6 + , pybind11 7 + , pytestCheckHook 8 + , setuptools 9 + }: 10 + 11 + buildPythonPackage rec { 12 + pname = "mapbox-earcut"; 13 + version = "1.0.0"; 14 + 15 + src = fetchFromGitHub { 16 + owner = "skogler"; 17 + repo = "mapbox_earcut_python"; 18 + rev = "v${version}"; 19 + sha256 = "m4q2qTL55fkdi3hm75C3/XV9SUQkpJS+B5SEgpPEctk="; 20 + }; 21 + 22 + nativeBuildInputs = [ setuptools pybind11 ]; 23 + 24 + propagatedBuildInputs = [ numpy ]; 25 + 26 + checkInputs = [ pytestCheckHook ]; 27 + 28 + pythonImportsCheck = [ "mapbox_earcut" ]; 29 + 30 + meta = with lib; { 31 + homepage = "https://github.com/skogler/mapbox_earcut_python"; 32 + license = licenses.isc; 33 + description = "Mapbox-earcut fast triangulation of 2D-polygons"; 34 + longDescription = '' 35 + Python bindings for the C++ implementation of the Mapbox Earcut 36 + library, which provides very fast and quite robust triangulation of 2D 37 + polygons. 38 + ''; 39 + maintainers = with maintainers; [ friedelino ]; 40 + }; 41 + }
+33
pkgs/development/python-modules/srt/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchPypi 4 + , hypothesis 5 + , pytestCheckHook 6 + , pythonOlder 7 + }: 8 + 9 + buildPythonPackage rec { 10 + pname = "srt"; 11 + version = "3.5.2"; 12 + 13 + disabled = pythonOlder "2.7"; 14 + 15 + src = fetchPypi { 16 + inherit pname version; 17 + sha256 = "7aa4ad5ce4126d3f53b3e7bc4edaa86653d0378bf1c0b1ab8c59f5ab41384450"; 18 + }; 19 + 20 + checkInputs = [ 21 + hypothesis 22 + pytestCheckHook 23 + ]; 24 + 25 + pythonImportsCheck = [ "srt" ]; 26 + 27 + meta = with lib; { 28 + homepage = "https://github.com/cdown/srt"; 29 + description = "A tiny but featureful Python library for parsing, modifying, and composing SRT files"; 30 + license = licenses.bsd3; 31 + maintainers = with maintainers; [ friedelino ]; 32 + }; 33 + }
+1 -3
pkgs/top-level/all-packages.nix
··· 26807 26807 26808 26808 m32edit = callPackage ../applications/audio/midas/m32edit.nix {}; 26809 26809 26810 - manim = python3Packages.callPackage ../applications/video/manim { 26811 - opencv = python3Packages.opencv3; 26812 - }; 26810 + manim = callPackage ../applications/video/manim { }; 26813 26811 26814 26812 manuskript = libsForQt5.callPackage ../applications/editors/manuskript { }; 26815 26813
+8
pkgs/top-level/python-packages.nix
··· 1763 1763 1764 1764 cloudsplaining = callPackage ../development/python-modules/cloudsplaining { }; 1765 1765 1766 + cloup = callPackage ../development/python-modules/cloup { }; 1767 + 1766 1768 clustershell = callPackage ../development/python-modules/clustershell { }; 1767 1769 1768 1770 clvm = callPackage ../development/python-modules/clvm { }; ··· 4343 4345 4344 4346 isort = callPackage ../development/python-modules/isort { }; 4345 4347 4348 + isosurfaces = callPackage ../development/python-modules/isosurfaces { }; 4349 + 4346 4350 isounidecode = callPackage ../development/python-modules/isounidecode { }; 4347 4351 4348 4352 isoweek = callPackage ../development/python-modules/isoweek { }; ··· 5165 5169 }; 5166 5170 5167 5171 mapbox = callPackage ../development/python-modules/mapbox { }; 5172 + 5173 + mapbox-earcut = callPackage ../development/python-modules/mapbox-earcut { }; 5168 5174 5169 5175 mariadb = callPackage ../development/python-modules/mariadb { }; 5170 5176 ··· 9968 9974 srptools = callPackage ../development/python-modules/srptools { }; 9969 9975 9970 9976 srsly = callPackage ../development/python-modules/srsly { }; 9977 + 9978 + srt = callPackage ../development/python-modules/srt { }; 9971 9979 9972 9980 srvlookup = callPackage ../development/python-modules/srvlookup { }; 9973 9981