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

NoneType not iterable #47

Closed
Dreamsorcerer opened this issue Mar 13, 2022 · 1 comment
Closed

NoneType not iterable #47

Dreamsorcerer opened this issue Mar 13, 2022 · 1 comment

Comments

@Dreamsorcerer
Copy link
Contributor

Dreamsorcerer commented Mar 13, 2022

Not sure if you can see the results here: https://github.com/aio-libs/aiocache/runs/5527648155?check_suite_focus=true

But, I get this error when using flake8-requirements on the repository:

flake8 tests/ aiocache/
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8/checker.py", line 687, in _run_checks
    return checker.run_checks()
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8/checker.py", line 597, in run_checks
    self.run_ast_checks()
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8/checker.py", line 500, in run_ast_checks
    for (line_number, offset, text, _) in runner:
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8_requirements/checker.py", line 700, in run
    for err in filter(None, map(lambda c: c(node), checkers)):
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8_requirements/checker.py", line 700, in <lambda>
    for err in filter(None, map(lambda c: c(node), checkers)):
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8_requirements/checker.py", line 674, in check_I900
    if node.module in self.get_mods_3rd_party():
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8_requirements/checker.py", line 43, in w
    memoize.mem[f] = f(*args, **kw)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8_requirements/checker.py", line 650, in get_mods_3rd_party
    for requirement in self.get_mods_3rd_party_requirements():
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8_requirements/checker.py", line 637, in get_mods_3rd_party_requirements
    self.get_setup_py_requirements() or
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8_requirements/checker.py", line 609, in get_setup_py_requirements
    return setup.get_requirements(
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8_requirements/checker.py", line 215, in get_requirements
    requires.extend(parse_requirements(
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3079, in parse_requirements
    return map(Requirement, join_continuation(map(drop_comment, yield_lines(strs))))
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/functools.py", line 888, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/pkg_resources/_vendor/jaraco/text/__init__.py", line 546, in yield_lines
    return itertools.chain.from_iterable(map(yield_lines, iterable))
TypeError: 'NoneType' object is not iterable
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.10/x64/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8/main/cli.py", line 22, in main
    app.run(argv)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8/main/application.py", line 375, in run
    self._run(argv)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8/main/application.py", line 364, in _run
    self.run_checks()
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8/main/application.py", line 271, in run_checks
    self.file_checker_manager.run()
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8/checker.py", line 309, in run
    self.run_parallel()
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/flake8/checker.py", line 275, in run_parallel
    for ret in pool_map:
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/multiprocessing/pool.py", line 448, in <genexpr>
    return (item for chunk in result for item in chunk)
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/multiprocessing/pool.py", line 870, in next
    raise value
TypeError: 'NoneType' object is not iterable
@arkq arkq closed this as completed in 368d0b1 Mar 15, 2022
@arkq
Copy link
Owner

arkq commented Mar 15, 2022

The error was caused by the "-e .[dev,redis,memcached,msgpack]" line in the requirements-dev.txt file. Now flake-requirements should properly handle such a case (local install with extras specified).

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

2 participants