Skip to content

Commit 75f4330

Browse files
authored
Merge pull request #47 from techouse/release/v2.0.0
🔖 release v2.0.0
2 parents 6f40c6a + 216a365 commit 75f4330

24 files changed

+1135
-1102
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ jobs:
3333
strategy:
3434
matrix:
3535
include:
36-
- toxenv: "python2.7"
37-
db: "mariadb:5.5"
38-
legacy_db: 1
39-
experimental: false
40-
py: "2.7"
41-
4236
- toxenv: "python3.7"
4337
db: "mariadb:5.5"
4438
legacy_db: 1
@@ -69,12 +63,6 @@ jobs:
6963
experimental: false
7064
py: "3.11"
7165

72-
- toxenv: "python2.7"
73-
db: "mariadb:10.0"
74-
legacy_db: 1
75-
experimental: false
76-
py: "2.7"
77-
7866
- toxenv: "python3.7"
7967
db: "mariadb:10.0"
8068
legacy_db: 1
@@ -105,12 +93,6 @@ jobs:
10593
experimental: false
10694
py: "3.11"
10795

108-
- toxenv: "python2.7"
109-
db: "mariadb:10.1"
110-
legacy_db: 1
111-
experimental: false
112-
py: "2.7"
113-
11496
- toxenv: "python3.7"
11597
db: "mariadb:10.1"
11698
legacy_db: 1
@@ -141,12 +123,6 @@ jobs:
141123
experimental: false
142124
py: "3.11"
143125

144-
- toxenv: "python2.7"
145-
db: "mariadb:10.2"
146-
legacy_db: 0
147-
experimental: false
148-
py: "2.7"
149-
150126
- toxenv: "python3.7"
151127
db: "mariadb:10.2"
152128
legacy_db: 0
@@ -177,12 +153,6 @@ jobs:
177153
experimental: false
178154
py: "3.11"
179155

180-
- toxenv: "python2.7"
181-
db: "mariadb:10.3"
182-
legacy_db: 0
183-
experimental: false
184-
py: "2.7"
185-
186156
- toxenv: "python3.7"
187157
db: "mariadb:10.3"
188158
legacy_db: 0
@@ -213,12 +183,6 @@ jobs:
213183
experimental: false
214184
py: "3.11"
215185

216-
- toxenv: "python2.7"
217-
db: "mariadb:10.4"
218-
legacy_db: 0
219-
experimental: false
220-
py: "2.7"
221-
222186
- toxenv: "python3.7"
223187
db: "mariadb:10.4"
224188
legacy_db: 0
@@ -249,12 +213,6 @@ jobs:
249213
experimental: false
250214
py: "3.11"
251215

252-
- toxenv: "python2.7"
253-
db: "mariadb:10.5"
254-
legacy_db: 0
255-
experimental: false
256-
py: "2.7"
257-
258216
- toxenv: "python3.7"
259217
db: "mariadb:10.5"
260218
legacy_db: 0
@@ -285,12 +243,6 @@ jobs:
285243
experimental: false
286244
py: "3.11"
287245

288-
- toxenv: "python2.7"
289-
db: "mariadb:10.6"
290-
legacy_db: 0
291-
experimental: false
292-
py: "2.7"
293-
294246
- toxenv: "python3.7"
295247
db: "mariadb:10.6"
296248
legacy_db: 0
@@ -321,12 +273,6 @@ jobs:
321273
experimental: false
322274
py: "3.11"
323275

324-
- toxenv: "python2.7"
325-
db: "mariadb:10.11"
326-
legacy_db: 0
327-
experimental: false
328-
py: "2.7"
329-
330276
- toxenv: "python3.7"
331277
db: "mariadb:10.11"
332278
legacy_db: 0
@@ -357,12 +303,6 @@ jobs:
357303
experimental: false
358304
py: "3.11"
359305

360-
- toxenv: "python2.7"
361-
db: "mysql:5.5"
362-
legacy_db: 1
363-
experimental: false
364-
py: "2.7"
365-
366306
- toxenv: "python3.7"
367307
db: "mysql:5.5"
368308
legacy_db: 1
@@ -393,12 +333,6 @@ jobs:
393333
experimental: false
394334
py: "3.11"
395335

396-
- toxenv: "python2.7"
397-
db: "mysql:5.6"
398-
legacy_db: 1
399-
experimental: false
400-
py: "2.7"
401-
402336
- toxenv: "python3.7"
403337
db: "mysql:5.6"
404338
legacy_db: 1
@@ -429,12 +363,6 @@ jobs:
429363
experimental: false
430364
py: "3.11"
431365

432-
- toxenv: "python2.7"
433-
db: "mysql:5.7"
434-
legacy_db: 0
435-
experimental: false
436-
py: "2.7"
437-
438366
- toxenv: "python3.7"
439367
db: "mysql:5.7"
440368
legacy_db: 0
@@ -465,12 +393,6 @@ jobs:
465393
experimental: false
466394
py: "3.11"
467395

