Merge branch 'main' into reorganize

This commit is contained in:
Jérome Eertmans
2025-08-27 11:55:12 +02:00
18 changed files with 3241 additions and 2401 deletions

View File

@ -6,14 +6,14 @@ ci:
autoupdate_commit_msg: 'chore(deps): pre-commit autoupdate'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
rev: v2.15.0
hooks:
- id: pretty-format-yaml
args: [--autofix]
@ -21,13 +21,13 @@ repos:
exclude: poetry.lock
args: [--autofix, --trailing-commas]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.5
rev: v0.12.10
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
rev: v1.17.1
hooks:
- id: mypy
additional_dependencies: [types-requests, types-setuptools]

View File

@ -8,20 +8,52 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- start changelog -->
(unreleased)=
## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.5.1...HEAD)
## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.5.2...HEAD)
(unreleased-chore)=
### Chore
- Moved `manim_slides.docs.manim_slides_directive` to `manim_slides.sphinxext.manim_slides_directive`.
This is a **breaking change** because documentation configs have
to be updated.
[#242](https://github.com/jeertmans/manim-slides/pull/242)
(v5.5.2)=
## [v5.5.2](https://github.com/jeertmans/manim-slides/compare/v5.5.1...v5.5.2)
(v5.5.2-added)=
### Added
- `manim-slides render` now exits 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)
(v5.5.2-chore)=
### Chore
- Moved `docs` and `tests` extras, as well as `dev-dependencies`,
inside groups in `dependency-groups`. This could break existing code
when using one of those extras, but as they were not part of the public API,
we do not consider this to be a **breaking change**.
[#542](https://github.com/jeertmans/manim-slides/pull/542)
- Moved `manim_slides.docs.manim_slides_directive` to `manim_slides.sphinxext.manim_slides_directive`.
This is a **breaking change** because documentation configs have
to be updated.
[#242](https://github.com/jeertmans/manim-slides/pull/242)
- Added example in the research section of the gallery.
[@mmcilree](https://github.com/mmcilree) [#552](https://github.com/jeertmans/manim-slides/pull/552)
- Added example in the school work section of the gallery.
[@casperalgera](https://github.com/casperalgera) [#556](https://github.com/jeertmans/manim-slides/pull/556)
- Added example in the school work section of the gallery.
[@amstrdm](https://github.com/amstrdm) [#557](https://github.com/jeertmans/manim-slides/pull/557)
- Fixed some tests that were failing.
[#550](https://github.com/jeertmans/manim-slides/pull/550)
- Pinned `setuptools<81` for `manimgl` extra, as `setuptools>=81`
dropped support for its API.
[#550](https://github.com/jeertmans/manim-slides/pull/550)
(v5.5.2-fixed)=
### Fixed
- Fixed potential import issue of ManimGL, importing `manimlib` will parse `sys.argv`
to initialize the config, which can lead to surprising behavior when using the library with
different command line arguments that are not meant to be used by ManimGL.
[#550](https://github.com/jeertmans/manim-slides/pull/550)
(v5.5.1)=
## [v5.5.1](https://github.com/jeertmans/manim-slides/compare/v5.5.0...v5.5.1)

View File

@ -27,7 +27,7 @@ keywords:
- PowerPoint
- Python
license: MIT
version: v5.5.1
version: v5.5.2
preferred-citation:
publisher:
name: The Open Journal

View File

@ -154,7 +154,7 @@ Below is a comparison of the most used ones with Manim Slides:
## Citing
If you use this project, please cite it using the following reference:
If you use this software, please cite it using as:
```bibtex
@article{Jerome_Eertmans_Manim_Slides_A_2023,
@ -168,7 +168,9 @@ If you use this project, please cite it using the following reference:
}
```
or by linking this GitHub repository at the end of the presentation.
or by linking this GitHub repository at the end of your presentation.
Other citation formats can be obtained by clicking on the *Cite this repository* button on this page.
## Contributing

View File

@ -14,7 +14,7 @@ If you too have created content with Manim Slides that is available online
(e.g., a YouTube video or website),
don't hesitate to contact us so that we can share your content on this page!
## Scientif Research
## Scientific Research
Below are people that dissimenate their research results
using Manim Slides presentations.
@ -23,7 +23,7 @@ using Manim Slides presentations.
Daniel publishes his presentations on *Cosmology, String Theory and related*
topics on his
[personal website](https://panopepino.github.io/web_page/main_page/slides.html). https://panopepino.github.io/web_page/main_page/slides.html
[personal website](https://panopepino.github.io/web_page/main_page/slides.html).
For example, below are the slides of a seminar he gave titled
[Our Universe on a (Dark) Bubble](https://panopepino.github.io/web_page/main_page/presentations/2023_11_long/LS.html).
@ -67,9 +67,66 @@ For example, below are the slides of his
</iframe>
</div>
### Matthew McIlree
Matthew is a Computer Science researcher from Scotland and has used Manim Slides
to present his work on *Proof Logging for Constraint Programming*. He also publishes
his presentation slides on his [personal website](https://matthewmcilree.com).
Here are the slides from a 25-minute talk he presented at the 39th Annual AAAI Conference on Artificial Intelligence titled
[Certifying Bounds Propagation for Integer Multiplication Constraints](https://matthewmcilree.com/files/slides/mcilree_aaai2025.html).
<div style="position:relative;padding-bottom:56.25%;">
<iframe
loading="lazy"
style="width:100%;height:100%;position:absolute;left:0px;top:0px;"
frameborder="1"
width="100%"
height="100%"
allowfullscreen
allow="autoplay"
src="https://matthewmcilree.com/files/slides/mcilree_aaai2025.html">
</iframe>
</div>
## School Work
Below are people that used Manim Slides for school presentations.
*This list is currently empty. Please reach out to us if you have examples
to share!*
### Antonio Caserta
Antonio is a 17-year-old high school student from Germany who used Manim Slides to present his final project, *Episteme*, an AI financial terminal that uses crowdsourced data from social networks to gather stock insights.
The slides from his 30-minute presentation to the school board can be found below and on his [Github repository](https://github.com/amstrdm/episteme-manim-slides)
<div style="position:relative;padding-bottom:56.25%;">
<iframe
loading="lazy"
style="width:100%;height:100%;position:absolute;left:0px;top:0px;"
frameborder="1"
width="100%"
height="100%"
allowfullscreen
allow="autoplay"
src="https://amstrdm.github.io/episteme-manim-slides/">
</iframe>
</div>
### Casper Algera
Casper, a mathematics student from the Netherlands, used Manim Slides to present his bachelor's thesis.
In his presentation, he illustrates a probabilistic coupling argument related to the [contact process](https://en.wikipedia.org/wiki/Contact_process_(mathematics)).
His slides are available below, and his full presentation can be viewed on [YouTube](https://www.youtube.com/watch?v=ZJhvfCL5MWE).
<div style="position:relative;padding-bottom:56.25%;">
<iframe
loading="lazy"
style="width:100%;height:100%;position:absolute;left:0px;top:0px;"
frameborder="1"
width="100%"
height="100%"
allowfullscreen
allow="autoplay"
src="https://casperalgera.github.io/criticalvalueCP/">
</iframe>
</div>

View File

@ -1,3 +1,4 @@
"""Manim Slides' version."""
__version__ = "5.4.2"
__version__ = "5.5.2"

View File

@ -20,8 +20,13 @@ def checkhealth() -> None:
click.secho("\tmanim not found", bold=True)
try:
# Manimlib parses sys.argv on import, so we clear it temporarily.
old_argv = sys.argv
sys.argv = [__file__]
from manimlib import __version__ as manimlib_version
sys.argv = old_argv
click.echo(f"\tmanimgl (version: {manimlib_version})")
except ImportError:
click.secho("\tmanimgl not found", bold=True)

View File

@ -48,8 +48,7 @@ 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", "-w", *args])
completed = subprocess.run([sys.executable, "-m", "manimlib", "-w", *args])
else:
from manim.cli.render.commands import render as render_ce
render_ce(args, standalone_mode=False)
completed = subprocess.run([sys.executable, "-m", "manim", "render", *args])
sys.exit(completed.returncode)

View File

@ -22,8 +22,17 @@ if MANIM:
from manim import LEFT, AnimationGroup, FadeIn, FadeOut
from manim.mobject.mobject import Mobject
else:
import sys
# Manimlib parses sys.argv on import, so we clear it temporarily.
old_argv = sys.argv
sys.argv = [__file__]
from manimlib import LEFT, AnimationGroup, FadeIn, FadeOut
sys.argv = old_argv
del sys
Mobject = Any

View File

@ -1,11 +1,17 @@
"""ManimGL's implementation of the Slide class."""
import sys
from pathlib import Path
from typing import Any, ClassVar, Optional
from manimlib import Scene, ThreeDCamera
# Manimlib parses sys.argv on import, so we clear it temporarily.
old_argv = sys.argv
sys.argv = [__file__]
from manimlib import Scene, ThreeDCamera # noqa: E402
from .base import BaseSlide
sys.argv = old_argv
from .base import BaseSlide # noqa: E402
class Slide(BaseSlide, Scene): # type: ignore[misc]

View File

@ -26,7 +26,7 @@ docs = [
]
tests = [
"importlib-metadata>=8.6.1;python_version<'3.10'",
"manim-slides[full,manimgl,pyqt6,pyside6,sphinx-directive]",
"manim-slides[full,manim,manimgl,pyqt6,pyside6,sphinx-directive]",
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-env>=0.8.2",
@ -80,7 +80,7 @@ full = [
]
magic = ["manim-slides[manim]", "ipython>=8.12.2"]
manim = ["manim>=0.19"]
manimgl = ["manimgl>=1.7.2"]
manimgl = ["manimgl>=1.7.2", "setuptools<81"]
pyqt6 = ["pyqt6>=6.7.0"]
pyqt6-full = ["manim-slides[full,pyqt6]"]
pyside6 = ["pyside6>=6.6.1,!=6.8.1.1"]
@ -101,7 +101,7 @@ Repository = "https://github.com/jeertmans/manim-slides"
allow_dirty = false
commit = true
commit_args = ""
current_version = "5.5.1"
current_version = "5.5.2"
ignore_missing_version = false
message = "chore(deps): bump version from {current_version} to {new_version}"
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-rc(?P<release>\d+))?'
@ -205,6 +205,7 @@ filterwarnings = [
'ignore::DeprecationWarning:pkg_resources.*:',
'ignore:invalid escape sequence.*:DeprecationWarning',
'ignore:invalid escape sequence.*:SyntaxWarning',
'ignore:urllib3 v2 only supports OpenSSL.*:urllib3.exceptions.NotOpenSSLWarning',
]
[tool.ruff]

View File

@ -42,3 +42,8 @@ class BasicSlide(Slide):
class BasicSlideSkipReversing(BasicSlide):
skip_reversing = True
class FailingSlide(Slide):
def construct(self):
self.play("this fails to render")

View File

@ -20,7 +20,7 @@ PYSIDE6_NOT_INSTALLED = importlib.util.find_spec("PySide6") is None
"names",
list(
chain.from_iterable(
combinations(("manim", "manimlib", "PyQt6", "PySide6"), r=r)
combinations(("manim", "manimlib", "pyqt6", "pyside6"), r=r)
for r in range(0, 5)
)
),

View File

@ -67,7 +67,7 @@ def test_convert(slides_folder: Path, extension: str) -> None:
@pytest.mark.parametrize(("extension",), [("html",)])
def test_convert_data_uri_deprecated(slides_folder: Path, extension: str) -> None:
runner = CliRunner(mix_stderr=False)
runner = CliRunner()
with runner.isolated_filesystem():
with warnings.catch_warnings(record=True) as w:

View File

@ -27,7 +27,11 @@ def assert_import(
@skip_if_py39
def test_force_api() -> None:
# Manimlib parses sys.argv on import, so we clear it temporarily.
old_argv = sys.argv
sys.argv = [__file__]
pytest.importorskip("manimlib")
sys.argv = old_argv
import manim # noqa: F401
if "manimlib" in sys.modules:
@ -62,9 +66,12 @@ def test_invalid_api() -> None:
@skip_if_py39
@pytest.mark.filterwarnings("ignore:assert_import")
def test_manim_and_manimgl_imported() -> None:
# Manimlib parses sys.argv on import, so we clear it temporarily.
old_argv = sys.argv
sys.argv = [__file__]
pytest.importorskip("manimlib")
sys.argv = old_argv
import manim # noqa: F401
import manimlib # noqa: F401
assert_import(
api_name="manim",
@ -88,8 +95,11 @@ def test_manim_imported() -> None:
@skip_if_py39
def test_manimgl_imported() -> None:
# Manimlib parses sys.argv on import, so we clear it temporarily.
old_argv = sys.argv
sys.argv = [__file__]
pytest.importorskip("manimlib")
import manimlib # noqa: F401
sys.argv = old_argv
if "manim" in sys.modules:
del sys.modules["manim"]

View File

@ -41,7 +41,7 @@ def test_present_unexisting_slide(args: tuple[str, ...]) -> None:
results = runner.invoke(present, ["UnexistingSlide", *args])
assert results.exit_code != 0
assert "UnexistingSlide.json does not exist" in results.stdout
assert "UnexistingSlide.json does not exist" in results.output
def test_present_full_screen(args: tuple[str, ...]) -> None:

View File

@ -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:
@ -219,9 +250,13 @@ def init_slide(cls: SlideType) -> Slide:
if issubclass(cls, CESlide):
return cls()
elif issubclass(cls, GLSlide):
# Manimlib parses sys.argv on import, so we clear it temporarily.
old_argv = sys.argv
sys.argv = [__file__]
from manimlib.config import parse_cli
_args = parse_cli()
sys.argv = old_argv
return cls()
raise ValueError(f"Unsupported class {cls}")

5404
uv.lock generated

File diff suppressed because it is too large Load Diff