flake8-logging-format icon indicating copy to clipboard operation
flake8-logging-format copied to clipboard

Consider adding a dependency on setuptools

Open yakMM opened this issue 2 years ago • 3 comments

In whitelist.py, there is an import on pkg_resources from setuptools.

https://github.com/globality-corp/flake8-logging-format/blob/b7da42d1593ca19c5390be1e710439d0c45099ac/logging_format/whitelist.py#L5

This makes the code fail on environments without setuptools.

I suggest avoiding using the package altogether or making it a dependency (eventually optional)

yakMM avatar Jan 15 '23 16:01 yakMM

+1 on this. In Python 3.12 neither venv nor virtualenv will install setuptools by default into environments. As a result, this will start to fail pretty soon.

pfmoore avatar Jun 05 '23 12:06 pfmoore

For anyone else who's hit this with pre-commit hooks failing, simply add an explicit dependency:

- repo:  https://github.com/pycqa/flake8
  rev: 6.0.0
  hooks:
      - id: flake8
        additional_dependencies:
            - setuptools
            - flake8-logging-format

acdha avatar Dec 20 '23 17:12 acdha

There is an open PR #78 that removes the usage of setuptools for python >= 3.10, that would fix this

LincolnPuzey avatar Aug 05 '24 02:08 LincolnPuzey