Skip to content

Commit 68b53ec

Browse files
committed
fix GitHub Actions run #8
1 parent 2525efd commit 68b53ec

10 files changed

Lines changed: 10 additions & 81 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ license-files = ["LICEN[CS]E.*"]
2222
requires-python = ">=3.10.0"
2323
dependencies = [
2424
"keyboard>=0.13.5",
25+
"mypy-extensions>=1.1.0",
2526
"prompt_toolkit>=3.0.41",
2627
"regex>=2023.10.3",
2728
]

src/xulbux/base/exceptions.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,7 @@
22
This module contains all custom exception classes used throughout the library.
33
"""
44

5-
try:
6-
from mypy_extensions import mypyc_attr # type: ignore[import]
7-
except ImportError:
8-
9-
def __mypyc_attr_decorator(cls):
10-
return cls
11-
12-
def mypyc_attr(*args, **kwargs): # type: ignore[misc]
13-
return __mypyc_attr_decorator
14-
5+
from mypy_extensions import mypyc_attr
156

167
#
178
################################################## FILE ##################################################

src/xulbux/base/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This module contains all custom type definitions used throughout the library.
33
"""
44

5-
from typing import TYPE_CHECKING, Annotated, TypeAlias, TypedDict, Optional, Protocol, Union, Any, overload
5+
from typing import TYPE_CHECKING, Annotated, TypeAlias, TypedDict, Optional, Protocol, Union, Any
66

77
# PREVENT CIRCULAR IMPORTS
88
if TYPE_CHECKING:

src/xulbux/console.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from prompt_toolkit.validation import ValidationError, Validator
1717
from prompt_toolkit.styles import Style
1818
from prompt_toolkit.keys import Keys
19+
from mypy_extensions import mypyc_attr
1920
from contextlib import contextmanager
2021
from io import StringIO
2122
import prompt_toolkit as _pt
@@ -28,16 +29,6 @@
2829
import sys as _sys
2930
import os as _os
3031

31-
try:
32-
from mypy_extensions import mypyc_attr # type: ignore[import]
33-
except ImportError:
34-
35-
def __mypyc_attr_decorator(cls):
36-
return cls
37-
38-
def mypyc_attr(*args, **kwargs): # type: ignore[misc]
39-
return __mypyc_attr_decorator
40-
4132

4233
T = TypeVar("T")
4334

src/xulbux/data.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,11 @@
1010
from .regex import Regex
1111

1212
from typing import Optional, Literal, Final, Any, cast
13+
from mypy_extensions import mypyc_attr
1314
import base64 as _base64
1415
import math as _math
1516
import re as _re
1617

17-
try:
18-
from mypy_extensions import mypyc_attr # type: ignore[import]
19-
except ImportError:
20-
21-
def __mypyc_attr_decorator(cls):
22-
return cls
23-
24-
def mypyc_attr(*args, **kwargs): # type: ignore[misc]
25-
return __mypyc_attr_decorator
26-
2718

2819
_DEFAULT_SYNTAX_HL: Final[dict[str, tuple[str, str]]] = {
2920
"str": ("[br:blue]", "[_c]"),

src/xulbux/format_codes.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,12 @@
162162
from .color import Color, rgba, hexa
163163

164164
from typing import Optional, Literal, Final, cast
165+
from mypy_extensions import mypyc_attr
165166
import ctypes as _ctypes
166167
import regex as _rx
167168
import sys as _sys
168169
import os as _os
169170

170-
try:
171-
from mypy_extensions import mypyc_attr # type: ignore[import]
172-
except ImportError:
173-
174-
def __mypyc_attr_decorator(cls):
175-
return cls
176-
177-
def mypyc_attr(*args, **kwargs): # type: ignore[misc]
178-
return __mypyc_attr_decorator
179-
180171

181172
_CONSOLE_ANSI_CONFIGURED: bool = False
182173
"""Whether the console was already configured to be able to interpret and render ANSI formatting."""

src/xulbux/json.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,9 @@
88
from .path import Path
99

1010
from typing import Literal, Any, cast
11+
from mypy_extensions import mypyc_attr
1112
import json as _json
1213

13-
try:
14-
from mypy_extensions import mypyc_attr # type: ignore[import]
15-
except ImportError:
16-
17-
def __mypyc_attr_decorator(cls):
18-
return cls
19-
20-
def mypyc_attr(*args, **kwargs): # type: ignore[misc]
21-
return __mypyc_attr_decorator
22-
2314

2415
@mypyc_attr(native_class=False)
2516
class Json:

src/xulbux/path.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,13 @@
55
from .base.exceptions import PathNotFoundError
66

77
from typing import Optional
8+
from mypy_extensions import mypyc_attr
89
import tempfile as _tempfile
910
import difflib as _difflib
1011
import shutil as _shutil
1112
import sys as _sys
1213
import os as _os
1314

14-
try:
15-
from mypy_extensions import mypyc_attr # type: ignore[import]
16-
except ImportError:
17-
18-
def __mypyc_attr_decorator(cls):
19-
return cls
20-
21-
def mypyc_attr(*args, **kwargs): # type: ignore[misc]
22-
return __mypyc_attr_decorator
23-
2415

2516
@mypyc_attr(native_class=False)
2617
class _PathMeta(type):

src/xulbux/regex.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,10 @@
44
"""
55

66
from typing import Optional
7+
from mypy_extensions import mypyc_attr
78
import regex as _rx
89
import re as _re
910

10-
try:
11-
from mypy_extensions import mypyc_attr # type: ignore[import]
12-
except ImportError:
13-
14-
def __mypyc_attr_decorator(cls):
15-
return cls
16-
17-
def mypyc_attr(*args, **kwargs): # type: ignore[misc]
18-
return __mypyc_attr_decorator
19-
2011

2112
class Regex:
2213
"""This class provides methods to dynamically generate complex regex patterns for common use cases."""

src/xulbux/system.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,14 @@
99
from .console import Console
1010

1111
from typing import Optional
12+
from mypy_extensions import mypyc_attr
1213
import subprocess as _subprocess
1314
import platform as _platform
1415
import ctypes as _ctypes
1516
import time as _time
1617
import sys as _sys
1718
import os as _os
1819

19-
try:
20-
from mypy_extensions import mypyc_attr # type: ignore[import]
21-
except ImportError:
22-
23-
def __mypyc_attr_decorator(cls):
24-
return cls
25-
26-
def mypyc_attr(*args, **kwargs): # type: ignore[misc]
27-
return __mypyc_attr_decorator
28-
2920

3021
@mypyc_attr(native_class=False)
3122
class _SystemMeta(type):

0 commit comments

Comments
 (0)