A community-maintained Python framework for creating mathematical animations.
Fix failing pre-commit tests (#4434)
Christian Clausse6777d633488
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex 8f6dbfceb..11ef772cc 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -13,7 +13,7 @@ repos:- id: check-tomlname: Validate pyproject.toml- repo: https://github.com/astral-sh/ruff-pre-commit- rev: v0.12.9+ rev: v0.13.3hooks:- id: ruffname: ruff lint@@ -22,7 +22,7 @@ repos:- id: ruff-formattypes: [python]- repo: https://github.com/pre-commit/mirrors-mypy- rev: v1.17.1+ rev: v1.18.2hooks:- id: mypyadditional_dependencies:diff --git a/manim/mobject/graphing/probability.py b/manim/mobject/graphing/probability.pyindex 4604d3b60..d31637913 100644--- a/manim/mobject/graphing/probability.py+++ b/manim/mobject/graphing/probability.py@@ -170,7 +170,7 @@ class SampleSpace(Rectangle):"direction": direction,"buff": buff,}- return VGroup(parts.braces, parts.labels) # type: ignore[arg-type]+ return VGroup(parts.braces, parts.labels)def get_side_braces_and_labels(self,diff --git a/manim/scene/vector_space_scene.py b/manim/scene/vector_space_scene.pyindex ccc378020..7e0748126 100644--- a/manim/scene/vector_space_scene.py+++ b/manim/scene/vector_space_scene.py@@ -971,8 +971,8 @@ class LinearTransformationScene(VectorScene):)label_mob.vector = vector # type: ignore[attr-defined]label_mob.kwargs = kwargs # type: ignore[attr-defined]- if "animate" in label_mob.kwargs: # type: ignore[operator]- label_mob.kwargs.pop("animate") # type: ignore[attr-defined]+ if "animate" in label_mob.kwargs:+ label_mob.kwargs.pop("animate")self.transformable_labels.append(label_mob)return cast(MathTex, label_mob)diff --git a/manim/utils/docbuild/autoaliasattr_directive.py b/manim/utils/docbuild/autoaliasattr_directive.pyindex 76ef5a0a1..dbb457242 100644--- a/manim/utils/docbuild/autoaliasattr_directive.py+++ b/manim/utils/docbuild/autoaliasattr_directive.py@@ -6,7 +6,7 @@ from typing import TYPE_CHECKINGfrom docutils import nodesfrom docutils.parsers.rst import Directive-from docutils.statemachine import ViewList+from docutils.statemachine import StringListfrom manim.utils.docbuild.module_parsing import parse_module_attributes@@ -143,7 +143,7 @@ class AliasAttrDocumenter(Directive):# Using the `.. class::` directive is CRUCIAL, since# function/method parameters are always annotated via# classes - therefore Sphinx expects a class- unparsed = ViewList(+ unparsed = StringList([f".. class:: {alias_name}","",@@ -169,7 +169,9 @@ class AliasAttrDocumenter(Directive):# Add all the lines with 4 spaces behind, to consider all the# documentation as a paragraph INSIDE the `.. class::` blockdoc_lines = alias_doc.split("\n")- unparsed.extend(ViewList([f" {line}" for line in doc_lines]))+ unparsed.extend(+ StringList([f" {line}" for line in doc_lines])+ )# Parse the reST text into a fresh container# https://www.sphinx-doc.org/en/master/extdev/markupapi.html#parsing-directive-content-as-rest@@ -191,7 +193,7 @@ class AliasAttrDocumenter(Directive):# Using the `.. class::` directive is CRUCIAL, since# function/method parameters are always annotated via# classes - therefore Sphinx expects a class- unparsed = ViewList(+ unparsed = StringList([f".. class:: {name}","",@@ -218,7 +220,7 @@ class AliasAttrDocumenter(Directive):# Let Sphinx Autosummary do its thing as always# Add all the attribute names with 4 spaces behind, so that# they're considered as INSIDE the `.. autosummary::` block- unparsed = ViewList(+ unparsed = StringList([".. autosummary::",*(f" {attr}" for attr in module_attrs_list),