Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2af0403
refactor(lib): change how manim API is imported
jeertmans Oct 13, 2023
e0fdac9
chore(lib): delete old files
jeertmans Oct 13, 2023
01aca2f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2023
5ebb61c
Merge remote-tracking branch 'origin/refactor-manim' into refactor-manim
jeertmans Oct 13, 2023
f3ff76e
wip: moving all commands
jeertmans Oct 13, 2023
06ff18f
adding animations
jeertmans Oct 13, 2023
9355e3d
fix tests
jeertmans Oct 13, 2023
2211ac6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2023
dd57527
fix mypy
jeertmans Oct 13, 2023
effcc75
fixes
jeertmans Oct 13, 2023
418f1f7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2023
f5f60e7
trying to fix docs
jeertmans Oct 14, 2023
d4a6148
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 14, 2023
1b1d6c5
wip: docs
jeertmans Oct 16, 2023
c803d67
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 16, 2023
bccff71
make it work
jeertmans Oct 16, 2023
036a796
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 16, 2023
2c3e5cc
wip test
jeertmans Oct 16, 2023
927a489
Merge remote-tracking branch 'origin/refactor-manim' into refactor-manim
jeertmans Oct 16, 2023
fb97409
tests are working
jeertmans Oct 16, 2023
946cb11
improving docs
jeertmans Oct 16, 2023
aa8205a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 16, 2023
85ff07e
fix index
jeertmans Oct 16, 2023
b79da53
docs: nicer shift
jeertmans Oct 16, 2023
6c14ee2
docs: nicer quickstart example
jeertmans Oct 16, 2023
95f84ef
fix tests
jeertmans Oct 17, 2023
353a7f4
change tests
jeertmans Oct 17, 2023
7b37c2d
move coverage to test workflow
jeertmans Oct 17, 2023
b182e72
fix(tests): remove resolve
jeertmans Oct 17, 2023
ffe8322
strict resolve
jeertmans Oct 17, 2023
90a2909
change local path test
jeertmans Oct 17, 2023
4c1df69
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 17, 2023
f8978c2
documented changes
jeertmans Oct 17, 2023
489ea5b
Merge remote-tracking branch 'origin/refactor-manim' into refactor-manim
jeertmans Oct 17, 2023
c010971
cleanup docs
jeertmans Oct 17, 2023
4d166d5
cleanup files
jeertmans Oct 17, 2023
a767aef
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 17, 2023
9300811
fix(ci): set type
jeertmans Oct 17, 2023
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
Prev Previous commit
Next Next commit
tests are working
  • Loading branch information
jeertmans committed Oct 16, 2023
commit fb97409cd5d7bd75949807785a4f21c1787da738
2 changes: 2 additions & 0 deletions custom_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
style:
background_color: "#000000"
3 changes: 1 addition & 2 deletions manim_slides/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from .__version__ import __version__
from .convert import convert
from .logger import make_logger
from .logger import logger
from .present import list_scenes, present
from .wizard import init, wizard

Expand All @@ -27,7 +27,6 @@ def cli(notify_outdated_version: bool) -> None:

If no command is specified, defaults to `present`.
"""
logger = make_logger()
# Code below is mostly a copy from:
# https://github.com/ManimCommunity/manim/blob/main/manim/cli/render/commands.py
if notify_outdated_version:
Expand Down
4 changes: 3 additions & 1 deletion manim_slides/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from rich.console import Console
from rich.logging import RichHandler

__all__ = ["logger", "make_logger"]
__all__ = ["logger"]

HIGHLIGHTED_KEYWORDS = [ # these keywords are highlighted specially
"Played",
Expand Down Expand Up @@ -43,4 +43,6 @@ def make_logger() -> logging.Logger:
return logger


make_logger()

logger = logging.getLogger("manim-slides")
26 changes: 22 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@
import pytest

from manim_slides.config import PresentationConfig
from manim_slides.logger import make_logger

_ = make_logger() # This is run so that logger is created

@pytest.fixture
def tests_folder() -> Iterator[Path]:
path = Path(__file__).parent.resolve()
assert path.exists()
yield path


@pytest.fixture
def project_folder(tests_folder: Path) -> Iterator[Path]:
path = tests_folder.parent.resolve()
assert path.exists()
yield path


@pytest.fixture
def data_folder() -> Iterator[Path]:
path = (Path(__file__).parent / "data").resolve()
def data_folder(tests_folder: Path) -> Iterator[Path]:
path = (tests_folder / "data").resolve()
assert path.exists()
yield path

Expand All @@ -32,6 +43,13 @@ def slides_file(data_folder: Path) -> Iterator[Path]:
yield path


@pytest.fixture
def manimgl_config(project_folder: Path) -> Iterator[Path]:
path = (project_folder / "custom_config.yml").resolve()
assert path.exists()
yield path


def random_path(
length: int = 20,
dirname: Path = Path("./media/videos/example"),
Expand Down
6 changes: 4 additions & 2 deletions tests/test_slide.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import shutil
import subprocess
import sys
from pathlib import Path
Expand Down Expand Up @@ -45,11 +46,12 @@ def test_construct(_) -> None:

@cli
def test_render_basic_slide(
cli: click.Command, slides_file: Path, presentation_config: PresentationConfig
cli: click.Command, slides_file: Path, presentation_config: PresentationConfig, manimgl_config: Path
) -> None:
runner = CliRunner()

with runner.isolated_filesystem():
with runner.isolated_filesystem() as tmp_dir:
shutil.copy(manimgl_config, tmp_dir)
results = runner.invoke(cli, [str(slides_file), "BasicSlide", "-ql"])

assert results.exit_code == 0
Expand Down