Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding a dependency on setuptools #68

Open
yakMM opened this issue Jan 15, 2023 · 3 comments
Open

Consider adding a dependency on setuptools #68

yakMM opened this issue Jan 15, 2023 · 3 comments

Comments

@yakMM
Copy link

yakMM commented Jan 15, 2023

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

from pkg_resources import iter_entry_points

This makes the code fail on environments without setuptools.

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

@pfmoore
Copy link

pfmoore commented Jun 5, 2023

+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
Copy link

acdha commented Dec 20, 2023

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

bdabelow added a commit to bdabelow/qtile that referenced this issue May 29, 2024
As of Python 3.12, setuptools is no longer installed into venvs by default: pypa/virtualenv#2487

flake8-logging-format depends on setuptools without explicitely declaring it: globality-corp/flake8-logging-format#68

Add setuptools to additional_dependencies in pre-commit config to avoid issue when running pre-commit hooks with Python 3.12:
Flake8 failed to load plugin "flake8-logging-format" due to No module named 'pkg_resources'.
bdabelow added a commit to bdabelow/qtile that referenced this issue May 31, 2024
As of Python 3.12, setuptools is no longer installed into venvs by default: pypa/virtualenv#2487

flake8-logging-format depends on setuptools without explicitely declaring it: globality-corp/flake8-logging-format#68

Add setuptools to additional_dependencies in pre-commit config to avoid issue when running pre-commit hooks with Python 3.12:
Flake8 failed to load plugin "flake8-logging-format" due to No module named 'pkg_resources'.

Also remove workaround from "Run pre-commit" GHA workflow.
tych0 pushed a commit to qtile/qtile that referenced this issue May 31, 2024
As of Python 3.12, setuptools is no longer installed into venvs by default: pypa/virtualenv#2487

flake8-logging-format depends on setuptools without explicitely declaring it: globality-corp/flake8-logging-format#68

Add setuptools to additional_dependencies in pre-commit config to avoid issue when running pre-commit hooks with Python 3.12:
Flake8 failed to load plugin "flake8-logging-format" due to No module named 'pkg_resources'.

Also remove workaround from "Run pre-commit" GHA workflow.
@LincolnPuzey
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants