Skip to content

Commit

Permalink
Fix Rerun 3.9 compatibility: Remove imports of TypeAlias (#7794)
Browse files Browse the repository at this point in the history
### What
* This should fix #7793

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.

---------

Co-authored-by: Jeremy Leibs <[email protected]>
  • Loading branch information
emilk and jleibs authored Oct 17, 2024
1 parent 684851a commit d50e9e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion examples/python/ocr/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os
from enum import Enum
from pathlib import Path
from typing import Any, Final, Iterable, Optional, TypeAlias
from typing import Any, Final, Iterable, Optional

import cv2 as cv2
import numpy as np
Expand All @@ -21,6 +21,7 @@
import tqdm
from paddleocr import PPStructure
from paddleocr.ppstructure.recovery.recovery_to_doc import sorted_layout_boxes
from typing_extensions import TypeAlias

EXAMPLE_DIR: Final = Path(os.path.dirname(__file__))
DATASET_DIR: Final = EXAMPLE_DIR / "dataset"
Expand Down
2 changes: 0 additions & 2 deletions rerun_py/rerun_bindings/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

from typing import TYPE_CHECKING, TypeAlias, Union

from .rerun_bindings import *
6 changes: 3 additions & 3 deletions rerun_py/rerun_bindings/types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Sequence, Union
from typing import TYPE_CHECKING, Dict, Sequence, Type, Union

import numpy as np
import numpy.typing as npt
Expand Down Expand Up @@ -34,7 +34,7 @@
]
"""A type alias for any component-column-like object."""

ComponentLike: TypeAlias = Union[str, type["ComponentMixin"]]
ComponentLike: TypeAlias = Union[str, Type["ComponentMixin"]]
"""
A type alias for a component-like object used for content-expressions and column selectors.
Expand All @@ -51,7 +51,7 @@

ViewContentsLike: TypeAlias = Union[
str,
dict[str, Union[AnyColumn, Sequence[ComponentLike]]],
Dict[str, Union[AnyColumn, Sequence[ComponentLike]]],
]
"""
A type alias for specifying the contents of a view.
Expand Down

0 comments on commit d50e9e0

Please sign in to comment.