Skip to content

GH-50985: [CI][Dev][Python] Update cython-lint and pin Cython to 3.2.9 - #50986

Merged
rok merged 3 commits into
apache:mainfrom
hiroyuki-sato:topic/update-cython-lint
Aug 25, 2026
Merged

GH-50985: [CI][Dev][Python] Update cython-lint and pin Cython to 3.2.9#50986
rok merged 3 commits into
apache:mainfrom
hiroyuki-sato:topic/update-cython-lint

Conversation

@hiroyuki-sato

@hiroyuki-satohiroyuki-sato commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Rationale for this change

Cython 3.3.0 causes cython-lint to fail with the following error:
See also: MarcoGorelli/cython-lint#201

Python (Cython) Lint.....................................................Failed
- hook id: cython-lint
- exit code: 1
Traceback (most recent call last):
File "/home/runner/.cache/pre-commit/repoohugd5tn/py_env-python3/bin/cython-lint", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/runner/.cache/pre-commit/repoohugd5tn/py_env-python3/lib/python3.12/site-packages/cython_lint/cython_lint.py", line 960, in main
ret |= _main(
^^^^^^
File "/home/runner/.cache/pre-commit/repoohugd5tn/py_env-python3/lib/python3.12/site-packages/cython_lint/cython_lint.py", line 837, in _main
lines = run_ast_checks(code, filename, violations)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repoohugd5tn/py_env-python3/lib/python3.12/site-packages/cython_lint/cython_lint.py", line 751, in run_ast_checks
names, imported_names, global_names, exported_imports = _traverse_file(
^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repoohugd5tn/py_env-python3/lib/python3.12/site-packages/cython_lint/cython_lint.py", line 541, in _traverse_file
expr = node.loop.body.value_expr
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'DictComprehensionAppendNode' object has no attribute 'value_expr'
Traceback (most recent call last):
File "/home/runner/.cache/pre-commit/repoohugd5tn/py_env-python3/bin/cython-lint", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/runner/.cache/pre-commit/repoohugd5tn/py_env-python3/lib/python3.12/site-packages/cython_lint/cython_lint.py", line 960, in main
ret |= _main(
^^^^^^
File "/home/runner/.cache/pre-commit/repoohugd5tn/py_env-python3/lib/python3.12/site-packages/cython_lint/cython_lint.py", line 837, in _main
lines = run_ast_checks(code, filename, violations)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repoohugd5tn/py_env-python3/lib/python3.12/site-packages/cython_lint/cython_lint.py", line 751, in run_ast_checks
names, imported_names, global_names, exported_imports = _traverse_file(
^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repoohugd5tn/py_env-python3/lib/python3.12/site-packages/cython_lint/cython_lint.py", line 541, in _traverse_file
expr = node.loop.body.value_expr
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'DictComprehensionAppendNode' object has no attribute 'value_expr'

What changes are included in this PR?

  • Pin Cython to 3.2.9 for cython-lint.
  • Update cython-lint from 0.16.2 to 0.21.0, as it was using an older version.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50985has been automatically assigned in GitHub to PR creator.

@github-actionsgithub-actionsBot added the awaiting review Awaiting review label Aug 25, 2026
@hiroyuki-sato
hiroyuki-sato marked this pull request as ready for review August 25, 2026 12:10
@hiroyuki-satohiroyuki-sato changed the title GH-50985: [CI][Dev][Python] Update cython-lint to 0.21.0GH-50985: [CI][Dev][Python] Update cython-lint and pin Cython to 3.2.9Aug 25, 2026
rok
rok approved these changes Aug 25, 2026

@rokrok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this @hiroyuki-sato !
Can you please make a followup issue for removing the cython pin?

@rok
rok merged commit 54ea6d5 into apache:mainAug 25, 2026
32 checks passed
@rokrok removed the awaiting review Awaiting review label Aug 25, 2026
@github-actionsgithub-actionsBot added the awaiting merge Awaiting merge label Aug 25, 2026
@hiroyuki-sato
hiroyuki-sato deleted the topic/update-cython-lint branch August 26, 2026 00:25
@hiroyuki-sato

Copy link
Copy Markdown
CollaboratorAuthor

@rok Thank you for your review. I created the Issue #51003.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting mergeAwaiting merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@hiroyuki-sato@rok