Avoid dependence on 2to3(lib2to3)
Why?
Now, autopep8 depends on 2to3. This is a remnant of when it was also used in Python 2.x. Time has passed and Python 3 is mainstream.
We want to maintain maintainability by eliminating (or minimizing) the dependency on 2to3, and prevent unnecessary bugs from occurring.
Impact
- remove
W690
Additional reason to do this: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
We had that issue in Fedora rawhile, test_in_place_no_modifications_no_write and test_in_place_no_modifications_no_writes_with_empty_file tests are failing in Python 3.11 and I did a workaround for that but it's better to replace lib2to3 asap..
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2026248
Now that Python 3.11 is out and fairly widely used I am getting a ModuleNotFoundError: No module named 'lib2to3' when using autopep8 on those installations.
It seems there is some progress towards fixing this in #657?
Specifically since https://github.com/nbQA-dev/nbQA uses autopep8 I can't seem to get around this error and still lint notebooks on Python 3.11
v2.1.0 has been released. version 2.1.0 has removed the dependency on lib2to3.