Skip to content

Commit e633770

Browse files
committed
🔖 release v2.4.5
# 2.4.5 * [FIX] fix importing `typing_extensions` on Python >= 3.11
1 parent 5d58b20 commit e633770

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
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.5
2+
3+
* [FIX] fix importing `typing_extensions` on Python >= 3.11
4+
15
# 2.4.4
26

37
* [FIX] fix pyproject.toml build sources and specify package inclusion for sdist and wheel

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12-alpine
1+
FROM python:3.13-alpine
22

33
LABEL maintainer="https://github.com/techouse"
44

src/mysql_to_sqlite3/__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 MySQL to SQLite 3."""
22

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

55
from .transporter import MySQLtoSQLite

src/mysql_to_sqlite3/transporter.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@
1212
from sys import stdout
1313

1414
import mysql.connector
15-
import typing_extensions as tx
1615
from mysql.connector import CharacterSet, errorcode
1716
from mysql.connector.abstracts import MySQLConnectionAbstract
1817
from mysql.connector.types import RowItemType
1918
from tqdm import tqdm, trange
2019

20+
21+
try:
22+
# Python 3.11+
23+
from typing import Unpack # type: ignore[attr-defined]
24+
except ImportError:
25+
# Python < 3.11
26+
from typing_extensions import Unpack # type: ignore
27+
2128
from mysql_to_sqlite3.mysql_utils import CHARSET_INTRODUCERS
2229
from mysql_to_sqlite3.sqlite_utils import (
2330
CollatingSequences,
@@ -38,7 +45,7 @@ class MySQLtoSQLite(MySQLtoSQLiteAttributes):
3845
COLUMN_PATTERN: t.Pattern[str] = re.compile(r"^[^(]+")
3946
COLUMN_LENGTH_PATTERN: t.Pattern[str] = re.compile(r"\(\d+\)$")
4047

41-
def __init__(self, **kwargs: tx.Unpack[MySQLtoSQLiteParams]) -> None:
48+
def __init__(self, **kwargs: Unpack[MySQLtoSQLiteParams]) -> None:
4249
"""Constructor."""
4350
if kwargs.get("mysql_database") is not None:
4451
self._mysql_database = str(kwargs.get("mysql_database"))

src/mysql_to_sqlite3/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.abstracts import MySQLConnectionAbstract
109
from mysql.connector.cursor import MySQLCursorDict, MySQLCursorPrepared, MySQLCursorRaw
1110

1211

13-
class MySQLtoSQLiteParams(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
18+
19+
20+
class MySQLtoSQLiteParams(TypedDict):
1421
"""MySQLtoSQLite parameters."""
1522

1623
buffered: t.Optional[bool]

0 commit comments

Comments
 (0)