Skip to content

test(cython): set Python 3 language level - #1271

Open
harshit-3355 wants to merge 1 commit into
scylladb:masterfrom
harshit-3355:fix/444-cython-language-level
Open

harshit-3355 wants to merge 1 commit into
scylladb:masterfrom
harshit-3355:fix/444-cython-language-level

Conversation

@harshit-3355

Copy link
Copy Markdown

Summary

Set language_level=3 explicitly when installing pyximport for the Cython test helpers. This keeps test-only Cython modules on Python 3 semantics without depending on Cython's default.

Fixes #444

Validation

  • Compiled and imported tests.unit.cython.bytesio_testhelper through pyximport; all four helper functions passed.
  • git diff --check passes.
  • The repository's broader pytest path was not completed locally because building the driver extensions failed at the optional libevwrapper extension. CI can validate the full test environment.

Checklist

  • Commit message explains the change.
  • Validated the Cython helper directly.
  • Full repository test suite completed locally.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Cython-based test imports now use Python 3 language semantics, aligning test execution with the project’s Python 3 behavior.

cyimport now passes language_level=3 to pyximport.install().

Suggested reviewers: aholmberg

Change: Other

Merge Risk: Minimal · up to 79fed

This change makes the Cython test helpers use Python 3 semantics explicitly. It affects only the test setup, not production code, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: setting the Cython language level to Python 3 for test helpers. It matches the summary, which shows pyximport installed with language_level=3, and the linked issue #44…
Description check Passed The description states the change, links issue #444, and gives validation steps. It does not fill the template's checklist. Commit splitting, tests for new features, docstrings, docs, and the Fixes an…
Linked Issues check Passed [#444] requires explicit language_level 3 to remove the Cython FutureWarning for tests/unit/cython/bytesio_testhelper.pyx. The diff changes cyimport in tests/unit/cython/utils.py from `pyximpo…
Out of Scope Changes check Passed The whole-PR diff against the merge base contains one changed file, tests/unit/cython/utils.py, with a one-line change. The change directly implements #444. No unrelated changes were found.
Full details: Title check

Explanation

The title names the main change: setting the Cython language level to Python 3 for test helpers. It matches the summary, which shows pyximport installed with language_level=3, and the linked issue #444.

Full details: Description check

Explanation

The description states the change, links issue #444, and gives validation steps. It does not fill the template's checklist. Commit splitting, tests for new features, docstrings, docs, and the Fixes annotation are not addressed. Its checklist covers only three items, and the template's other items are absent. The description is mostly complete for a one-line test-helper change.

Full details: Linked Issues check

Explanation

[#444] requires explicit language_level 3 to remove the Cython FutureWarning for tests/unit/cython/bytesio_testhelper.pyx. The diff changes cyimport in tests/unit/cython/utils.py from pyximport.install() to pyximport.install(language_level=3). This sets the directive explicitly for all pyximport-built test helpers, including bytesio_testhelper. The requirement is a single coding change, and it is implemented. The PR validation reports that the helper compiles and imports through pyximport. No automated test was added. The issue does not request one.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 6ce63126-03e9-48e9-9aab-d84b141f89aa
Commits

Reviewing files that changed from the base of the PR and between 175493a and 79fed2b.

Files selected for processing: 1

  • tests/unit/cython/utils.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explicitly set language_level to 3

1 participant