flycheck-pycheckers icon indicating copy to clipboard operation
flycheck-pycheckers copied to clipboard

Fix Python 3 support for pycheckers.py

Open bernarduh opened this issue 3 years ago • 0 comments

Motivation

Python 3?

The bin/pycheckers.py script fails to run on a fresh install of Ubuntu 22.04. The issues are:

  • Ubuntu 22.04 no longer ships Python 2 and it only comes with python3 command available. Since the script shebang is using python it fails to run;
  • After fixing the above, the script outputs deprecation warnings (distutils.version is deprecated) which causes the flychecker to show a warning.

Approach

The above issues are overcome if the bin/pycheckers.py gets migrated to Python3. Please read the issue discussion for more details.

For more details on the changes made please read the commit messages.

This PR drops support for running bin/pycheckers.pyusing _Python 2_, yet it is still possible to usebin/pycheckers.py` to lint Python 2 scripts.

Testing

These changes were tested using emacs 28 on Ubuntu 22.04.

bernarduh avatar Nov 08 '22 23:11 bernarduh