468-
- toxenv: "python2.7"
469-
db: "mysql:8.0"
470-
legacy_db: 0
471-
experimental: false
472-
py: "2.7"
473-
474396
- toxenv: "python3.7"
475397
db: "mysql:8.0"
476398
legacy_db: 0

CONTRIBUTING.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ interactions related to the project.
1313

1414
Ensuring backward compatibility is an imperative requirement.
1515

16-
Currently, the tool supports Python versions 2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10 and 3.11.
17-
18-
Despite the fact that Python 2.7 has indeed reached the conclusion of its lifecycle in early 2020, a considerable number
19-
of individuals still rely heavily upon it. Consequently, it is incumbent upon us to maintain our support for this
20-
version until such time as the fundamental tools unequivocally discontinue their backing for it.
16+
Currently, the tool supports Python versions 3.7, 3.8, 3.9, 3.10 and 3.11.
2117

2218
## MySQL version support
2319

MANIFEST.in

Lines changed: 0 additions & 4 deletions
This file was deleted.

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.18"
2+
__version__ = "2.0.0"
33

44
from .transporter import MySQLtoSQLite

mysql_to_sqlite3/cli.py

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""The command line interface of MySQLtoSQLite."""
2+
import os
23
import sys
4+
import typing as t
35

46
import click
57
from tabulate import tabulate
@@ -115,29 +117,29 @@
115117
@click.option("--debug", is_flag=True, help="Debug mode. Will throw exceptions.")
116118
@click.version_option(message=tabulate(info(), headers=["software", "version"], tablefmt="github"))
117119
def cli(
118-
sqlite_file,
119-
mysql_user,
120-
prompt_mysql_password,
121-
mysql_password,
122-
mysql_database,
123-
mysql_tables,
124-
exclude_mysql_tables,
125-
limit_rows,
126-
collation,
127-
prefix_indices,
128-
without_foreign_keys,
129-
without_data,
130-
mysql_host,
131-
mysql_port,
132-
skip_ssl,
133-
chunk,
134-
log_file,
135-
json_as_text,
136-
vacuum,
137-
use_buffered_cursors,
138-
quiet,
139-
debug,
140-
):
120+
sqlite_file: t.Union[str, "os.PathLike[t.Any]"],
121+
mysql_user: str,
122+
prompt_mysql_password: bool,
123+
mysql_password: str,
124+
mysql_database: str,
125+
mysql_tables: t.Optional[t.Sequence[str]],
126+
exclude_mysql_tables: t.Optional[t.Sequence[str]],
127+
limit_rows: int,
128+
collation: t.Optional[str],
129+
prefix_indices: bool,
130+
without_foreign_keys: bool,
131+
without_data: bool,
132+
mysql_host: str,
133+
mysql_port: int,
134+
skip_ssl: bool,
135+
chunk: int,
136+
log_file: t.Union[str, "os.PathLike[t.Any]"],
137+
json_as_text: bool,
138+
vacuum: bool,
139+
use_buffered_cursors: bool,
140+
quiet: bool,
141+
debug: bool,
142+
) -> None:
141143
"""Transfer MySQL to SQLite using the provided CLI options."""
142144
try:
143145
if mysql_tables and exclude_mysql_tables:

mysql_to_sqlite3/click_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Click utilities."""
22

3+
import typing as t
4+
35
import click
46

57

@@ -11,12 +13,12 @@ def __init__(self, *args, **kwargs):
1113
self.save_other_options = kwargs.pop("save_other_options", True)
1214
nargs = kwargs.pop("nargs", -1)
1315
if nargs != -1:
14-
raise ValueError("nargs, if set, must be -1 not {}".format(nargs))
16+
raise ValueError(f"nargs, if set, must be -1 not {nargs}")
1517
super(OptionEatAll, self).__init__(*args, **kwargs)
1618
self._previous_parser_process = None
1719
self._eat_all_parser = None
1820

19-
def add_to_parser(self, parser, ctx):
21+
def add_to_parser(self, parser, ctx) -> None:
2022
"""Override."""
2123

2224
def parser_process(value, state):
@@ -52,7 +54,7 @@ def parser_process(value, state):
5254
return retval
5355

5456

55-
def prompt_password(ctx, param, use_password): # pylint: disable=W0613
57+
def prompt_password(ctx: click.core.Context, param: t.Any, use_password: bool): # pylint: disable=W0613
5658
"""Prompt for password."""
5759
if use_password:
5860
mysql_password = ctx.params.get("mysql_password")
@@ -62,7 +64,7 @@ def prompt_password(ctx, param, use_password): # pylint: disable=W0613
6264
return mysql_password
6365

6466

65-
def validate_positive_integer(ctx, param, value): # pylint: disable=W0613
67+
def validate_positive_integer(ctx: click.core.Context, param: t.Any, value: int): # pylint: disable=W0613
6668
"""Allow only positive integers and 0."""
6769
if value < 0:
6870
raise click.BadParameter("Should be a positive integer or 0.")

0 commit comments

Comments
 (0)