Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(unreleased)=
## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.5.1...HEAD)

(unreleased-added)=
### Added

- `manim-slides render` now exists with the same return code as the one returned by `manim render` or `manimgl`.
[@chrjabs](https://github.com/chrjabs) [#545](https://github.com/jeertmans/manim-slides/pull/545)

(unreleased-chore)=
### Chore

Expand Down
5 changes: 3 additions & 2 deletions manim_slides/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
if ce and gl:
raise click.UsageError("You cannot specify both --CE and --GL renderers.")
if gl:
subprocess.run([sys.executable, "-m", "manimlib", "-w", *args])
completed = subprocess.run([sys.executable, "-m", "manimlib", "-w", *args])

Check warning on line 51 in manim_slides/render.py

View check run for this annotation

Codecov / codecov/patch

manim_slides/render.py#L51

Added line #L51 was not covered by tests
else:
subprocess.run([sys.executable, "-m", "manim", "render", *args])
completed = subprocess.run([sys.executable, "-m", "manim", "render", *args])
sys.exit(completed.returncode)
5 changes: 5 additions & 0 deletions tests/data/slides.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ def construct(self):

class BasicSlideSkipReversing(BasicSlide):
skip_reversing = True


class FailingSlide(Slide):
def construct(self):
self.play("this fails to render")
31 changes: 31 additions & 0 deletions tests/test_slide.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,37 @@ def test_render_basic_slide(
assert local_presentation_config.resolution == presentation_config.resolution


@pytest.mark.parametrize(
"renderer",
[
"--CE",
pytest.param(
"--GL",
marks=pytest.mark.skipif(
sys.version_info < (3, 10),
reason="See https://github.com/3b1b/manim/issues/2263.",
),
),
"--CE --renderer=opengl",
],
ids=("CE", "GL", "CE(GL)"),
)
def test_render_failing_slide(
renderer: str,
slides_file: Path,
manimgl_config: Path,
) -> None:
runner = CliRunner()

with runner.isolated_filesystem() as tmp_dir:
shutil.copy(manimgl_config, tmp_dir)
results = runner.invoke(
render, [*renderer.split(" "), str(slides_file), "FailingSlide", "-ql"]
)

assert results.exit_code != 0, results


def test_clear_cache(
slides_file: Path,
) -> None:
Expand Down
Loading