Skip to content

Commit 444b6ce

Browse files
authored
Merge pull request #69 from techouse/chore/drop-python2
# 2.0.0 * [CHORE] drop support for Python 2.7, 3.5 and 3.6 * [CHORE] migrate pytest.ini configuration into pyproject.toml * [CHORE] migrate from setuptools to hatch / hatchling * [CHORE] add types * [CHORE] add types to tests * [CHORE] update dependencies * [CHORE] use f-strings where appropriate
2 parents 56e6f54 + b4c9f9f commit 444b6ce

25 files changed

+1016
-1087
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 & 17 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

@@ -36,18 +32,6 @@ In order to run the test suite run these commands using a Docker MySQL image.
3632

3733
**Requires a running Docker instance!**
3834

39-
- using Python 2.7
40-
```bash
41-
git clone https://github.com/techouse/sqlite3-to-mysql
42-
cd sqlite3-to-mysql
43-
virtualenv -p $(which python2) env
44-
source env/bin/activate
45-
pip install -e .
46-
pip install -r requirements_dev.txt
47-
tox
48-
```
49-
50-
- using Python 3.5+
5135
```bash
5236
git clone https://github.com/techouse/sqlite3-to-mysql
5337
cd sqlite3-to-mysql

MANIFEST.in

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

pyproject.toml

Lines changed: 54 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[build-system]
2-
requires = ["setuptools", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "sqlite3-to-mysql"
77
description = "A simple Python tool to transfer data from SQLite 3 to MySQL"
8+
readme = "README.md"
89
license = { text = "MIT" }
9-
requires-python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
10+
requires-python = ">=3.7"
1011
authors = [
1112
{ name = "Klemen Tusar", email = "techouse@gmail.com" },
1213
]
@@ -28,11 +29,7 @@ classifiers = [
2829
"License :: OSI Approved :: MIT License",
2930
"Operating System :: OS Independent",
3031
"Programming Language :: Python",
31-
"Programming Language :: Python :: 2",
32-
"Programming Language :: Python :: 2.7",
3332
"Programming Language :: Python :: 3",
34-
"Programming Language :: Python :: 3.5",
35-
"Programming Language :: Python :: 3.6",
3633
"Programming Language :: Python :: 3.7",
3734
"Programming Language :: Python :: 3.8",
3835
"Programming Language :: Python :: 3.9",
@@ -42,43 +39,37 @@ classifiers = [
4239
"Topic :: Database",
4340
]
4441
dependencies = [
45-
"Click>=7.0,<8.0.0 ; python_version<'3.6'",
46-
"Click>=7.0 ; python_version>='3.6'",
47-
"mysql-connector-python>=8.0.18,<8.0.24 ; python_version<'3.6'",
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'",
51-
"six>=1.12.0",
52-
"simplejson>=3.16.0",
53-
"tqdm>=4.35.0",
54-
"packaging>=20.3",
55-
"tabulate<0.8.6 ; python_version<'3.5'",
56-
"tabulate ; python_version>='3.5'",
57-
"Unidecode<=1.2.0 ; python_version<'3.5'",
58-
"Unidecode>=1.2.0 ; python_version>='3.5'",
59-
"backports-datetime-fromisoformat>=1.0.0 ; python_version>='3.4' and python_version<='3.6'",
42+
"Click>=8.1.3",
43+
"mysql-connector-python>=8.0.33",
44+
"pytimeparse2",
45+
"simplejson>=3.19.1",
46+
"tqdm>=4.65.0",
47+
"packaging>=23.1",
48+
"tabulate",
49+
"Unidecode>=1.3.6",
50+
"typing_extensions",
6051
]
61-
dynamic = ["version", "readme"]
52+
dynamic = ["version"]
6253

63-
[tool.setuptools.dynamic]
64-
version = { attr = "sqlite3_to_mysql.__version__" }
65-
readme = { file = "README.md", content-type = "text/markdown" }
54+
[tool.hatch.version]
55+
path = "sqlite3_to_mysql/__init__.py"
6656

67-
[tool.setuptools]
68-
packages = ["sqlite3_to_mysql"]
69-
include-package-data = true
70-
zip-safe = false
71-
license-files = ["LICENSE"]
72-
73-
[tool.distutils.bdist_wheel]
74-
universal = true
57+
[tool.hatch.build.targets.sdist]
58+
include = [
59+
"sqlite3_to_mysql",
60+
"tests",
61+
"README.md",
62+
"CODE-OF-CONDUCT.md",
63+
"LICENSE",
64+
"requirements_dev.txt",
65+
]
7566

7667
[project.scripts]
7768
sqlite3mysql = "sqlite3_to_mysql.cli:cli"
7869

7970
[tool.black]
8071
line-length = 120
81-
target-version = ["py35", "py36", "py37", "py38", "py39", "py310", "py311"]
72+
target-version = ["py37", "py38", "py39", "py310", "py311"]
8273
include = '\.pyi?$'
8374
exclude = '''
8475
(
@@ -104,3 +95,31 @@ profile = "black"
10495
lines_after_imports = 2
10596
known_first_party = "sqlite3_to_mysql"
10697
skip_gitignore = true
98+
99+
[tool.pytest.ini_options]
100+
testpaths = ["tests"]
101+
norecursedirs = [".*", "venv", "env", "*.egg", "dist", "build"]
102+
minversion = "7.3.1"
103+
addopts = "-rsxX -l --tb=short --strict-markers"
104+
timeout = 300
105+
markers = [
106+
"init: Run the initialisation test functions",
107+
"transfer: Run the main transfer test functions",
108+
"cli: Run the cli test functions",
109+
]
110+
111+
[tool.mypy]
112+
python_version = "3.7"
113+
exclude = [
114+
"tests",
115+
"build",
116+
"dist",
117+
"venv",
118+
"env",
119+
]
120+
warn_return_any = true
121+
warn_unused_configs = true
122+
123+
[[tool.mypy.overrides]]
124+
module = "pytimeparse2.*,factory.*,docker.*"
125+
ignore_missing_imports = true

pytest.ini

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

requirements_dev.txt

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
Click>=7.0,<8.0.0 ; python_version<"3.6"
2-
Click>=7.0 ; python_version>="3.6"
3-
docker>=4.0.2
1+
Click>=8.1.3
2+
docker>=6.1.3
43
factory-boy
5-
Faker>=4.1.0 ; python_version>="3.0"
6-
mysql-connector-python>=8.0.18,<8.0.24 ; python_version<"3.6"
7-
mysql-connector-python>=8.0.18,!=8.0.30,!=8.0.31 ; python_version>="3.6"
8-
PyMySQL>=0.9.3
9-
pytest>=4.6.5
4+
Faker>=18.10.0
5+
mysql-connector-python>=8.0.33
6+
PyMySQL>=1.0.3
7+
pytest>=7.3.1
108
pytest-cov
11-
pytest-faker ; python_version<"3.0"
129
pytest-mock
1310
pytest-timeout
14-
pytimeparse>=1.1.8 ; python_version<"3.6"
15-
pytimeparse2 ; python_version>="3.6"
16-
simplejson>=3.16.0
17-
six>=1.12.0
18-
sqlalchemy>=1.3.7,<1.4.0 ; python_version<"3.0"
19-
sqlalchemy<2.0.0 ; python_version>="3.0"
20-
sqlalchemy-utils==0.36.6 ; python_version<"3.0"
21-
sqlalchemy-utils>=0.36.6 ; python_version>="3.0"
11+
pytimeparse2
12+
simplejson>=3.19.1
13+
types-simplejson
14+
sqlalchemy>=2.0.0
15+
sqlalchemy-utils
16+
types-sqlalchemy-utils
2217
tox
23-
tqdm>=4.35.0
24-
packaging>=20.3
25-
tabulate<0.8.6 ; python_version<"3.5"
26-
tabulate ; python_version>="3.5"
27-
Unidecode<=1.2.0 ; python_version<"3.5"
28-
Unidecode>=1.2.0 ; python_version>="3.5"
29-
backports-datetime-fromisoformat>=1.0.0 ; python_version>="3.4" and python_version<="3.6"
18+
tqdm>=4.65.0
19+
types-tqdm
20+
packaging>=23.1
21+
tabulate
22+
types-tabulate
23+
Unidecode>=1.3.6
24+
typing_extensions
25+
types-Pygments
26+
types-colorama
27+
types-mock
28+
types-setuptools

0 commit comments

Comments
 (0)