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

Pre-commit check fails because TypeError: 'FileSystem' object is not iterable #7

Closed
lazigu opened this issue Aug 19, 2022 · 4 comments · Fixed by #6
Closed

Pre-commit check fails because TypeError: 'FileSystem' object is not iterable #7

lazigu opened this issue Aug 19, 2022 · 4 comments · Fixed by #6

Comments

@lazigu
Copy link

lazigu commented Aug 19, 2022

Hi Talley,

Recently I noticed that the pre-commit test of napari-plugin-check was randomly failing, and I couldn't figure out where is the problem. Therefore, for now, I had to remove this hook in order not to have failing tests. I hope you can help to determine the problem, which might be on my side or related to some other package, but I am just bad at reading this error.

Here is the error traceback:

napari-plugin-checks.....................................................Failed
- hook id: napari-plugin-checks
- exit code: 1

Traceback (most recent call last):
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/bin/napari-plugin-check", line 8, in <module>
    sys.exit(main())
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/napari_plugin_checks.py", line 153, in main
    return sum(check_file(filename) for filename in args.filenames)
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/napari_plugin_checks.py", line 153, in <genexpr>
    return sum(check_file(filename) for filename in args.filenames)
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/napari_plugin_checks.py", line 131, in check_file
    return function(filename)
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/napari_plugin_checks.py", line 99, in check_py
    return _check_imports(fname)
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/napari_plugin_checks.py", line 112, in _check_imports
    scanner = importscanner.ImportScanner({root: {module}}, fs, True)
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/grimp/application/ports/importscanner.py", line 35, in __init__
    for package in self.found_packages:
TypeError: 'FileSystem' object is not iterable
Traceback (most recent call last):
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/bin/napari-plugin-check", line 8, in <module>
    sys.exit(main())
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/napari_plugin_checks.py", line 153, in main
    return sum(check_file(filename) for filename in args.filenames)
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/napari_plugin_checks.py", line 153, in <genexpr>
    return sum(check_file(filename) for filename in args.filenames)
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/napari_plugin_checks.py", line 131, in check_file
    return function(filename)
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/napari_plugin_checks.py", line 99, in check_py
    return _check_imports(fname)
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/napari_plugin_checks.py", line 112, in _check_imports
    scanner = importscanner.ImportScanner({root: {module}}, fs, True)
  File "/pc/clone/iswaKIRuSpC2mXd0GYpAUg/py_env-python3/lib/python3.10/site-packages/grimp/application/ports/importscanner.py", line 35, in __init__
    for package in self.found_packages:
TypeError: 'FileSystem' object is not iterable
@tlambert03
Copy link
Owner

tlambert03 commented Aug 19, 2022

Thanks for the heads up! Will have a look

(And sorry for the inconvenience)

@tlambert03
Copy link
Owner

Should be fixed now with #6

if you'd like to re-enabling it, please bump your pre-commit rev to v0.3.0

-   repo: https://github.com/tlambert03/napari-plugin-checks
    rev: v0.3.0
    hooks:
    - id: napari-plugin-checks

@tlambert03
Copy link
Owner

by the way: this was cause by an API breakage in the recent release of grimp (the only dependency of this pre-commit hook). I've hard pinned grimp (and will pin any other deps going forward) so this shouldn't happen unexpectedly again. thanks again for the report

@lazigu
Copy link
Author

lazigu commented Aug 20, 2022

Thanks a lot for such a quick fix!

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

Successfully merging a pull request may close this issue.

2 participants