Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Lint
run: uv run ruff check .
- name: Typecheck
run: uv run ty check manim_voiceover
run: uv run ty check src/manim_voiceover
- name: Mypy
run: uv run mypy
- name: Test with coverage
Expand Down
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ These instructions apply to this repository.
https://github.com/osolmaz/slophammer/blob/main/docs/AGENT_ENTRYPOINT.md
- Preserve the public package API unless the change is explicitly scoped as breaking.
- Add or update tests when changing behavior.
- Run `uv run ruff format --check .`, `uv run ruff check .`, `uv run ty check manim_voiceover`, `uv run mypy`, `uv run pytest --cov=manim_voiceover --cov-fail-under=85`, `uvx slophammer-py@0.3.0 dry .`, `uv run mutmut run`, `uv run python scripts/check_mutmut_results.py`, `uv run pip-audit`, `uvx slophammer-py@0.3.0 check .`, and `uvx slophammer-py@0.3.0 check . --execute` before submitting a change.
- Source code lives under `src/manim_voiceover`.
- Run `uv run ruff format --check .`, `uv run ruff check .`, `uv run ty check src/manim_voiceover`, `uv run mypy`, `uv run pytest --cov=manim_voiceover --cov-fail-under=85`, `uvx slophammer-py@0.3.0 dry .`, `uv run mutmut run`, `uv run python scripts/check_mutmut_results.py`, `uv run pip-audit`, `uvx slophammer-py@0.3.0 check .`, and `uvx slophammer-py@0.3.0 check . --execute` before submitting a change.
- Public functions and meaningful helpers must stay annotated and pass Ruff `ANN`, ty, and strict mypy.
- Keep `Any`, casts, and import ignores isolated to external-library boundaries with a clear reason.
- Use the existing project style and avoid unrelated formatting churn.
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ dev = [
[tool.ruff]
line-length = 127
target-version = "py38"
src = ["manim_voiceover", "tests"]
src = ["src", "tests"]
extend-exclude = ["docs", "examples", "mutants"]

[tool.ruff.lint]
Expand All @@ -145,21 +145,21 @@ markers = [
]

[tool.coverage.run]
source = ["manim_voiceover"]
source = ["src/manim_voiceover"]
branch = true

[tool.coverage.report]
fail_under = 85
show_missing = true

[tool.mutmut]
source_paths = ["manim_voiceover"]
source_paths = ["src/manim_voiceover"]

[tool.mypy]
python_version = "3.8"
strict = true
show_error_codes = true
files = ["manim_voiceover"]
files = ["src/manim_voiceover"]

# These dependencies do not ship usable type information for the supported
# version range. Keep missing-import ignores scoped to those external
Expand All @@ -179,7 +179,7 @@ module = [
ignore_missing_imports = true

[tool.hatch.build.targets.wheel]
packages = ["manim_voiceover"]
packages = ["src/manim_voiceover"]

[build-system]
requires = ["hatchling"]
Expand Down
24 changes: 12 additions & 12 deletions slophammer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ python:
coverage:
threshold: 85
paths:
- manim_voiceover
- src/manim_voiceover
exclude:
- pattern: "docs/**"
reason: "Documentation source is not shipped runtime package code."
Expand All @@ -13,7 +13,7 @@ python:
dry:
max_findings: 0
paths:
- manim_voiceover
- src/manim_voiceover
exclude:
- pattern: "docs/**"
reason: "Documentation source is not production library code."
Expand All @@ -24,23 +24,23 @@ python:
min_tokens: 100
mutation:
targets:
- manim_voiceover
- src/manim_voiceover
exclude:
- pattern: "docs/**"
reason: "Documentation source is not production library code."
- pattern: "examples/**"
reason: "Example scenes are documentation/demo code."
dependency_boundaries:
- from: manim_voiceover/services
- from: src/manim_voiceover/services
allow:
- manim_voiceover/_typing
- manim_voiceover/defaults
- manim_voiceover/helper
- manim_voiceover/modify_audio
- manim_voiceover/tracker
- from: manim_voiceover/translate
- src/manim_voiceover/_typing
- src/manim_voiceover/defaults
- src/manim_voiceover/helper
- src/manim_voiceover/modify_audio
- src/manim_voiceover/tracker
- from: src/manim_voiceover/translate
allow:
- manim_voiceover/defaults
- manim_voiceover/helper
- src/manim_voiceover/defaults
- src/manim_voiceover/helper
typecheck:
demotions: []
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 2 additions & 1 deletion tests/test_core_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
from pathlib import Path
from types import SimpleNamespace

from pydub import AudioSegment

from manim_voiceover.defaults import DEFAULT_VOICEOVER_CACHE_JSON_FILENAME
from manim_voiceover.helper import append_to_json_file, chunks, msg_box, remove_bookmarks, trim_silence
from manim_voiceover.services.base import SpeechService, timestamps_to_word_boundaries
from manim_voiceover.tracker import AUDIO_OFFSET_RESOLUTION, TimeInterpolator, VoiceoverTracker
from manim_voiceover.translate.gettext_utils import POEntry, POFile, extract_str
from manim_voiceover.voiceover_scene import VoiceoverScene
from pydub import AudioSegment


class DummyService(SpeechService):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_examples_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest

from _render_assertions import assert_audio_is_speech_like, assert_video_has_audio_stream, load_audible_audio
from tests._render_assertions import assert_audio_is_speech_like, assert_video_has_audio_stream, load_audible_audio


@dataclass(frozen=True)
Expand Down
1 change: 1 addition & 0 deletions tests/test_more_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from types import SimpleNamespace

import pytest

from manim_voiceover.defaults import DEFAULT_VOICEOVER_CACHE_JSON_FILENAME
from manim_voiceover.helper import (
append_to_json_file,
Expand Down
5 changes: 3 additions & 2 deletions tests/test_mutation_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from types import SimpleNamespace

import pytest
from pydub import AudioSegment
from pydub.generators import Sine

from manim_voiceover.helper import (
append_to_json_file,
create_dotenv_file,
Expand All @@ -15,8 +18,6 @@
)
from manim_voiceover.tracker import AUDIO_OFFSET_RESOLUTION, TimeInterpolator, VoiceoverTracker
from manim_voiceover.voiceover_scene import VoiceoverScene, _pop_float, _pop_int, _pop_optional_str
from pydub import AudioSegment
from pydub.generators import Sine


def _tone(duration):
Expand Down
1 change: 1 addition & 0 deletions tests/test_recorder_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from types import SimpleNamespace

import pytest

from manim_voiceover.services.recorder import RecorderService
from manim_voiceover.services.recorder.utility import (
FIRST_RECORDING_MESSAGES,
Expand Down
1 change: 1 addition & 0 deletions tests/test_translation_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from types import SimpleNamespace

import pytest

from manim_voiceover.translate import get_gettext, render, translate


Expand Down
2 changes: 1 addition & 1 deletion ty.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[src]
include = ["manim_voiceover"]
include = ["src/manim_voiceover"]

[terminal]
error-on-warning = true
Expand Down