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

pydoclint failing with InternalError after upgrade from 0.4.2 -> 0.5.3 #151

Closed
haakonvt opened this issue Jul 10, 2024 · 2 comments
Closed

Comments

@haakonvt
Copy link

While trying to bump the version, pydoclint started failing in pre-commit:
cognitedata/cognite-sdk-python#1830

The full stack trace:

pydoclint................................................................Failed
- hook id: pydoclint
- exit code: 1

Loading config from user-specified .toml file: pyproject.toml
No config found in pyproject.toml.
Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/bin/pydoclint", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/click/decorators.py", line [33](https://github.com/cognitedata/cognite-sdk-python/actions/runs/9873584003/job/27266161427#step:4:34), in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/pydoclint/main.py", line [36](https://github.com/cognitedata/cognite-sdk-python/actions/runs/9873584003/job/27266161427#step:4:37)4, in main
    violationsInAllFiles: Dict[str, List[Violation]] = _checkPaths(
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/pydoclint/main.py", line 527, in _checkPaths
    violationsInThisFile: List[Violation] = _checkFile(
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/pydoclint/main.py", line 591, in _checkFile
    visitor.visit(tree)
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/ast.py", line [37](https://github.com/cognitedata/cognite-sdk-python/actions/runs/9873584003/job/27266161427#step:4:38)1, in visit
    return visitor(node)
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/ast.py", line 379, in generic_visit
    self.visit(item)
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/ast.py", line 371, in visit
    return visitor(node)
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/pydoclint/visitor.py", line 91, in visit_ClassDef
    checkClassAttributesAgainstClassDocstring(
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/pydoclint/utils/visitor_helper.py", line 42, in checkClassAttributesAgainstClassDocstring
    actualArgs: ArgList = _convertClassAttributesIntoArgList(classAttributes)
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/pydoclint/utils/visitor_helper.py", line 1[40](https://github.com/cognitedata/cognite-sdk-python/actions/runs/9873584003/job/27266161427#step:4:41), in _convertClassAttributesIntoArgList
    atl.append(Arg.fromAstAssignWithNonTupleTarget(attr))
  File "/home/runner/.cache/pre-commit/repo1jglaof_/py_env-python3.8/lib/python3.8/site-packages/pydoclint/utils/arg.py", line 98, in fromAstAssignWithNonTupleTarget
    raise InternalError(
pydoclint.utils.internal_error.InternalError: astAssign.targets has length 4
@jsh9
Copy link
Owner

jsh9 commented Jul 14, 2024

Let me take a look.

@jsh9
Copy link
Owner

jsh9 commented Jul 17, 2024

Hi @haakonvt , I fixed this issue in version 0.5.5. Now your repo can pass pydoclint without any problems.

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