autopep8 icon indicating copy to clipboard operation
autopep8 copied to clipboard

Avoid dependence on 2to3(lib2to3)

Open hhatto opened this issue 4 years ago • 3 comments

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

hhatto avatar Dec 28 '20 06:12 hhatto

Additional reason to do this: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+

153957 avatar Oct 21 '21 11:10 153957

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

aekoroglu avatar Jul 05 '22 04:07 aekoroglu

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

JeppeKlitgaard avatar Apr 15 '23 20:04 JeppeKlitgaard

v2.1.0 has been released. version 2.1.0 has removed the dependency on lib2to3.

hhatto avatar Mar 17 '24 10:03 hhatto