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+
15# 2.4.5
26
37* [ FIX] fix MySQL connection parameters to handle optional socket, host and port
Original file line number Diff line number Diff line change 11"""Utility to transfer data from SQLite 3 to MySQL."""
22
3- __version__ = "2.4.5 "
3+ __version__ = "2.4.6 "
44
55from .transporter import SQLite3toMySQL
Original file line number Diff line number Diff line change 1313from sys import stdout
1414
1515import mysql .connector
16- import typing_extensions as tx
1716from mysql .connector import CharacterSet
1817from mysql .connector import __version__ as mysql_connector_version_string
1918from mysql .connector import errorcode
2019from packaging import version
2120from tqdm import tqdm , trange
2221
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+
2330from sqlite3_to_mysql .sqlite_utils import (
2431 adapt_decimal ,
2532 adapt_timedelta ,
@@ -55,7 +62,7 @@ class SQLite3toMySQL(SQLite3toMySQLAttributes):
5562
5663 MYSQL_CONNECTOR_VERSION : version .Version = version .parse (mysql_connector_version_string )
5764
58- def __init__ (self , ** kwargs : tx . Unpack [SQLite3toMySQLParams ]):
65+ def __init__ (self , ** kwargs : Unpack [SQLite3toMySQLParams ]):
5966 """Constructor."""
6067 if kwargs .get ("sqlite_file" ) is None :
6168 raise ValueError ("Please provide an SQLite file" )
Original file line number Diff line number Diff line change 55from logging import Logger
66from sqlite3 import Connection , Cursor
77
8- import typing_extensions as tx
98from mysql .connector import MySQLConnection
109from mysql .connector .cursor import MySQLCursor
1110
1211
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 ):
1421 """SQLite3toMySQL parameters."""
1522
1623 sqlite_file : t .Union [str , "os.PathLike[t.Any]" ]
You can’t perform that action at this time.
0 commit comments