Skip to content

Commit 2543de9

Browse files
committed
add mypy lintrunner support
Signed-off-by: Eli Uriegas <eliuriegas@meta.com>
1 parent bf5c714 commit 2543de9

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

.lintrunner.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ include_patterns = [
4646
'tools/**/*.pyi',
4747
'torchci/**/*.py',
4848
'torchci/**/*.pyi',
49+
's3_management/*.py',
4950
]
5051
exclude_patterns = [
5152
'aws/lambda/servicelab-ingestor/**',

s3_management/manage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
from datetime import datetime
1212
from os import makedirs, path
1313
from re import match, search, sub
14-
from typing import Dict, Iterable, List, Optional, Set, Type, TypeVar
14+
from typing import Dict, Iterable, List, Optional, Set, Type, TypeVar, Union
1515

16-
import boto3
16+
import boto3 # type: ignore[import]
1717
import botocore # type: ignore[import]
1818
from packaging.version import (
1919
InvalidVersion,
@@ -243,7 +243,7 @@ def __lt__(self, other):
243243
return self.key < other.key
244244

245245

246-
def safe_parse_version(ver_str: str) -> LegacyVersion | Version:
246+
def safe_parse_version(ver_str: str) -> Union[LegacyVersion, Version]:
247247
try:
248248
return _parse_version(ver_str)
249249
except InvalidVersion:

0 commit comments

Comments
 (0)