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

check-missing-requirements hook fails for python 3.12.4 #39

Open
RobFirth opened this issue Jun 27, 2024 · 1 comment
Open

check-missing-requirements hook fails for python 3.12.4 #39

RobFirth opened this issue Jun 27, 2024 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@RobFirth
Copy link
Contributor

Running pre-commit hooks gives the following error in python 3.12.4:

Check for missing requirements from the environment.......................Failed
- hook id: check-missing-requirements
- exit code: 1

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/berto/PycharmProjects/HT06272_RAG_Benchmarking/rag_bench/.venv/lib/python3.12/site-packages/hooks/check_missing_requirements.py", line 9, in <module>
    import requirements
  File "/Users/berto/PycharmProjects/HT06272_RAG_Benchmarking/rag_bench/.venv/lib/python3.12/site-packages/requirements/__init__.py", line 1, in <module>
    from .parser import parse   # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/berto/PycharmProjects/HT06272_RAG_Benchmarking/rag_bench/.venv/lib/python3.12/site-packages/requirements/parser.py", line 4, in <module>
    from .requirement import Requirement
  File "/Users/berto/PycharmProjects/HT06272_RAG_Benchmarking/rag_bench/.venv/lib/python3.12/site-packages/requirements/requirement.py", line 3, in <module>
    from pkg_resources import Requirement as Req
ModuleNotFoundError: No module named 'pkg_resources'
@RobFirth RobFirth added bug Something isn't working help wanted Extra attention is needed labels Jun 27, 2024
@RobFirth
Copy link
Contributor Author

ensuring setuptools is specified as a dependency in the project python environment solves this issue.

Interestingly, the same error can be resolved for nbdev using the additional_dependencies option:

    - repo: https://github.com/fastai/nbdev
      rev: 2.3.25
      hooks:
      - id: nbdev_clean
        additional_dependencies: [setuptools]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant