Skip to content

Commit e9149f8

Browse files
authored
Merge pull request #286 from linkml/add-support-for-python3.12
Add support for Python 3.12
2 parents c9adcae + 80425ed commit e9149f8

File tree

6 files changed

+477
-495
lines changed

6 files changed

+477
-495
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: [ubuntu-latest, windows-latest]
15-
python-version: ["3.8", "3.9", "3.10"]
15+
python-version: ["3.8", "3.9", "3.10", "3.12"]
1616
exclude:
1717
- os: windows-latest
1818
python-version: "3.8"

linkml_runtime/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
# use importlib.metadata to read the version provided
77
# by the package during installation. Do not hardcode
88
# the version in the code
9-
try:
10-
import importlib.metadata as importlib_metadata
11-
except ModuleNotFoundError:
12-
import importlib_metadata
9+
import importlib.metadata as importlib_metadata
1310

1411
LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/')
1512
TCCM = CurieNamespace('tccm', 'https://ontologies.r.us/tccm/')

linkml_runtime/utils/metamodelcore.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ def is_valid(cls, value: Union[str, datetime.date, Literal]) -> bool:
278278
value = value.value
279279
if isinstance(value, datetime.date):
280280
value = value.isoformat()
281+
if not re.match(r'^\d{4}-\d{2}-\d{2}$', value):
282+
return False
281283
try:
282284
datetime.date.fromisoformat(str(value))
283285
except ValueError:

0 commit comments

Comments
 (0)