Skip to content

Commit

Permalink
Merge remote-tracking branch 'jeertmans/main' into docoptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeertmans committed Jan 2, 2025
2 parents 678732c + 98955be commit b9215ac
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 58 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os: [macos-13, ubuntu-latest, windows-latest]
pyversion: ['3.9', '3.10', '3.11', '3.12']
extras: [pyside6-full, manimgl]
exclude:
Expand All @@ -41,7 +41,9 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install build-essential python3-dev libcairo2-dev libpango1.0-dev ffmpeg freeglut3-dev xvfb
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get install build-essential python${{ matrix.pyversion }}-dev libcairo2-dev libpango1.0-dev ffmpeg freeglut3-dev xvfb
nohup Xvfb $DISPLAY &
- name: Install Windows dependencies
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
with Manim's.
[#499](https://github.com/jeertmans/manim-slides/pull/499)

- Bump ManimGL to `>=1.7.2`, to remove `pyrr` from dependencies,
and to avoid complex code for supporting both `1.7.1` and `>=1.7.2`,
as the latter includes many breaking changes.
[#506](https://github.com/jeertmans/manim-slides/pull/506)

(v5.1.10)=
## [v5.1.10](https://github.com/jeertmans/manim-slides/compare/v5.1.9...v5.1.10)

Expand Down
2 changes: 1 addition & 1 deletion custom_config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
style:
camera:
background_color: '#000000'
4 changes: 2 additions & 2 deletions manim_slides/render.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Alias command to either
``manim render [OPTIONS] [ARGS]...`` or
``manimgl [OPTIONS] [ARGS]...``.
``manimgl -w [OPTIONS] [ARGS]...``.
This is especially useful for two reasons:
Expand Down Expand Up @@ -48,6 +48,6 @@ def render(ce: bool, gl: bool, args: tuple[str, ...]) -> None:
if ce and gl:
raise click.UsageError("You cannot specify both --CE and --GL renderers.")
if gl:
subprocess.run([sys.executable, "-m", "manimlib", *args])
subprocess.run([sys.executable, "-m", "manimlib", "-w", *args])
else:
subprocess.run([sys.executable, "-m", "manim", "render", *args])
21 changes: 4 additions & 17 deletions manim_slides/slide/manimlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@
from typing import Any, ClassVar, Optional

from manimlib import Scene, ThreeDCamera
from manimlib.utils.file_ops import get_sorted_integer_files

from .base import BaseSlide


class Slide(BaseSlide, Scene): # type: ignore[misc]
def __init__(self, *args: Any, **kwargs: Any) -> None:
kwargs.setdefault("file_writer_config", {}).update(
break_into_partial_movies=True,
write_to_movie=True,
subdivide_output=True,
)
# See: https://github.com/3b1b/manim/issues/2261
if kwargs["file_writer_config"].setdefault("output_directory", ".") == "":
kwargs["file_writer_config"]["output_directory"] = "."

kwargs["preview"] = False # Avoid opening a preview window
super().__init__(*args, **kwargs)

@property
Expand Down Expand Up @@ -46,16 +40,9 @@ def _resolution(self) -> tuple[int, int]:

@property
def _partial_movie_files(self) -> list[Path]:
kwargs = {
"remove_non_integer_files": True,
"extension": self.file_writer.movie_file_extension,
}
return [
Path(file)
for file in get_sorted_integer_files(
self.file_writer.partial_movie_directory, **kwargs
)
]
partial_movie_directory = self.file_writer.partial_movie_directory
extension = self.file_writer.movie_file_extension
return sorted(partial_movie_directory.glob(f"*{extension}"))

@property
def _show_progress_bar(self) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ full = [
]
magic = ["manim-slides[manim]", "ipython>=8.12.2"]
manim = ["manim>=0.18.0"]
manimgl = ["manimgl>=1.7.1", "pyrr"]
manimgl = ["manimgl>=1.7.2"]
pyqt6 = ["pyqt6>=6.7.0"]
pyqt6-full = ["manim-slides[full,pyqt6]"]
pyside6 = ["pyside6>=6.6.1,!=6.8.1.1"]
Expand Down
9 changes: 3 additions & 6 deletions tests/test_slide.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,10 @@ def init_slide(cls: SlideType) -> Slide:
if issubclass(cls, CESlide):
return cls()
elif issubclass(cls, GLSlide):
from manimlib.config import get_configuration, parse_cli
from manimlib.extract_scene import get_scene_config
from manimlib.config import parse_cli

args = parse_cli()
config = get_configuration(args)
scene_config = get_scene_config(config)
return cls(**scene_config)
_args = parse_cli()
return cls()

raise ValueError(f"Unsupported class {cls}")

Expand Down
31 changes: 2 additions & 29 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b9215ac

Please sign in to comment.