Compare commits

...

6 Commits

Author SHA1 Message Date
804cf48a02 fix(ci): explicitly include manim extra in tests group 2025-06-13 10:23:56 +02:00
3c6e2db7db chore(deps): pre-commit autoupdate (#543)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.5 → v0.11.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.5...v0.11.7)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-29 09:38:26 +02:00
04b0eb5685 feat(lib): propagate manim render exit code (#545)
* feat: propagate `manim render` exit code

* changelog

* test

* fix typo
2025-04-29 09:37:55 +02:00
0c6cd67038 chore(dev): move dev-dependencies inside dependency-groups (#542)
* chore(dev): move dev-dependencies inside dependency-groups

* fix(ci): ci was not broken
2025-04-18 14:15:30 +02:00
a5412a8df2 chore(deps): pre-commit autoupdate (#541)
* chore(deps): pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.2 → v0.11.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.2...v0.11.5)

* chore(fmt): auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-15 12:48:36 +02:00
e9480c9bc7 chore(docs): update features table 2025-04-03 11:19:06 +02:00
11 changed files with 1632 additions and 1335 deletions

View File

@ -96,7 +96,7 @@ jobs:
uses: ssciwr/setup-mesa-dist-win@v2 uses: ssciwr/setup-mesa-dist-win@v2
- name: Run pytest - name: Run pytest
run: uv run --python ${{ matrix.pyversion }} --frozen --extra tests pytest run: uv run --python ${{ matrix.pyversion }} --frozen --group tests --no-dev pytest
- name: Upload to codecov.io - name: Upload to codecov.io
uses: codecov/codecov-action@v5 uses: codecov/codecov-action@v5

View File

@ -21,7 +21,7 @@ repos:
exclude: poetry.lock exclude: poetry.lock
args: [--autofix, --trailing-commas] args: [--autofix, --trailing-commas]
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2 rev: v0.11.7
hooks: hooks:
- id: ruff - id: ruff
args: [--fix] args: [--fix]

View File

@ -6,13 +6,13 @@ build:
apt_packages: apt_packages:
- libpango1.0-dev - libpango1.0-dev
- ffmpeg - ffmpeg
jobs:
post_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --group docs --no-dev --no-cache
sphinx: sphinx:
builder: html builder: html
configuration: docs/source/conf.py configuration: docs/source/conf.py
fail_on_warning: true fail_on_warning: true
python:
install:
- method: pip
path: .
extra_requirements:
- docs

View File

@ -10,6 +10,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(unreleased)= (unreleased)=
## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.5.1...HEAD) ## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.5.1...HEAD)
(unreleased-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)
(unreleased-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)
(v5.5.1)= (v5.5.1)=
## [v5.5.1](https://github.com/jeertmans/manim-slides/compare/v5.5.0...v5.5.1) ## [v5.5.1](https://github.com/jeertmans/manim-slides/compare/v5.5.0...v5.5.1)
@ -24,7 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Previously, it was not possible to pause HTML slides, which can be very annoying Previously, it was not possible to pause HTML slides, which can be very annoying
when trying to explain something. when trying to explain something.
[#539](https://github.com/jeertmans/manim-slides/pull/539) [#539](https://github.com/jeertmans/manim-slides/pull/539)
(v5.5.0)= (v5.5.0)=
## [v5.5.0](https://github.com/jeertmans/manim-slides/compare/v5.4.2...v5.5.0) ## [v5.5.0](https://github.com/jeertmans/manim-slides/compare/v5.4.2...v5.5.0)

View File

@ -32,7 +32,7 @@ and development dependencies. If not already, please install this tool.
With uv, installation becomes straightforward: With uv, installation becomes straightforward:
```bash ```bash
uv sync --all-extras uv sync
``` ```
:::{note} :::{note}

View File

@ -10,20 +10,22 @@ The following summarizes the different presentation features Manim Slides offers
| :--- | :---: | :---: | :---: | :---: | | :--- | :---: | :---: | :---: | :---: |
| Basic navigation through slides | Yes | Yes | Yes | Yes (static image) | | Basic navigation through slides | Yes | Yes | Yes | Yes (static image) |
| Replay slide | Yes | No | No | N/A | | Replay slide | Yes | No | No | N/A |
| Pause animation | Yes | No | No | N/A | | Pause animation | Yes | Yes | No | N/A |
| Play slide in reverse | Yes | No | No | N/A | | Play slide in reverse | Yes | No | No | N/A |
| Slide count | Yes | Yes (optional) | Yes (optional) | N/A | | Slide count | Yes | Yes (optional) | Yes (optional) | N/A |
| Needs Python with Manim Slides installed | Yes | No | No | No | Needs Python with Manim Slides installed | Yes | No | No | No
| Requires internet access | No | Yes | No | No | | Requires internet access | No | Depends[^1] | No | No |
| Auto. play slides | Yes | Yes | Yes | N/A | | Auto. play slides | Yes | Yes | Yes | N/A |
| Loops support | Yes | Yes | Yes | N/A | | Loops support | Yes | Yes | Yes | N/A |
| Fully customizable | No | Yes (`--use-template` option) | No | No | | Fully customizable | No | Yes (`--use-template` option) | No | No |
| Other dependencies | None | A modern web browser | PowerPoint or LibreOffice Impress[^1] | None | | Other dependencies | None | A modern web browser | PowerPoint or LibreOffice Impress[^2] | None |
| Works cross-platforms | Yes | Yes | Partly[^1][^2] | Yes | | Works cross-platforms | Yes | Yes | Partly[^2][^3] | Yes |
::: :::
[^1]: If you encounter a problem where slides do not automatically play or loops do not work, [^1]: By default, HTML assets are loaded from the internet, but they can be
pre-downloaded and embedded in the HTML file at conversion time.
[^2]: If you encounter a problem where slides do not automatically play or loops do not work,
please please
[file an issue on GitHub](https://github.com/jeertmans/manim-slides/issues/new/choose). [file an issue on GitHub](https://github.com/jeertmans/manim-slides/issues/new/choose).
[^2]: PowerPoint online does not seem to support automatic playing of videos, [^3]: PowerPoint online does not seem to support automatic playing of videos,
so you need LibreOffice Impress on Linux platforms. so you need LibreOffice Impress on Linux platforms.

View File

@ -48,6 +48,7 @@ def render(ce: bool, gl: bool, args: tuple[str, ...]) -> None:
if ce and gl: if ce and gl:
raise click.UsageError("You cannot specify both --CE and --GL renderers.") raise click.UsageError("You cannot specify both --CE and --GL renderers.")
if gl: if gl:
subprocess.run([sys.executable, "-m", "manimlib", "-w", *args]) completed = subprocess.run([sys.executable, "-m", "manimlib", "-w", *args])
else: else:
subprocess.run([sys.executable, "-m", "manim", "render", *args]) completed = subprocess.run([sys.executable, "-m", "manim", "render", *args])
sys.exit(completed.returncode)

View File

@ -2,6 +2,39 @@
build-backend = "hatchling.build" build-backend = "hatchling.build"
requires = ["hatchling", "hatch-fancy-pypi-readme"] requires = ["hatchling", "hatch-fancy-pypi-readme"]
[dependency-groups]
dev = [
{include-group = "docs"},
{include-group = "tests"},
"bump-my-version>=0.20.3",
"pre-commit>=3.5.0",
]
docs = [
"manim-slides[magic,manim,pyqt6,sphinx-directive]",
"furo>=2023.5.20",
"ipykernel>=6.25.1",
"myst-parser>=2.0.0",
"nbsphinx>=0.9.2",
"pandoc>=2.3",
"pygments<2.19", # See: https://github.com/ManimCommunity/manim/issues/4104
"sphinx>=7.0.1",
"sphinxcontrib-programoutput>=0.18",
"sphinx-design>=0.6.1",
"sphinx-click>=4.4.0",
"sphinx-copybutton>=0.5.1",
"sphinxext-opengraph>=0.7.5",
]
tests = [
"importlib-metadata>=8.6.1;python_version<'3.10'",
"manim-slides[full,manim,manimgl,pyqt6,pyside6,sphinx-directive]",
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-env>=0.8.2",
"pytest-missing-modules>=0.1.0",
"pytest-qt>=4.2.0",
"setuptools>=73.0.1",
]
[project] [project]
authors = [{name = "Jérome Eertmans", email = "jeertmans@icloud.com"}] authors = [{name = "Jérome Eertmans", email = "jeertmans@icloud.com"}]
classifiers = [ classifiers = [
@ -42,21 +75,6 @@ name = "manim-slides"
requires-python = ">=3.9" requires-python = ">=3.9"
[project.optional-dependencies] [project.optional-dependencies]
docs = [
"manim-slides[magic,manim,pyqt6,sphinx-directive]",
"furo>=2023.5.20",
"ipykernel>=6.25.1",
"myst-parser>=2.0.0",
"nbsphinx>=0.9.2",
"pandoc>=2.3",
"pygments<2.19", # See: https://github.com/ManimCommunity/manim/issues/4104
"sphinx>=7.0.1",
"sphinxcontrib-programoutput>=0.18",
"sphinx-design>=0.6.1",
"sphinx-click>=4.4.0",
"sphinx-copybutton>=0.5.1",
"sphinxext-opengraph>=0.7.5",
]
full = [ full = [
"manim-slides[magic,manim,sphinx-directive]", "manim-slides[magic,manim,sphinx-directive]",
] ]
@ -68,15 +86,6 @@ pyqt6-full = ["manim-slides[full,pyqt6]"]
pyside6 = ["pyside6>=6.6.1,!=6.8.1.1"] pyside6 = ["pyside6>=6.6.1,!=6.8.1.1"]
pyside6-full = ["manim-slides[full,pyside6]"] pyside6-full = ["manim-slides[full,pyside6]"]
sphinx-directive = ["docutils>=0.20.1", "manim-slides[manim]"] sphinx-directive = ["docutils>=0.20.1", "manim-slides[manim]"]
tests = [
"importlib-metadata>=8.6.1;python_version<'3.10'",
"manim-slides[full,manimgl,pyqt6,pyside6,sphinx-directive]",
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-env>=0.8.2",
"pytest-missing-modules>=0.1.0",
"pytest-qt>=4.2.0",
]
[project.scripts] [project.scripts]
manim-slides = "manim_slides.__main__:cli" manim-slides = "manim_slides.__main__:cli"
@ -225,10 +234,3 @@ isort = {known-first-party = ["manim_slides", "tests"]}
[tool.ruff.lint.per-file-ignores] [tool.ruff.lint.per-file-ignores]
"docs/source/reference/magic_example.ipynb" = ["F403", "F405"] "docs/source/reference/magic_example.ipynb" = ["F403", "F405"]
"tests/test_slide.py" = ["N801"] "tests/test_slide.py" = ["N801"]
[tool.uv]
dev-dependencies = [
"bump-my-version>=0.20.3",
"pre-commit>=3.5.0",
"setuptools>=73.0.1",
]

View File

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

View File

@ -113,6 +113,37 @@ def test_render_basic_slide(
assert local_presentation_config.resolution == presentation_config.resolution 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( def test_clear_cache(
slides_file: Path, slides_file: Path,
) -> None: ) -> None:

2813
uv.lock generated

File diff suppressed because it is too large Load Diff