julien-duponchelle/python-mysql-replication

module distutils deprecated change to packaging

Closed this issue · 0 comments

Version

Please specify the versions you are using. Exact version numbers are preferred.

  • Pymyrepl (e.g., 1.0.2): 1.0.2
  • OS (e.g., Ubuntu 18.04): MAC
  • Database and version (Remove unnecessary options):
    • MySQL: 8.0

Symptoms

binlogstream.py file

line 3 from distutils.version import LooseVersion is deprecated
PEP 632 migrate advice https://peps.python.org/pep-0632/#migration-advice
so we should change module from disutils to packaging

line # 3
AS-IS

from distutils.version import LooseVersion  

TO-BE

from packaging.version import Version

line # 333, 505, 591
AS-IS

if pymysql.__version__ < LooseVersion("0.6"): 

TO-BE

if Version(pymysql.__version__) < Version("0.6"): 

Steps to Reproduce

github action When Build Error

Expected Outcome

not raise Error When Build