Skip to content

Commit 3668838

Browse files
committed
Use typing_extensions to support <3.11
1 parent 5759b7b commit 3668838

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

python/afdko/otfautohint/glyphData.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
from math import sqrt
1212
from collections import defaultdict
1313
from builtins import tuple as _tuple
14-
from typing import Any, List, Optional, Tuple, Union, Self
14+
from typing import Any, List, Optional, Tuple, Union
15+
from typing_extensions import Self
1516
from fontTools.config import Option
1617

1718
# pytype: disable=import-error

python/afdko/otfautohint/hinter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
TypeVar,
2424
Union,
2525
Optional,
26-
Self,
2726
)
27+
from typing_extensions import Self
2828

2929
from fontTools.misc.bezierTools import solveCubic
3030

python/afdko/otfautohint/hintstate.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,19 @@
1313
from . import Number
1414
from .glyphData import feq, pathElement, stem
1515
from _weakref import ReferenceType
16-
from typing import Any, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Type, Self, Protocol
17-
16+
from typing import (
17+
Any,
18+
Dict,
19+
Iterable,
20+
List,
21+
Optional,
22+
Sequence,
23+
Set,
24+
Tuple,
25+
Type,
26+
Protocol,
27+
)
28+
from typing_extensions import Self
1829

1930
log: logging.Logger = logging.getLogger(__name__)
2031

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ psautohint==2.4.0
1111
tqdm==4.66.1
1212
ufonormalizer==0.6.1
1313
ufoProcessor==1.9.0
14+
typing-extensions==4.8.0

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ def main():
200200
'setuptools_scm',
201201
'scikit-build',
202202
'cmake',
203-
'ninja'
203+
'ninja',
204+
'typing_extensions'
204205
],
205206
tests_require=[
206207
'pytest',

0 commit comments

Comments
 (0)