Hey there, thanks for developing interrogate! I'm hoping that we can use it to improve doc coverage on our satellite flight software repo. I'm having some trouble getting it running though and the error doesn't feel descriptive enough for me to investigate. We're using uv so you should be able to reproduce with an identical env by cloning, checking out the branch and running make fmt or uvx -p 3.9 interrogate --config=pyproject.toml.
Let me know if there's anything more I can do on our end to help debug what's going on here!
Environment
Description of the bug
Seeing an error when trying to run interrogate against codebase:
uvx interrogate --config=pyproject.toml
Installed 7 packages in 8ms
Traceback (most recent call last):
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/bin/interrogate", line 10, in <module>
sys.exit(main())
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/interrogate/cli.py", line 400, in main
results = interrogate_coverage.get_coverage()
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/interrogate/coverage.py", line 286, in get_coverage
return self._get_coverage(filenames)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/interrogate/coverage.py", line 268, in _get_coverage
result = self._get_file_coverage(f)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/interrogate/coverage.py", line 237, in _get_file_coverage
parsed_tree = ast.parse(source_tree)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 86
f"{sensor_name}_{
^
SyntaxError: EOL while scanning string literal
What you expected to happen
How to reproduce (as minimally and precisely as possible)
# clone
git clone git@github.com:proveskit/pysquared.git
# checkout the branch
git checkout add-interrogate
# if you have uv installed you can run
uvx -p 3.9 interrogate --config=pyproject.toml
# otherwise just run
make fmt
Anthing else we need to know?
Trying with different python versions changes the failure slightly. Here's what it looks like on 3.12
uvx -p 3.12 interrogate --config=pyproject.toml
Installed 6 packages in 8ms
Traceback (most recent call last):
File "/Users/nate/.cache/uv/archive-v0/JGriK8izZszrYxjeTE-oW/bin/interrogate", line 10, in <module>
sys.exit(main())
^^^^^^
File "/Users/nate/.cache/uv/archive-v0/JGriK8izZszrYxjeTE-oW/lib/python3.12/site-packages/click/core.py", line 1442, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nate/.cache/uv/archive-v0/JGriK8izZszrYxjeTE-oW/lib/python3.12/site-packages/click/core.py", line 1363, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/nate/.cache/uv/archive-v0/JGriK8izZszrYxjeTE-oW/lib/python3.12/site-packages/click/core.py", line 1226, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nate/.cache/uv/archive-v0/JGriK8izZszrYxjeTE-oW/lib/python3.12/site-packages/click/core.py", line 794, in invoke
return callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nate/.cache/uv/archive-v0/JGriK8izZszrYxjeTE-oW/lib/python3.12/site-packages/click/decorators.py", line 34, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nate/.cache/uv/archive-v0/JGriK8izZszrYxjeTE-oW/lib/python3.12/site-packages/interrogate/cli.py", line 400, in main
results = interrogate_coverage.get_coverage()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nate/.cache/uv/archive-v0/JGriK8izZszrYxjeTE-oW/lib/python3.12/site-packages/interrogate/coverage.py", line 286, in get_coverage
return self._get_coverage(filenames)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nate/.cache/uv/archive-v0/JGriK8izZszrYxjeTE-oW/lib/python3.12/site-packages/interrogate/coverage.py", line 268, in _get_coverage
result = self._get_file_coverage(f)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nate/.cache/uv/archive-v0/JGriK8izZszrYxjeTE-oW/lib/python3.12/site-packages/interrogate/coverage.py", line 237, in _get_file_coverage
parsed_tree = ast.parse(source_tree)
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ast.py", line 52, in parse
return compile(source, filename, mode, flags,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<unknown>", line 71
moment = self._scalar_gain * (pre
^
SyntaxError: '(' was never closed
Similarly, commenting out all the code in the file where f"{sensor_name}_{ exists changes the error.
uvx -p 3.9 interrogate --config=pyproject.toml
Traceback (most recent call last):
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/bin/interrogate", line 10, in <module>
sys.exit(main())
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/interrogate/cli.py", line 400, in main
results = interrogate_coverage.get_coverage()
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/interrogate/coverage.py", line 286, in get_coverage
return self._get_coverage(filenames)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/interrogate/coverage.py", line 268, in _get_coverage
result = self._get_file_coverage(f)
File "/Users/nate/.cache/uv/archive-v0/x1EkT-3TJZbse_j4ZgvIs/lib/python3.9/site-packages/interrogate/coverage.py", line 237, in _get_file_coverage
parsed_tree = ast.parse(source_tree)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 76
if not mag_field or not ang_vel:
^
SyntaxError: invalid syntax
Ultimately it looks like parts of the codebase/file gets cut off when running interrogate?
Hey there, thanks for developing interrogate! I'm hoping that we can use it to improve doc coverage on our satellite flight software repo. I'm having some trouble getting it running though and the error doesn't feel descriptive enough for me to investigate. We're using
uvso you should be able to reproduce with an identical env by cloning, checking out the branch and runningmake fmtoruvx -p 3.9 interrogate --config=pyproject.toml.Let me know if there's anything more I can do on our end to help debug what's going on here!
Environment
interrogateversion(s) (interrogate --version: 1.7.0make fmtDescription of the bug
Seeing an error when trying to run
interrogateagainst codebase:What you expected to happen
How to reproduce (as minimally and precisely as possible)
Anthing else we need to know?
Trying with different python versions changes the failure slightly. Here's what it looks like on 3.12
Similarly, commenting out all the code in the file where
f"{sensor_name}_{exists changes the error.Ultimately it looks like parts of the codebase/file gets cut off when running interrogate?