Skip to content

Commit 85fd9cc

Browse files
committed
fix: resolve environment-dependent ty failure on python 3.10
1 parent b2b82cb commit 85fd9cc

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ dev = [
114114
"deptry>=0.25.1",
115115
# optional-extra backends installed in dev so their modules type-check
116116
"boto3",
117+
# installed unconditionally (runtime dep is <3.11 only) so ty resolves
118+
# the version-guarded import in custom_types.py on every python version
119+
"backports.strenum",
117120
# docs
118121
"zensical>=0.0.46",
119122
"mkdocstrings-python>=1.0.3",

src/osw/custom_types.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
from pydantic.v1.validators import path_validator # , path_exists_validator
77

88
if sys.version_info < (3, 11):
9-
# not installed in envs >=3.11, hence unresolvable for ty there
10-
from backports.strenum import StrEnum # ty: ignore[unresolved-import]
9+
from backports.strenum import StrEnum
1110
else:
1211
from enum import StrEnum # noqa: F401
1312

uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)