From 4d93d5fbffb4814eb9f09ffb662e4724ea830d2c Mon Sep 17 00:00:00 2001 From: mateuszdrwal Date: Sun, 2 Jun 2024 11:28:38 +0200 Subject: [PATCH 1/3] remove old validation check --- manim_slides/config.py | 15 --------------- tests/test_slide.py | 5 ++--- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/manim_slides/config.py b/manim_slides/config.py index 93dd69df..b2b44183 100644 --- a/manim_slides/config.py +++ b/manim_slides/config.py @@ -262,21 +262,6 @@ def start_animation_is_before_end( return pre_slide_config - @model_validator(mode="after") - @classmethod - def loop_and_auto_next_disallowed( - cls, pre_slide_config: "PreSlideConfig" - ) -> "PreSlideConfig": - if pre_slide_config.loop and pre_slide_config.auto_next: - raise ValueError( - "You cannot have both `loop=True` and `auto_next=True`, " - "because a looping slide has no ending. " - "This may be supported in the future if " - "https://github.com/jeertmans/manim-slides/pull/299 gets merged." - ) - - return pre_slide_config - @property def slides_slice(self) -> slice: return slice(self.start_animation, self.end_animation) diff --git a/tests/test_slide.py b/tests/test_slide.py index 68367bd8..98458443 100644 --- a/tests/test_slide.py +++ b/tests/test_slide.py @@ -193,7 +193,7 @@ def construct(self) -> None: assert not self._base_slide_config.auto_next @assert_constructs - class TestLoopAndAutoNextFails(Slide): + class TestLoopAndAutoNextSucceeds(Slide): def construct(self) -> None: text = Text("Some text") @@ -202,8 +202,7 @@ def construct(self) -> None: self.next_slide(loop=True, auto_next=True) self.play(text.animate.scale(2)) - with pytest.raises(ValidationError): - self.next_slide() + self.next_slide() @assert_constructs class TestPlaybackRate(Slide): From 0c70e9d0868ec75a8bcbdb3bbefadb8fbdbca8cb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 2 Jun 2024 09:55:20 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_slide.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_slide.py b/tests/test_slide.py index 98458443..05e0809c 100644 --- a/tests/test_slide.py +++ b/tests/test_slide.py @@ -22,7 +22,6 @@ Text, ) from packaging import version -from pydantic import ValidationError from manim_slides.config import PresentationConfig from manim_slides.defaults import FOLDER_PATH From 9f1d27d3cb1eff2cb08b7ac7fe3a8ef6ec8432fc Mon Sep 17 00:00:00 2001 From: mateuszdrwal Date: Sun, 2 Jun 2024 12:59:40 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3135575..14d534e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed whitespace issue in default RevealJS template. [#442](https://github.com/jeertmans/manim-slides/pull/442) +(unreleased-chore)= +### Chore + +- Removed an old validation check that prevented setting `loop=True` with + `auto_next=True` on `next_slide()` + [#445](https://github.com/jeertmans/manim-slides/pull/445) + (v5.1.7)= ## [v5.1.7](https://github.com/jeertmans/manim-slides/compare/v5.1.6...v5.1.7)