8000 Drop support of EOL Python and DB versions (#1030) · githubhuiyuan/PyMySQL@062384c · GitHub
[go: up one dir, main page]

Skip to content

Commit 062384c

Browse files
authored
Drop support of EOL Python and DB versions (PyMySQL#1030)
- Python now requires 3.7+, reflected in python_requires - MySQL now requires 5.7+ in tests - MariaDB unchanged in tests, only dropped support in documentation - Added Python 3.11 to test matrix - Added MariaDB 10.7 to test matrix - DB version checks have been removed from various tests where no longer needed this also results in running a few tests on MariaDB which were previously only running on MySQL.
1 parent cebba92 commit 062384c

File tree

9 files changed

+34
-36
lines changed

9 files changed

+34
-36
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ jobs:
2424
- db: "mariadb:10.5"
2525
py: "3.7"
2626

27-
- db: "mysql:5.6"
28-
py: "3.6"
27+
- db: "mariadb:10.7"
28+
py: "3.11-dev"
2929

3030
- db: "mysql:5.7"
31-
py: "pypy-3.6"
31+
py: "pypy-3.8"
3232

3333
- db: "mysql:8.0"
3434
py: "3.9"
3535
mysql_auth: true
3636

3737
- db: "mysql:8.0"
38-
py: "3.10-dev"
38+
py: "3.10"
3939

4040
services:
4141
mysql:

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changes
22

3+
## v1.0.3
4+
5+
Release date: TBD
6+
7+
* Dropped support of end of life MySQL version 5.6
8+
* Dropped support of end of life MariaDB versions below 10.2
9< 8000 code class="diff-text syntax-highlighted-line addition">+
* Dropped support of end of life Python version 3.6
10+
11+
312
## v1.0.2
413

514
Release date: 2021-01-09

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ Requirements
2525

2626
* Python -- one of the following:
2727

28-
- CPython_ : 3.6 and newer
28+
- CPython_ : 3.7 and newer
2929
- PyPy_ : Latest 3.x version
3030

3131
* MySQL Server -- one of the following:
3232

33-
- MySQL_ >= 5.6
34-
- MariaDB_ >= 10.0
33+
- MySQL_ >= 5.7
34+
- MariaDB_ >= 10.2
3535

3636
.. _CPython: https://www.python.org/
3737
.. _PyPy: https://pypy.org/

docs/source/user/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ Requirements
1818

1919
* Python -- one of the following:
2020

21-
- CPython_ >= 3.6
21+
- CPython_ >= 3.7
2222
- Latest PyPy_ 3
2323

2424
* MySQL Server -- one of the following:
2525

26-
- MySQL_ >= 5.6
27-
- MariaDB_ >= 10.0
26+
- MySQL_ >= 5.7
27+
- MariaDB_ >= 10.2
2828

2929
.. _CPython: http://www.python.org/
3030
.. _PyPy: http://pypy.org/

pymysql/tests/base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ def mysql_server_is(self, conn, version_tuple):
3232
"""Return True if the given connection is on the version given or
3333
greater.
3434
35+
This only checks the server version string provided when the
36+
connection is established, therefore any check for a version tuple
37+
greater than (5, 5, 5) will always fail on MariaDB, as it always
38+
starts with 5.5.5, e.g. 5.5.5-10.7.1-MariaDB-1:10.7.1+maria~focal.
39+
3540
e.g.::
3641
3742
if self.mysql_server_is(conn, (5, 6, 4)):

pymysql/tests/test_basic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ def test_datetime_microseconds(self):
175175
"""test datetime conversion w microseconds"""
176176

177177
conn = self.connect()
178-
if not self.mysql_server_is(conn, (5, 6, 4)):
179-
pytest.skip("target backend does not support microseconds")
180178
c = conn.cursor()
181179
dt = datetime.datetime(2013, 11, 12, 9, 9, 9, 123450)
182180
c.execute("create table test_datetime (id int, ts datetime(6))")
@@ -285,8 +283,10 @@ def test_json(self):
285283
args = self.databases[0].copy()
286284
args["charset"] = "utf8mb4"
287285
conn = pymysql.connect(**args)
286+
# MariaDB only has limited JSON support, stores data as longtext
287+
# https://mariadb.com/kb/en/json-data-type/
288288
if not self.mysql_server_is(conn, (5, 7, 0)):
289-
pytest.skip("JSON type is not supported on MySQL <= 5.6")
289+
pytest.skip("JSON type is only supported on MySQL >= 5.7")
290290

291291
self.safe_create_table(
292292
conn,

pymysql/tests/test_connection.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ class TestAuthentication(base.PyMySQLTestCase):
105105

106106
def test_plugin(self):
107107
conn = self.connect()
108-
if not self.mysql_server_is(conn, (5, 5, 0)):
109-
pytest.skip("MySQL-5.5 required for plugins")
110108
cur = conn.cursor()
111109
cur.execute(
112110
"select plugin from mysql.user where concat(user, '@', host)=current_user()"
@@ -401,13 +399,7 @@ def testAuthSHA256(self):
401399
self.databases[0]["database"],
402400
"sha256_password",
403401
) as u:
404-
if self.mysql_server_is(conn, (5, 7, 0)):
405-
c.execute("SET PASSWORD FOR 'pymysql_sha256'@'localhost' ='Sh@256Pa33'")
406-
else:
407-
c.execute("SET old_passwords = 2")
408-
c.execute(
409-
"SET PASSWORD FOR 'pymysql_sha256'@'localhost' = PASSWORD('Sh@256Pa33')"
410-
)
402+
c.execute("SET PASSWORD FOR 'pymysql_sha256'@'localhost' ='Sh@256Pa33'")
411403
c.execute("FLUSH PRIVILEGES")
412404
db = self.db.copy()
413405
db["password"] = "Sh@256Pa33"

pymysql/tests/test_issues.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -466,29 +466,20 @@ def test_issue_363(self):
466466
)
467467

468468
cur = conn.cursor()
469-
# From MySQL 5.7, ST_GeomFromText is added and GeomFromText is deprecated.
470-
if self.mysql_server_is(conn, (5, 7, 0)):
471-
geom_from_text = "ST_GeomFromText"
472-
geom_as_text = "ST_AsTe 10000 xt"
473-
geom_as_bin = "ST_AsBinary"
474-
else:
475-
geom_from_text = "GeomFromText"
476-
geom_as_text = "AsText"
477-
geom_as_bin = "AsBinary"
478469
query = (
479470
"INSERT INTO issue363 (id, geom) VALUES"
480-
"(1998, %s('LINESTRING(1.1 1.1,2.2 2.2)'))" % geom_from_text
471+
"(1998, ST_GeomFromText('LINESTRING(1.1 1.1,2.2 2.2)'))"
481472
)
482473
cur.execute(query)
483474

484475
# select WKT
485-
query = "SELECT %s(geom) FROM issue363" % geom_as_text
476+
query = "SELECT ST_AsText(geom) FROM issue363"
486477
cur.execute(query)
487478
row = cur.fetchone()
488479
self.assertEqual(row, ("LINESTRING(1.1 1.1,2.2 2.2)",))
489480

490481
# select WKB
491-
query = "SELECT %s(geom) FROM issue363" % geom_as_bin
482+
query = "SELECT ST_AsBinary(geom) FROM issue363"
492483
cur.execute(query)
493484
row = cur.fetchone()
494485
self.assertEqual(

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@
1616
description="Pure Python MySQL Driver",
1717
long_description=readme,
1818
packages=find_packages(exclude=["tests*", "pymysql.tests*"]),
19-
python_requires=">=3.6",
19+
python_requires=">=3.7",
2020
extras_require={
2121
"rsa": ["cryptography"],
2222
"ed25519": ["PyNaCl>=1.4.0"],
2323
},
2424
classifiers=[
2525
"Development Status :: 5 - Production/Stable",
2626
"Programming Language :: Python :: 3",
27-
"Programming Language :: Python :: 3.6",
2827
"Programming Language :: Python :: 3.7",
2928
"Programming Language :: Python :: 3.8",
3029
"Programming Language :: Python :: 3.9",
30+
"Programming Language :: Python :: 3.10",
31+
"Programming Language :: Python :: 3.11",
3132
"Programming Language :: Python :: Implementation :: CPython",
3233
"Programming Language :: Python :: Implementation :: PyPy",
3334
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)
0