Skip to content

Commit 37d57eb

Browse files
Use older version of type hints for backwards-compatibility
1 parent 147f80b commit 37d57eb

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

checksit/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def _get_ncas_specs(
338338
file_content: Union[cdl.CDLParser, image.ImageParser, pp.PPHeader, badc_csv.BADCCSVHeader, yml.YAMLFile],
339339
log_mode: str = "standard",
340340
verbose: bool = False,
341-
) -> Tuple[str, list[str]]:
341+
) -> Tuple[str, List[str]]:
342342
"""Get the correct specs for NCAS data files.
343343
344344
Args:

checksit/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import click
99
import os
10-
from typing import Optional
10+
from typing import Optional, List
1111

1212
from .utils import string_to_dict, string_to_list
1313
from .check import check_file
@@ -135,7 +135,7 @@ def check(
135135
@click.option("-e", "--exclude-file", default=None)
136136
@click.option("--verbose/--no-verbose", default=False)
137137
def summary(
138-
log_files: Optional[list[str]] = None,
138+
log_files: Optional[List[str]] = None,
139139
log_directory: Optional[str] = None,
140140
show_files: bool = False,
141141
exclude: Optional[str] = None,
@@ -190,7 +190,7 @@ def summary(
190190
@main.command()
191191
@click.argument("check_ids", nargs=-1, default=None)
192192
@click.option("--verbose/--no-verbose", default=False)
193-
def describe(check_ids: Optional[list[str]] = None, verbose: bool = False):
193+
def describe(check_ids: Optional[List[str]] = None, verbose: bool = False):
194194
"""CLI call to describe rules.
195195
196196
Reads options from the command line and calls the describe function to print the
@@ -206,7 +206,7 @@ def describe(check_ids: Optional[list[str]] = None, verbose: bool = False):
206206

207207
@main.command()
208208
@click.argument("spec_ids", nargs=-1, default=None)
209-
def show_specs(spec_ids: Optional[list[str]] = None):
209+
def show_specs(spec_ids: Optional[List[str]] = None):
210210
"""CLI call to show details of specs.
211211
212212
Reads options from the command line and calls the show_specs function to print the

checksit/generic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
import re
1414
import numpy as np
1515
import datetime as dt
16-
from typing import List, Dict, Any, Set, Tuple, Optional, Union
17-
from collections.abc import Iterable
16+
from typing import List, Dict, Any, Set, Tuple, Optional, Union, Iterable
1817

1918
# date formate regex
2019
# could be YYYY, YYYYmm, YYYYmmdd, YYYYmmdd-HH, YYYYmmdd-HHMM, YYYYmmdd-HHMMSS

checksit/readers/cdl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def _parse(self, inpt: str) -> None:
7373
else:
7474
self.cdl = inpt
7575

76-
cdl_lines: list[str] = self.cdl.strip().split("\n")
76+
cdl_lines: List[str] = self.cdl.strip().split("\n")
7777

7878
# Add "data:" and "}" to the CDL if they are not present - to aid parsing
7979
if "data:" not in [i.strip() for i in cdl_lines]:
@@ -110,7 +110,7 @@ def _check_format(self) -> None:
110110

111111
def _get_sections(
112112
self,
113-
lines: list[str],
113+
lines: List[str],
114114
split_patterns: Tuple[str, ...],
115115
start_at: int,
116116
) -> List[List[str]]:

checksit/summary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def do_exclude(err, exclude_patterns):
5757

5858

5959
def summarise(
60-
log_files: Optional[list[str]] = None,
60+
log_files: Optional[List[str]] = None,
6161
log_directory: Optional[str] = None,
6262
show_files: bool = False,
63-
exclude: Optional[list[str]] = None,
63+
exclude: Optional[List[str]] = None,
6464
verbose: bool = False,
6565
):
6666
log_files = log_files or find_log_files(log_directory)

0 commit comments

Comments
 (0)