hhatto / autopep8

A tool that automatically formats Python code to conform to the PEP 8 style guide.
https://pypi.org/project/autopep8/
MIT License
4.54k stars 291 forks source link

missing dependency on `packaging` #702

Closed asottile closed 11 months ago

asottile commented 11 months ago

696 contains an unconditional import of packaging which is not depended on by autopep8:

Traceback (most recent call last):
  File "/home/asottile/.cache/pre-commit/repoanrqz_f1/py_env-python3.10/bin/autopep8", line 5, in <module>
    from autopep8 import main
  File "/home/asottile/.cache/pre-commit/repoanrqz_f1/py_env-python3.10/lib/python3.10/site-packages/autopep8.py", line 87, in <module>
    from packaging.version import parse as parse_version
ModuleNotFoundError: No module named 'packaging'
paugier commented 11 months ago

Note that autopep8 2.0.3 is broken by this bug. It would be nice to quickly have a new release containing the fix.