Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Drop support of EOL Python and DB versions #1030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ jobs:
- db: "mariadb:10.5"
py: "3.7"

- db: "mysql:5.6"
py: "3.6"
- db: "mariadb:10.7"
py: "3.11-dev"

- db: "mysql:5.7"
py: "pypy-3.6"
py: "pypy-3.8"

- db: "mysql:8.0"
py: "3.9"
mysql_auth: true

- db: "mysql:8.0"
py: "3.10-dev"
py: "3.10"

services:
mysql:
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changes

## v1.0.3

Release date: TBD

* Dropped support of end of life MySQL version 5.6
* Dropped support of end of life MariaDB versions below 10.2
* Dropped support of end of life Python version 3.6


## v1.0.2

Release date: 2021-01-09
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Requirements

* Python -- one of the following:

- CPython_ : 3.6 and newer
- CPython_ : 3.7 and newer
- PyPy_ : Latest 3.x version

* MySQL Server -- one of the following:

- MySQL_ >= 5.6
- MariaDB_ >= 10.0
- MySQL_ >= 5.7
- MariaDB_ >= 10.2

.. _CPython: https://www.python.org/
.. _PyPy: https://pypy.org/
Expand Down
6 changes: 3 additions & 3 deletions docs/source/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Requirements

* Python -- one of the following:

- CPython_ >= 3.6
- CPython_ >= 3.7
- Latest PyPy_ 3

* MySQL Server -- one of the following:

- MySQL_ >= 5.6
- MariaDB_ >= 10.0
- MySQL_ >= 5.7
- MariaDB_ >= 10.2

.. _CPython: http://www.python.org/
.. _PyPy: http://pypy.org/
Expand Down
5 changes: 5 additions & 0 deletions pymysql/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def mysql_server_is(self, conn, version_tuple):
"""Return True if the given connection is on the version given or
greater.

This only checks the server version string provided when the
connection is established, therefore any check for a version tuple
greater than (5, 5, 5) will always fail on MariaDB, as it always
starts with 5.5.5, e.g. 5.5.5-10.7.1-MariaDB-1:10.7.1+maria~focal.

e.g.::

if self.mysql_server_is(conn, (5, 6, 4)):
Expand Down
6 changes: 3 additions & 3 deletions pymysql/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ def test_datetime_microseconds(self):
"""test datetime conversion w microseconds"""

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

self.safe_create_table(
conn,
Expand Down
10 changes: 1 addition & 9 deletions pymysql/tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ class TestAuthentication(base.PyMySQLTestCase):

def test_plugin(self):
conn = self.connect()
if not self.mysql_server_is(conn, (5, 5, 0)):
pytest.skip("MySQL-5.5 required for plugins")
cur = conn.cursor()
cur.execute(
"select plugin from mysql.user where concat(user, '@', host)=current_user()"
Expand Down Expand Up @@ -401,13 +399,7 @@ def testAuthSHA256(self):
self.databases[0]["database"],
"sha256_password",
) as u:
if self.mysql_server_is(conn, (5, 7, 0)):
c.execute("SET PASSWORD FOR 'pymysql_sha256'@'localhost' ='Sh@256Pa33'")
else:
c.execute("SET old_passwords = 2")
c.execute(
"SET PASSWORD FOR 'pymysql_sha256'@'localhost' = PASSWORD('Sh@256Pa33')"
)
c.execute("SET PASSWORD FOR 'pymysql_sha256'@'localhost' ='Sh@256Pa33'")
c.execute("FLUSH PRIVILEGES")
db = self.db.copy()
db["password"] = "Sh@256Pa33"
Expand Down
15 changes: 3 additions & 12 deletions pymysql/tests/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,29 +466,20 @@ def test_issue_363(self):
)

cur = conn.cursor()
# From MySQL 5.7, ST_GeomFromText is added and GeomFromText is deprecated.
if self.mysql_server_is(conn, (5, 7, 0)):
geom_from_text = "ST_GeomFromText"
geom_as_text = "ST_AsText"
geom_as_bin = "ST_AsBinary"
else:
geom_from_text = "GeomFromText"
geom_as_text = "AsText"
geom_as_bin = "AsBinary"
query = (
"INSERT INTO issue363 (id, geom) VALUES"
"(1998, %s('LINESTRING(1.1 1.1,2.2 2.2)'))" % geom_from_text
"(1998, ST_GeomFromText('LINESTRING(1.1 1.1,2.2 2.2)'))"
)
cur.execute(query)

# select WKT
query = "SELECT %s(geom) FROM issue363" % geom_as_text
query = "SELECT ST_AsText(geom) FROM issue363"
cur.execute(query)
row = cur.fetchone()
self.assertEqual(row, ("LINESTRING(1.1 1.1,2.2 2.2)",))

# select WKB
query = "SELECT %s(geom) FROM issue363" % geom_as_bin
query = "SELECT ST_AsBinary(geom) FROM issue363"
cur.execute(query)
row = cur.fetchone()
self.assertEqual(
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
description="Pure Python MySQL Driver",
long_description=readme,
packages=find_packages(exclude=["tests*", "pymysql.tests*"]),
python_requires=">=3.6",
python_requires=">=3.7",
extras_require={
"rsa": ["cryptography"],
"ed25519": ["PyNaCl>=1.4.0"],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Intended Audience :: Developers",
Expand Down