From 7dbbe6e140f5ee3a3d5e0bf2951f7edc539fe1c5 Mon Sep 17 00:00:00 2001 From: WillB97 Date: Sat, 6 Apr 2024 01:11:29 +0100 Subject: [PATCH] Typing experiment --- .github/workflows/check.yml | 2 +- april_vision/cli/marker_generator/marker_modes/mode_single.py | 2 ++ april_vision/cli/marker_generator/utils.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 78bf9af..0cb14a8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,7 +17,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install .[dev,cli] - python -m pip install opencv-python-headless>=4.8 + python -m pip install 'opencv-python-headless>=4.8,<4.9' - name: Lint run: | make lint diff --git a/april_vision/cli/marker_generator/marker_modes/mode_single.py b/april_vision/cli/marker_generator/marker_modes/mode_single.py index 0a4c980..4b07172 100644 --- a/april_vision/cli/marker_generator/marker_modes/mode_single.py +++ b/april_vision/cli/marker_generator/marker_modes/mode_single.py @@ -1,5 +1,6 @@ import argparse import logging +from typing import Union from PIL import Image @@ -21,6 +22,7 @@ def main(args: argparse.Namespace) -> None: marker_ids = parse_marker_ranges(tag_data, args.range) + page_size: Union[PageSize, CustomPageSize] if args.page_size == 'CROPPED': # Allow for an additional marker pixel border required_width = args.marker_size * (12 / 8) diff --git a/april_vision/cli/marker_generator/utils.py b/april_vision/cli/marker_generator/utils.py index 52dec4f..0eef21f 100644 --- a/april_vision/cli/marker_generator/utils.py +++ b/april_vision/cli/marker_generator/utils.py @@ -2,7 +2,7 @@ from enum import Enum from typing import List, Tuple -from font_roboto import Roboto # type: ignore[import] +from font_roboto import Roboto # type: ignore[import,unused-ignore] from april_vision.cli.utils import ApriltagFamily, parse_ranges