Skip to content

Commit 6f40c6a

Browse files
authored
🔖 release v1.4.18 (#46)
1 parent 0c50948 commit 6f40c6a

File tree

7 files changed

+31
-12
lines changed

7 files changed

+31
-12
lines changed

mysql_to_sqlite3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Utility to transfer data from MySQL to SQLite 3."""
2-
__version__ = "1.4.17"
2+
__version__ = "1.4.18"
33

44
from .transporter import MySQLtoSQLite

mysql_to_sqlite3/debug_info.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import click
1515
import mysql.connector
16-
import pytimeparse
1716
import simplejson
1817
import six
1918
import slugify
@@ -23,6 +22,12 @@
2322
from . import __version__ as package_version
2423

2524

25+
if six.PY2 or (sys.version_info.major == 3 and 4 <= sys.version_info.minor <= 6):
26+
import pytimeparse # pylint: disable=E0401
27+
else:
28+
import pytimeparse2 as pytimeparse
29+
30+
2631
def _implementation():
2732
"""Return a dict with the Python implementation and version.
2833

mysql_to_sqlite3/sqlite_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
from sys import version_info
99

1010
import six
11-
from pytimeparse.timeparse import timeparse
1211

1312

13+
if six.PY2 or (version_info.major == 3 and 4 <= version_info.minor <= 6):
14+
from pytimeparse.timeparse import timeparse # pylint: disable=E0401
15+
else:
16+
from pytimeparse2 import parse as timeparse
17+
1418
if version_info.major == 3 and 4 <= version_info.minor <= 6:
1519
from backports.datetime_fromisoformat import MonkeyPatch # pylint: disable=E0401
1620

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ dependencies = [
4545
"Click>=7.0,<8.0.0 ; python_version<'3.6'",
4646
"Click>=7.0 ; python_version>='3.6'",
4747
"mysql-connector-python>=8.0.18,<8.0.24 ; python_version<'3.6'",
48-
"mysql-connector-python>=8.0.18,<8.0.30 ; python_version>='3.6'",
49-
"pytimeparse>=1.1.8",
48+
"mysql-connector-python>=8.0.18,!=8.0.30,!=8.0.31 ; python_version>='3.6'",
49+
"pytimeparse>=1.1.8; python_version<'3.6'",
50+
"pytimeparse2; python_version>='3.6'",
5051
"python-slugify>=3.0.3,<5.0.0 ; python_version<'3.6'",
51-
"python-slugify>=3.0.3,<6.0.0 ; python_version>='3.6'",
52+
"python-slugify>=5.0.0,<7.0.0 ; python_version>='3.6' and python_version<'3.7'",
53+
"python-slugify>=7.0.0 ; python_version>='3.7'",
5254
"simplejson>=3.16.0",
5355
"six>=1.12.0",
5456
"tqdm>=4.35.0",

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
testpaths = tests
33
norecursedirs = .* venv env *.egg dist build
44
minversion = 4.6.5
5-
addopts = -rsxX -l --tb=short --strict
5+
addopts = -rsxX -l --tb=short --strict-markers
66
timeout = 300
77
markers =
88
init: Run the initialisation test functions

requirements_dev.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@ docker>=4.0.2
44
factory-boy
55
Faker>=4.1.0 ; python_version>="3.0"
66
mysql-connector-python>=8.0.18,<8.0.24 ; python_version<"3.6"
7-
mysql-connector-python>=8.0.18,<8.0.30 ; python_version>="3.6"
7+
mysql-connector-python>=8.0.18,!=8.0.30,!=8.0.31 ; python_version>="3.6"
88
mysqlclient>=1.4.6
99
pytest>=4.6.5
1010
pytest-cov
1111
pytest-faker ; python_version<"3.0"
1212
pytest-mock
1313
pytest-timeout
14-
pytimeparse>=1.1.8
14+
pytimeparse>=1.1.8 ; python_version<"3.6"
15+
pytimeparse2 ; python_version>="3.6"
1516
python-slugify>=3.0.3,<5.0.0 ; python_version<"3.6"
16-
python-slugify>=3.0.3,<6.0.0 ; python_version>="3.6"
17+
python-slugify>=5.0.0,<7.0.0 ; python_version>="3.6" and python_version<"3.7"
18+
python-slugify>=7.0.0 ; python_version>="3.7"
1719
simplejson>=3.16.0
1820
six>=1.12.0
1921
sqlalchemy>=1.3.7,<1.4.0 ; python_version<"3.0"
20-
sqlalchemy>=1.3.7,<=1.4.44 ; python_version>="3.0"
22+
sqlalchemy<2.0.0 ; python_version>="3.0"
2123
sqlalchemy-utils==0.36.6 ; python_version<"3.0"
22-
sqlalchemy-utils>=0.36.6,<0.40.0 ; python_version>="3.0"
24+
sqlalchemy-utils>=0.36.6 ; python_version>="3.0"
2325
tox
2426
tqdm>=4.35.0
2527
packaging>=20.3

tests/func/mysql_to_sqlite3_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ def test_transfer_transfers_all_tables_from_mysql_to_sqlite(
441441
for table_name in sqlite_tables:
442442
for sqlite_index in sqlite_inspect.get_indexes(table_name):
443443
sqlite_index["unique"] = bool(sqlite_index["unique"])
444+
if "dialect_options" in sqlite_index:
445+
sqlite_index.pop("dialect_options", None)
444446
assert sqlite_index in mysql_indices
445447

446448
""" Test if all the tables have the same foreign keys """
@@ -929,6 +931,8 @@ def test_transfer_specific_tables_transfers_only_specified_tables_from_mysql_to_
929931
for table_name in sqlite_tables:
930932
for sqlite_index in sqlite_inspect.get_indexes(table_name):
931933
sqlite_index["unique"] = bool(sqlite_index["unique"])
934+
if "dialect_options" in sqlite_index:
935+
sqlite_index.pop("dialect_options", None)
932936
assert sqlite_index in mysql_indices
933937

934938
""" Check if all the data was transferred correctly """
@@ -1195,6 +1199,8 @@ def test_transfer_limited_rows_from_mysql_to_sqlite(
11951199
for table_name in sqlite_tables:
11961200
for sqlite_index in sqlite_inspect.get_indexes(table_name):
11971201
sqlite_index["unique"] = bool(sqlite_index["unique"])
1202+
if "dialect_options" in sqlite_index:
1203+
sqlite_index.pop("dialect_options", None)
11981204
assert sqlite_index in mysql_indices
11991205

12001206
""" Test if all the tables have the same foreign keys """

0 commit comments

Comments
 (0)