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
Ran into a problem with running this on windows. Im not entirely sure whats special about my setup that would cause this.
Relevant line from attached error message
line="C:\\Users\\eehusky\\anaconda3\\lib\\site-packages\\_pytest\\_argcomplete.py:103:1: error: Skipping analyzing 'argcomplete.completers': found module but no type hints or library stubs"@classmethoddeffrom_output(cls, line: str) ->"Message":
m=cls.OUTPUT_RE.match(line)
ifnotm:
>raiseValueError("Not a valid mypy message")
EValueError: Notavalidmypymessage
Brass tacks, It think the entire absolute path getting included and is messing with the regex.
I think it is getting hung up on the C: in the file path in mypy messages. But I am by no means a regex guru so Ill withhold judgement.
OUTPUT_RE=re.compile(
r"^(?P<fname>[^:]+):"# << This r"(?P<lineno>[0-9]+):"r"((?P<colno>[0-9]+):)?"r" *(?P<severity>(error|note|warning)):"r"(?P<message>.*)$"
)
I did mess around with this a bit and found if i removed the C: from the text it would work fine.
importosimportreOUTPUT_RE=re.compile(
r"^(?P<fname>[^:]+):"r"(?P<lineno>[0-9]+):"r"((?P<colno>[0-9]+):)?"r" *(?P<severity>(error|note|warning)):"r"(?P<message>.*)$"
)
deffrom_output(line: str) ->"Message":
m=OUTPUT_RE.match(line)
ifnotm:
raiseValueError("Not a valid mypy message")
return (
os.path.abspath(m.group("fname")),
int(m.group("lineno")),
int(m.group("colno")) ifm.group("colno") elseNone,
m.group("severity").upper(),
m.group("message").strip(),
)
line="C/Users/eehusky/anaconda3/lib/site-packages/_pytest/_argcomplete.py:103:1: error: Skipping analyzing 'argcomplete.completers': found module but no type hints or library stubs"print(from_output(line))
line="C:/Users/eehusky/anaconda3/lib/site-packages/_pytest/_argcomplete.py:103:1: error: Skipping analyzing 'argcomplete.completers': found module but no type hints or library stubs"print(from_output(line))
Output from above test
('C:\\Users\\eehusky\\anaconda3\\lib\\site-packages\\_pytest\\_argcomplete.py', 103, 1, 'ERROR', "Skipping analyzing 'argcomplete.completers': found module but no type hints or library stubs")
----------------------------------------------------------------------ValueErrorTraceback (mostrecentcalllast)
<ipython-input-17-f28f32de0f3a>in<module>25print(from_output(line))
26line="C:/Users/eehusky/anaconda3/lib/site-packages/_pytest/_argcomplete.py:103:1: error: Skipping analyzing 'argcomplete.completers': found module but no type hints or library stubs"--->27print(from_output(line))
<ipython-input-17-f28f32de0f3a>infrom_output(line)
12m=OUTPUT_RE.match(line)
13ifnotm:
--->14raiseValueError("Not a valid mypy message")
15return (
16os.path.abspath(m.group("fname")),
ValueError: Notavalidmypymessage
cls = <class 'pytest_mypy_testing.message.Message'>
line = 'D:\\tmp\\.tox\\py310-windows-pyqt5\\lib\\site-packages\\pydantic\\typing.py:42:5: error: Cannot assign to a type [misc]'
....
m =cls.OUTPUT_RE.match(line)
ifnot m:
> raise ValueError("Not a valid mypy message")
E ValueError: Not a valid mypy message
D:\tmp\.tox\py310-windows-pyqt5\lib\site-packages\pytest_mypy_testing\message.py:217: ValueError
Ran into a problem with running this on windows. Im not entirely sure whats special about my setup that would cause this.
Relevant line from attached error message
Brass tacks, It think the entire absolute path getting included and is messing with the regex.
I think it is getting hung up on the C: in the file path in mypy messages. But I am by no means a regex guru so Ill withhold judgement.
I did mess around with this a bit and found if i removed the C: from the text it would work fine.
Output from above test
Cheers,
-Brandon
output.txt
The text was updated successfully, but these errors were encountered: