Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Jun 1, 2022

Conversation

mofrim
Copy link
Contributor

@mofrim mofrim commented Apr 24, 2021

Motivation for this change

There is an existing python application called manim in nixpkgs, but, it is first of all incorrectly named (on PyPi it is called manimlib) and it's development under this name is discontinued. The original manim-package was created and is still being developed by the author of the Youtube-math-channel 3blue1brown under the new name manimgl. The version I packaged here is a community-developed fork, which is supposed to be more stable and clean. It brings along 4 dependencies mapbox-earcut, cloup, isosurfaces and srt.

In order to make this package the new manim package in nixpkgs, i did remove the old manim(lib) package in favor of the new one.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@fufexan

This comment has been minimized.

@SuperSandro2000 SuperSandro2000 changed the title Add manim-community manim-community: init at 0.5.0 Apr 24, 2021
pkgs/development/python-modules/mapbox-earcut/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/mapbox-earcut/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/mapbox-earcut/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/mapbox-earcut/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/mapbox-earcut/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/manim-community/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/manim-community/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/manim-community/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/manim-community/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/manim-community/default.nix Outdated Show resolved Hide resolved
@collares
Copy link
Member

collares commented Apr 26, 2021

Unfortunately moderngl was updated yesterday and it's now broken because glcontext isn't packaged.

cc @c0deaddict

@mofrim mofrim force-pushed the add-manim-com branch 2 times, most recently from 11f291e to da93667 Compare April 27, 2021 22:02
@mofrim
Copy link
Contributor Author

mofrim commented May 1, 2021

Unfortunately moderngl was updated yesterday and it's now broken because glcontext isn't packaged.

cc @c0deaddict

should be fixed if #121439 gets merged

@mofrim
Copy link
Contributor Author

mofrim commented May 24, 2022

Alrighty. I have now added a commit, which removes old manim pkg, called manim: rename to manimlib and remove because the alias I put into top-level/aliases.nix has to be for something else but manim. Also I renamed the new package accordingly. I wondered if I should create an extra PR for the manim(lib) removal, though. I guess you will let me know 😉

@dotlambda
Copy link
Member

I didn't realize the old package was called manim, my bad. No need for an entry in aliases.nix in that case.

@mofrim
Copy link
Contributor Author

mofrim commented May 24, 2022

I didn't realize the old package was called manim, my bad. No need for an entry in aliases.nix in that case.

Aha! Alright, changed the commit. Now the old manim just gets replaced by the community one... 🤞

Existing manim package has been incorrectly named manim, although on PyPi it is
called manimlib. It is now developed under the name manimgl, so the PyPi
package manimlib will receive no further updates. The new manim
package in nixpkgs is now the Manim Community Edition.
@mofrim
Copy link
Contributor Author

mofrim commented May 24, 2022

There still is the issue remaining that you cannot run results/bin/manim in nixpkgs-review shell. It fails with:

foo@bar .cache/nixpkgs-review/pr-120479-23 via ❄ impure shell (review-shell)
$ manim
Traceback (most recent call last):
  File "/nix/store/i3prvnmnqz7znxmm46vfbq1zggzjqdd3-python3.10-numpy-1.21.5/lib/python3.10/site-packages/numpy/core/__init__.py", line 22, in <module>
    from . import multiarray
  File "/nix/store/i3prvnmnqz7znxmm46vfbq1zggzjqdd3-python3.10-numpy-1.21.5/lib/python3.10/site-packages/numpy/core/multiarray.py", line 12, in <module>
    from . import overrides
  File "/nix/store/i3prvnmnqz7znxmm46vfbq1zggzjqdd3-python3.10-numpy-1.21.5/lib/python3.10/site-packages/numpy/core/overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/31bafgcaplh5jdm3w273pq09s5vkmqhn-manim-0.15.2/bin/.manim-wrapped", line 6, in <module>
    from manim.__main__ import main
  File "/nix/store/31bafgcaplh5jdm3w273pq09s5vkmqhn-manim-0.15.2/lib/python3.9/site-packages/manim/__init__.py", line 15, in <module>
    from ._config import *
  File "/nix/store/31bafgcaplh5jdm3w273pq09s5vkmqhn-manim-0.15.2/lib/python3.9/site-packages/manim/_config/__init__.py", line 10, in <module>
    from .utils import ManimConfig, ManimFrame, make_config_parser
  File "/nix/store/31bafgcaplh5jdm3w273pq09s5vkmqhn-manim-0.15.2/lib/python3.9/site-packages/manim/_config/utils.py", line 27, in <module>
    import numpy as np
  File "/nix/store/i3prvnmnqz7znxmm46vfbq1zggzjqdd3-python3.10-numpy-1.21.5/lib/python3.10/site-packages/numpy/__init__.py", line 150, in <module>
    from . import core
  File "/nix/store/i3prvnmnqz7znxmm46vfbq1zggzjqdd3-python3.10-numpy-1.21.5/lib/python3.10/site-packages/numpy/core/__init__.py", line 48, in <module>
    raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.9 from "/nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/bin/python3.9"
  * The NumPy version is: "1.21.5"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

On the other hand it runs happily when you build it normally... i don't understand how the first error message comes from python3.10 but the latter one from python3.9.

Could it be possible that it is a problem that we have both python3.10 and python3.9 versions of Packages available and they somehow get mixed up? also checked the wrapped "binaries" in results/manim/bin. They are solely wrapped around python3.9. So i don't understand where the python3.10 in the first error message comes from.

@collares
Copy link
Member

collares commented May 24, 2022

I think you're right, the nixpkgs-review shell has both Python 3.9 and 3.10 and that causes problems. #150972 (comment) provides a good description of the problem. You can test the manim binary by passing -p manim to nixpkgs-review.

@mofrim
Copy link
Contributor Author

mofrim commented May 25, 2022

I think you're right, the nixpkgs-review shell has both Python 3.9 and 3.10 and that causes problems. #150972 (comment) provides a good description of the problem. You can test the manim binary by passing -p manim to nixpkgs-review.

i guess you mean passing -p manim to nix-shell not nixpkgs-review ?! my nixpkgs-review does not have a -p option. but anyhow, this i already knew and did before. running manim from nix-shell -p manim and results/bin/manim after nix-build in my nixpkgs-repo works fine.

@collares
Copy link
Member

Sorry, I should have typed the complete command! I meant nixpkgs-review pr 120479 -p manim.

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most commit messages need to be prefixed with python3Packages..
The first and last commits should be squashed together.
Isosurfaces needs to set doCheck = false with a comment that upstream has no tests.

pkgs/applications/video/manim/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/manim/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/manim/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/manim/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/manim/default.nix Outdated Show resolved Hide resolved
@collares
Copy link
Member

collares commented May 25, 2022

It was my suggestion to not squash the first and last commits. I don't really care either way, though; whatever gets this merged faster is fine by me.

@dotlambda
Copy link
Member

It was my suggestion to not squash the first and last commits. I don't really care either way, though; whatever gets this merged faster is fine by me.

Fine with me if it was a concious decision 👍

@mofrim
Copy link
Contributor Author

mofrim commented May 29, 2022

so... i committed all suggestions. about now at least partially enabled tests for manim: there might be still work to do if we want to get all tests running. especially most failing tests need display. I tried to do it with xvfb but it didn't work. btw: are there any updates on the 'tests need display'-problem for general package development, like a go-to-way or best-practice? I think if you wanted to use nixosTests to perfrom the graphics tests one would have to literally include all the failing graphics tests in the /nixos/tests/manim or something and set up a complete pytest-environment... from searching nixos/tests i could see that this hasn't been done before.

@mofrim mofrim requested a review from dotlambda May 31, 2022 04:53
@dotlambda
Copy link
Member

Result of nixpkgs-review pr 120479 run on x86_64-linux 1

9 packages built:
  • manim
  • python310Packages.cloup
  • python310Packages.isosurfaces
  • python310Packages.mapbox-earcut
  • python310Packages.srt
  • python39Packages.cloup
  • python39Packages.isosurfaces
  • python39Packages.mapbox-earcut
  • python39Packages.srt

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to not have all tests work for now. Let's hope some day someone comes up with a way to fix them.

@SuperSandro2000 SuperSandro2000 merged commit 461c077 into NixOS:master Jun 1, 2022
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With 184 comments this is well looked at. Now get it out there and we find the remaining bugs there.

pkgs/applications/video/manim/default.nix Show resolved Hide resolved
@mofrim
Copy link
Contributor Author

mofrim commented Jun 1, 2022

Woohoo! Finally, it is merged 🥳 🥳 🥳

Thanks to everyone who helped me with your comments & patience! I think i learned quite a bit about nix packaging :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.