Skip to content

Commit 39f8622

Browse files
committed
🔖 release v2.4.6
# 2.4.6 * [FIX] fix importing `typing_extensions` on Python >= 3.11
1 parent 1d3e31e commit 39f8622

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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

src/sqlite3_to_mysql/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Utility to transfer data from SQLite 3 to MySQL."""
22

3-
__version__ = "2.4.5"
3+
__version__ = "2.4.6"
44

55
from .transporter import SQLite3toMySQL

src/sqlite3_to_mysql/transporter.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@
1313
from sys import stdout
1414

1515
import mysql.connector
16-
import typing_extensions as tx
1716
from mysql.connector import CharacterSet
1817
from mysql.connector import __version__ as mysql_connector_version_string
1918
from mysql.connector import errorcode
2019
from packaging import version
2120
from 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+
2330
from 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")

src/sqlite3_to_mysql/types.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@
55
from logging import Logger
66
from sqlite3 import Connection, Cursor
77

8-
import typing_extensions as tx
98
from mysql.connector import MySQLConnection
109
from 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]"]

0 commit comments

Comments
 (0)