globality-corp / flake8-logging-format

Flake8 extension to validate (lack of) logging format strings
Apache License 2.0
134 stars 21 forks source link

Consider adding a dependency on setuptools #68

Open yakMM opened 1 year ago

yakMM commented 1 year ago

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)

pfmoore commented 1 year ago

+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.

acdha commented 6 months ago

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