best-doctor / flake8-functions

flake8 plugin for validation of function parameters (length, complexity, etc)
MIT License
50 stars 7 forks source link

Typing dependencies error #7

Open Zaysevkun opened 3 years ago

Zaysevkun commented 3 years ago

Describe the bug After update to version 0.0.5, library seems to not being able to locate typing related dependencies.

To Reproduce Steps to reproduce the behavior(reproduced on Python 3.6, 3.8):

  1. Create empty django project
  2. pip install flake and flake8-functions>=0.0.5
  3. Run flake
  4. See error

Expected behavior Expected regular flake launch.

Additional context

Logs: ``` flake recreate: /home/zaysevkun/PycharmProjects/deigmata/.tox/flake flake installdeps: flake8, flake8-bugbear, flake8-import-order, flake8-functions, flake8-executable, flake8-django, flake8-comprehensions, flake8-commas flake installed: attrs==20.3.0,flake8==3.8.4,flake8-bugbear==20.11.1,flake8-commas==2.0.0,flake8-comprehensions==3.3.1,flake8-django==1.1.1,flake8-executable==2.1.1,flake8-functions==0.0.5,flake8-import-order==0.18.1,iniconfig==1.1.1,mccabe==0.6.1,mr-proper==0.0.6,packaging==20.8,pluggy==0.13.1,py==1.10.0,pycodestyle==2.6.0,pyflakes==2.2.0,pyparsing==2.4.7,pytest==6.2.1,stdlib-list==0.8.0,toml==0.10.2 flake run-test-pre: PYTHONHASHSEED='2815784988' flake run-test: commands[0] | flake8 --config=.pep8 deigmata deigmata_backoffice deigmata_frontapi Traceback (most recent call last): File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/plugins/manager.py", line 157, in load_plugin self._load() File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/plugins/manager.py", line 134, in _load self._plugin = self.entry_point.load() File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load module = import_module(match.group('module')) File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8_functions/checker.py", line 6, in from flake8_functions.function_purity import check_purity_of_functions File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8_functions/function_purity.py", line 5, in from mr_proper.public_api import is_function_pure File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/mr_proper/public_api.py", line 5, in from typing_extensions import Literal ModuleNotFoundError: No module named 'typing_extensions' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/bin/flake8", line 8, in sys.exit(main()) File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/main/cli.py", line 22, in main app.run(argv) File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/main/application.py", line 363, in run self._run(argv) File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/main/application.py", line 350, in _run self.initialize(argv) File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/main/application.py", line 330, in initialize self.find_plugins(config_finder) File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/main/application.py", line 159, in find_plugins self.check_plugins.load_plugins() File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/plugins/manager.py", line 415, in load_plugins plugins = list(self.manager.map(load_plugin)) File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/plugins/manager.py", line 302, in map yield func(self.plugins[name], *args, **kwargs) File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/plugins/manager.py", line 413, in load_plugin return plugin.load_plugin() File "/home/zaysevkun/PycharmProjects/deigmata/.tox/flake/lib/python3.8/site-packages/flake8/plugins/manager.py", line 164, in load_plugin raise failed_to_load flake8.exceptions.FailedToLoadPlugin: Flake8 failed to load plugin "CFQ" due to No module named 'typing_extensions'. ERROR: InvocationError for command /home/zaysevkun/PycharmProjects/deigmata/.tox/flake/bin/flake8 --config=.pep8 deigmata deigmata_backoffice deigmata_frontapi (exited with code 1) ```
KyleKing commented 3 years ago

FYI, this is due to dependency changes in mr_proper and not flake8-functions directly. See https://github.com/best-doctor/mr_proper/issues/13 and https://github.com/best-doctor/mr_proper/pull/15#issuecomment-765644392

SerhiyRomanov commented 3 years ago

Any updates here? I've faced the same issue and still have no idea how to temporary fix it for me.