Skip to content

Commit 3e493aa

Browse files
committed
Improving backward compatibility & docs
1 parent 0f30549 commit 3e493aa

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ install_requires =
6868
asyncio
6969
tqdm
7070
pybars3-wheel
71+
backports.strenum; python_version<"3.11"
7172

7273
[options.packages.find]
7374
where = src

src/osw/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class FetchSchemaParam(BaseModel):
341341
"""uses legacy command line for code generation if true"""
342342

343343
def fetch_schema(self, fetchSchemaParam: FetchSchemaParam = None) -> None:
344-
"""Loads the given schemas from the OSW instance and autogenerates python
344+
"""Loads the given schemas from the OSW instance and auto-generates python
345345
datasclasses within osw.model.entity from it
346346
347347
Parameters

src/osw/custom_types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
NoneType = type(None)
99
else:
1010
from types import NoneType # noqa: F401
11+
if sys.version_info < (3, 11):
12+
from backports.strenum import StrEnum # noqa: F401
13+
else:
14+
from enum import StrEnum # noqa: F401
1115

1216

1317
class PossibleFilePath(PydanticFilePath):

src/osw/model/static.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ def custom_isinstance(obj: Union[type, T], class_name: str) -> bool:
8585
class OswBaseModel(BaseModel):
8686

8787
class Config:
88+
"""Configuration for the OswBaseModel"""
89+
8890
# strict = False
89-
# Additional fields are allowed
91+
# extra = "ignore"
92+
# Additional fields are ignored
9093
validate_assignment = True
9194
# Ensures that the assignment of a value to a field is validated
9295

0 commit comments

Comments
 (0)