Skip to content

Commit

Permalink
Fix broken annotations in python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
einarf committed Jan 19, 2025
1 parent 93d50da commit 2daf8fb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions moderngl_window/scene/mesh.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional

import glm
Expand Down
1 change: 1 addition & 0 deletions moderngl_window/scene/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Wrapper for a loaded mesh / vao with properties
"""

from __future__ import annotations
from typing import Optional

import glm
Expand Down
10 changes: 5 additions & 5 deletions moderngl_window/scene/programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def draw(
self.program["m_cam"].write(camera_matrix)
mesh.vao.render(self.program)

def apply(self, mesh: Mesh) -> "MeshProgram" | None:
def apply(self, mesh: Mesh) -> MeshProgram | None:
"""
Determine if this ``MeshProgram`` should be applied to the mesh.
Can return self or some ``MeshProgram`` instance to support dynamic ``MeshProgram`` creation
Expand Down Expand Up @@ -140,7 +140,7 @@ def draw(
self.program["m_cam"].write(camera_matrix)
mesh.vao.render(self.program)

def apply(self, mesh: Mesh) -> "MeshProgram" | None:
def apply(self, mesh: Mesh) -> MeshProgram | None:
if not mesh.material:
return None

Expand Down Expand Up @@ -233,7 +233,7 @@ def draw(
self.program["m_cam"].write(camera_matrix)
mesh.vao.render(self.program)

def apply(self, mesh: Mesh) -> "MeshProgram" | None:
def apply(self, mesh: Mesh) -> MeshProgram | None:
if not mesh.material:
return None

Expand Down Expand Up @@ -291,7 +291,7 @@ def draw(
self.program["m_cam"].write(camera_matrix)
mesh.vao.render(self.program)

def apply(self, mesh: Mesh) -> "MeshProgram" | None:
def apply(self, mesh: Mesh) -> MeshProgram | None:
if not mesh.material:
return None

Expand Down Expand Up @@ -342,5 +342,5 @@ def draw(

mesh.vao.render(self.program)

def apply(self, mesh: Mesh) -> "MeshProgram" | None:
def apply(self, mesh: Mesh) -> MeshProgram | None:
return self
1 change: 1 addition & 0 deletions moderngl_window/scene/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Wrapper for a loaded scene with properties.
"""

from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Any, Optional

Expand Down

0 comments on commit 2daf8fb

Please sign in to comment.