File tree Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change
1
+ # 2.4.6
2
+
3
+ * [ FIX] fix importing ` typing_extensions ` on Python >= 3.11
4
+
1
5
# 2.4.5
2
6
3
7
* [ FIX] fix MySQL connection parameters to handle optional socket, host and port
Original file line number Diff line number Diff line change 1
1
"""Utility to transfer data from SQLite 3 to MySQL."""
2
2
3
- __version__ = "2.4.5 "
3
+ __version__ = "2.4.6 "
4
4
5
5
from .transporter import SQLite3toMySQL
Original file line number Diff line number Diff line change 13
13
from sys import stdout
14
14
15
15
import mysql .connector
16
- import typing_extensions as tx
17
16
from mysql .connector import CharacterSet
18
17
from mysql .connector import __version__ as mysql_connector_version_string
19
18
from mysql .connector import errorcode
20
19
from packaging import version
21
20
from tqdm import tqdm , trange
22
21
22
+
23
+ try :
24
+ # Python 3.11+
25
+ from typing import Unpack # type: ignore[attr-defined]
26
+ except ImportError :
27
+ # Python < 3.11
28
+ from typing_extensions import Unpack # type: ignore
29
+
23
30
from sqlite3_to_mysql .sqlite_utils import (
24
31
adapt_decimal ,
25
32
adapt_timedelta ,
@@ -55,7 +62,7 @@ class SQLite3toMySQL(SQLite3toMySQLAttributes):
55
62
56
63
MYSQL_CONNECTOR_VERSION : version .Version = version .parse (mysql_connector_version_string )
57
64
58
- def __init__ (self , ** kwargs : tx . Unpack [SQLite3toMySQLParams ]):
65
+ def __init__ (self , ** kwargs : Unpack [SQLite3toMySQLParams ]):
59
66
"""Constructor."""
60
67
if kwargs .get ("sqlite_file" ) is None :
61
68
raise ValueError ("Please provide an SQLite file" )
Original file line number Diff line number Diff line change 5
5
from logging import Logger
6
6
from sqlite3 import Connection , Cursor
7
7
8
- import typing_extensions as tx
9
8
from mysql .connector import MySQLConnection
10
9
from mysql .connector .cursor import MySQLCursor
11
10
12
11
13
- class SQLite3toMySQLParams (tx .TypedDict ):
12
+ try :
13
+ # Python 3.11+
14
+ from typing import TypedDict # type: ignore[attr-defined]
15
+ except ImportError :
16
+ # Python < 3.11
17
+ from typing_extensions import TypedDict # type: ignore
18
+
19
+
20
+ class SQLite3toMySQLParams (TypedDict ):
14
21
"""SQLite3toMySQL parameters."""
15
22
16
23
sqlite_file : t .Union [str , "os.PathLike[t.Any]" ]
You can’t perform that action at this time.
0 commit comments