-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathutil.py
More file actions
35 lines (28 loc) · 762 Bytes
/
util.py
File metadata and controls
35 lines (28 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
_has_gi = None
skip_reason_no_gi = 'glib tests require python3-gi'
def check_gi_repository():
global _has_gi
if _has_gi is not None:
return _has_gi
try:
from gi.repository import GLib
_has_gi = True
return _has_gi
except ImportError:
_has_gi = False
return _has_gi
_has_annotated = False
import typing
if hasattr(typing, "Annotated"):
from typing import Annotated
_has_annotated = True
else:
try:
from typing_extensions import Annotated
_has_annotated = True
except ImportError:
pass
skip_reason_no_typing_annotated = 'Annotated tests require python 3.9 or typing-extensions'
def check_annotated():
global _has_annotated
return _has_annotated