You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a requirements file includes -e ., then flake8 fails with:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 90, in __init__
req = REQUIREMENT.parseString(requirement_string)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1654, in parseString
raise exc
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1644, in parseString
loc, tokens = self._parse( instring, 0 )
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1402, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 3417, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1402, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 3739, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1402, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 3400, in parseImpl
loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1406, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 2711, in parseImpl
raise ParseException(instring, loc, self.errmsg, self)
pkg_resources._vendor.pyparsing.ParseException: Expected W:(abcd...) (at char 0), (line:1, col:1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3111, in __init__
super(Requirement, self).__init__(requirement_string)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 94, in __init__
requirement_string[e.loc:e.loc + 8]))
pkg_resources.extern.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'.'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8/checker.py", line 676, in _run_checks
return checker.run_checks()
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8/checker.py", line 589, in run_checks
self.run_ast_checks()
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8/checker.py", line 494, in run_ast_checks
for (line_number, offset, text, _) in runner:
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8_requirements/checker.py", line 568, in run
mods_3rd_party = self.get_mods_3rd_party()
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8_requirements/checker.py", line 42, in w
memoize.mem[f] = f(*args, **kw)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8_requirements/checker.py", line 545, in get_mods_3rd_party
for requirement in self.get_mods_3rd_party_requirements():
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8_requirements/checker.py", line 516, in get_mods_3rd_party_requirements
return self.get_requirements_txt()
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8_requirements/checker.py", line 42, in w
memoize.mem[f] = f(*args, **kw)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8_requirements/checker.py", line 481, in get_requirements_txt
"-r {}".format(path), cls.requirements_max_depth + 1)))
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3104, in parse_requirements
yield Requirement(line)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3113, in __init__
raise RequirementParseError(str(e))
pkg_resources.RequirementParseError: Invalid requirement, parse error at "'.'"
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.7.10/x64/bin/flake8", line 8, in <module>
sys.exit(main())
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8/main/cli.py", line 22, in main
app.run(argv)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8/main/application.py", line 363, in run
self._run(argv)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8/main/application.py", line 351, in _run
self.run_checks()
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8/main/application.py", line 264, in run_checks
self.file_checker_manager.run()
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8/checker.py", line 321, in run
self.run_parallel()
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/flake8/checker.py", line 287, in run_parallel
for ret in pool_map:
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/multiprocessing/pool.py", line 354, in <genexpr>
return (item for chunk in result for item in chunk)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/multiprocessing/pool.py", line 748, in next
raise value
pkg_resources.RequirementParseError: Invalid requirement, parse error at "'.'"
make: *** [Makefile:4: flake] Error 1
I believe this is used to load all the requirements from setup.py. Relying on the pkg_resources function would mean needing to parse out these lines (or maybe catch the exception) and then handle them separately.
The text was updated successfully, but these errors were encountered:
If a requirements file includes
-e .
, then flake8 fails with:See, for example: https://github.com/aio-libs/aiohttp-session/pull/569/checks?check_run_id=2264226699
I believe this is used to load all the requirements from setup.py. Relying on the pkg_resources function would mean needing to parse out these lines (or maybe catch the exception) and then handle them separately.
The text was updated successfully, but these errors were encountered: