Skip to content

Conversation

@burgholzer
Copy link
Member

@burgholzer burgholzer commented Dec 21, 2025

Description

This PR changes the newly introduced check-stubs sub-step of the Python linter to rely on a nox session called stubs for generating the stubs.
This is way more user friendly and in line with the rest of the project than the previous script approach.

This also directly prepares the release of 1.17.6.

Checklist:

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

@burgholzer burgholzer self-assigned this Dec 21, 2025
@burgholzer burgholzer added continuous integration Anything related to the CI setup python Anything related to Python code usability Anything related to usability labels Dec 21, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 21, 2025

Warning

Rate limit exceeded

@burgholzer has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 50 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 654680a and 92553f4.

📒 Files selected for processing (3)
  • .github/workflows/reusable-python-linter.yml (2 hunks)
  • CHANGELOG.md (3 hunks)
  • UPGRADING.md (2 hunks)
📝 Walkthrough

Walkthrough

Replaces the script-based stub-generation step with a direct nox invocation (uvx nox -s stubs) in the reusable Python linter workflow, and adds release notes and upgrade instructions documenting the stub-check workflow change.

Changes

Cohort / File(s) Summary
Workflow stub-generation update
\.github/workflows/reusable-python-linter.yml
Replace ./bindings/generate-stubs.sh invocation with uvx nox -s stubs; update error messages to reference nox -s stubs and mention possible ruff-related failures; preserve check-stubs gating and post-check diff/exit behavior.
Changelog update
CHANGELOG.md
Add Unreleased entry for 1.17.6 (2025-12-21), note upgrade pointer to UPGRADING.md, document stub-generation workflow change and add PR #288 and release tag link.
Upgrade instructions
UPGRADING.md
Add [1.17.6] section detailing "Checking Python stub files" with example workflow steps (nox stubs session, env setup, nanobind stub generation, prek checks); update unreleased references to v1.17.6 and add tag link.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to the workflow file logic and error messages in .github/workflows/reusable-python-linter.yml.
  • Verify the UPGRADING.md example steps match CI expectations (nox session name, environment variables, commands).
  • Confirm CHANGELOG links and PR anchor formatting are correct.

Possibly related PRs

Suggested reviewers

  • denialhaag

Poem

🐰
I hopped through CI, twitching my nose,
Said goodbye to scripts and their prose.
Now nox runs stubs with tidy flair,
A carrot of logs and cleaner air.
Hooray—one hop, the checks declare! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing the stub generation script with a nox-based approach (nox -s stubs).
Description check ✅ Passed The PR description covers the key changes, motivation, and includes a completed checklist matching the repository template requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/reusable-python-linter.yml (1)

38-38: Update the description to reference the nox session.

The description still references bindings/generate-stubs.sh, but the implementation now uses nox -s stubs (line 74). Update the description to match the new approach.

🔎 Proposed fix
-        description: "Whether to check if the stub files are up to date. Requires 'bindings/generate-stubs.sh' to exist"
+        description: "Whether to check if the stub files are up to date. Requires a 'stubs' nox session to be configured"
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 654680a and f4897b1.

📒 Files selected for processing (1)
  • .github/workflows/reusable-python-linter.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: denialhaag
Repo: munich-quantum-toolkit/core PR: 1383
File: bindings/dd/register_matrix_dds.cpp:64-109
Timestamp: 2025-12-15T01:54:22.129Z
Learning: In the munich-quantum-toolkit/core repository, after migrating to nanobind, docstrings for Python bindings are now added directly in the C++ binding code (using R"pb(...)pb" syntax) and stub files (.pyi) are auto-generated using the `bindings/generate-stubs.sh` script. This replaces the previous pybind11 approach where docstrings were manually maintained in stub files.
Learnt from: denialhaag
Repo: munich-quantum-toolkit/core PR: 1383
File: python/mqt/core/ir/operations.pyi:9-16
Timestamp: 2025-12-15T01:59:17.023Z
Learning: In the munich-quantum-toolkit/core repository, stub files (.pyi) are auto-generated by nanobind's stubgen tool and should not be manually modified for style preferences, as changes would be overwritten during regeneration.
📚 Learning: 2025-12-15T01:54:22.129Z
Learnt from: denialhaag
Repo: munich-quantum-toolkit/core PR: 1383
File: bindings/dd/register_matrix_dds.cpp:64-109
Timestamp: 2025-12-15T01:54:22.129Z
Learning: In the munich-quantum-toolkit/core repository, after migrating to nanobind, docstrings for Python bindings are now added directly in the C++ binding code (using R"pb(...)pb" syntax) and stub files (.pyi) are auto-generated using the `bindings/generate-stubs.sh` script. This replaces the previous pybind11 approach where docstrings were manually maintained in stub files.

Applied to files:

  • .github/workflows/reusable-python-linter.yml
📚 Learning: 2025-12-15T01:59:17.023Z
Learnt from: denialhaag
Repo: munich-quantum-toolkit/core PR: 1383
File: python/mqt/core/ir/operations.pyi:9-16
Timestamp: 2025-12-15T01:59:17.023Z
Learning: In the munich-quantum-toolkit/core repository, stub files (.pyi) are auto-generated by nanobind's stubgen tool and should not be manually modified for style preferences, as changes would be overwritten during regeneration.

Applied to files:

  • .github/workflows/reusable-python-linter.yml
🔇 Additional comments (1)
.github/workflows/reusable-python-linter.yml (1)

74-79: The stub check implementation is correctly configured for optional use by downstream repositories.

The migration from ./bindings/generate-stubs.sh to uvx nox -s stubs is sound. The uvx command invokes a tool without installing it, and the error message appropriately directs users to run nox -s stubs. Since this is a reusable workflow with check-stubs defaulting to false, downstream projects that enable this check must provide their own noxfile.py with a properly configured stubs session.

Likely an incorrect or invalid review comment.

Signed-off-by: burgholzer <[email protected]>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f4897b1 and f90b12c.

📒 Files selected for processing (3)
  • .github/workflows/reusable-python-linter.yml (2 hunks)
  • CHANGELOG.md (3 hunks)
  • UPGRADING.md (2 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: denialhaag
Repo: munich-quantum-toolkit/core PR: 1383
File: bindings/dd/register_matrix_dds.cpp:64-109
Timestamp: 2025-12-15T01:54:22.129Z
Learning: In the munich-quantum-toolkit/core repository, after migrating to nanobind, docstrings for Python bindings are now added directly in the C++ binding code (using R"pb(...)pb" syntax) and stub files (.pyi) are auto-generated using the `bindings/generate-stubs.sh` script. This replaces the previous pybind11 approach where docstrings were manually maintained in stub files.
Learnt from: denialhaag
Repo: munich-quantum-toolkit/core PR: 1383
File: python/mqt/core/ir/operations.pyi:9-16
Timestamp: 2025-12-15T01:59:17.023Z
Learning: In the munich-quantum-toolkit/core repository, stub files (.pyi) are auto-generated by nanobind's stubgen tool and should not be manually modified for style preferences, as changes would be overwritten during regeneration.
📚 Learning: 2025-12-15T01:54:22.129Z
Learnt from: denialhaag
Repo: munich-quantum-toolkit/core PR: 1383
File: bindings/dd/register_matrix_dds.cpp:64-109
Timestamp: 2025-12-15T01:54:22.129Z
Learning: In the munich-quantum-toolkit/core repository, after migrating to nanobind, docstrings for Python bindings are now added directly in the C++ binding code (using R"pb(...)pb" syntax) and stub files (.pyi) are auto-generated using the `bindings/generate-stubs.sh` script. This replaces the previous pybind11 approach where docstrings were manually maintained in stub files.

Applied to files:

  • .github/workflows/reusable-python-linter.yml
  • UPGRADING.md
📚 Learning: 2025-12-15T01:59:17.023Z
Learnt from: denialhaag
Repo: munich-quantum-toolkit/core PR: 1383
File: python/mqt/core/ir/operations.pyi:9-16
Timestamp: 2025-12-15T01:59:17.023Z
Learning: In the munich-quantum-toolkit/core repository, stub files (.pyi) are auto-generated by nanobind's stubgen tool and should not be manually modified for style preferences, as changes would be overwritten during regeneration.

Applied to files:

  • .github/workflows/reusable-python-linter.yml
  • UPGRADING.md
📚 Learning: 2025-10-14T14:37:38.047Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/yaqs PR: 212
File: CHANGELOG.md:12-15
Timestamp: 2025-10-14T14:37:38.047Z
Learning: In the munich-quantum-toolkit/yaqs project, changelog entries follow the template: "- $TITLE ([#$NUMBER]($URL)) ([**AUTHOR**](https://github.com/$AUTHOR))". Issue references should not be included in changelog entries; the PR number is sufficient for traceability.

Applied to files:

  • CHANGELOG.md
  • UPGRADING.md
📚 Learning: 2025-12-05T17:45:37.602Z
Learnt from: denialhaag
Repo: munich-quantum-toolkit/core PR: 1360
File: .github/workflows/reusable-mlir-tests.yml:40-43
Timestamp: 2025-12-05T17:45:37.602Z
Learning: In the munich-quantum-toolkit/core repository, patch releases of LLVM dependencies don't require documentation updates, changelog entries, or additional tests beyond what's validated by passing CI checks.

Applied to files:

  • CHANGELOG.md
  • UPGRADING.md
📚 Learning: 2025-12-01T11:00:40.342Z
Learnt from: flowerthrower
Repo: munich-quantum-toolkit/core-plugins-catalyst PR: 1
File: CHANGELOG.md:18-18
Timestamp: 2025-12-01T11:00:40.342Z
Learning: In the munich-quantum-toolkit/core-plugins-catalyst repository, the CHANGELOG.md intentionally references the parent MQT Core repository's release notes (https://github.com/munich-quantum-toolkit/core/releases) because the plugin repository is based on work performed in the parent repository.

Applied to files:

  • CHANGELOG.md
  • UPGRADING.md
📚 Learning: 2025-11-24T10:19:41.147Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/core PR: 1326
File: python/mqt/core/__init__.py:22-22
Timestamp: 2025-11-24T10:19:41.147Z
Learning: In the munich-quantum-toolkit/core repository, Ruff is configured with 'ALL' rules enabled by default, and only specific rules are selectively disabled. When reviewing changes that enable previously-disabled rules (like PLC0415), noqa directives for those rules become necessary and should be retained.

Applied to files:

  • CHANGELOG.md
📚 Learning: 2025-12-07T01:21:27.544Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/core PR: 1355
File: bindings/fomac/fomac.cpp:227-264
Timestamp: 2025-12-07T01:21:27.544Z
Learning: In the munich-quantum-toolkit/core repository, docstrings for Python bindings are added to the corresponding stub files (.pyi) rather than directly in the pybind11 C++ bindings code. This practice may change if the project adopts nanobind with automatic stub generation.

Applied to files:

  • UPGRADING.md
🪛 LanguageTool
CHANGELOG.md

[typographical] ~12-~12: To join two clauses or introduce examples, consider using an em dash.
Context: ...g changes. ## [Unreleased] ## [1.17.6] - 2025-12-21 _If you are upgrading: pleas...

(DASH_RULE)

🔇 Additional comments (4)
CHANGELOG.md (2)

12-19: LGTM! Release entry follows project conventions.

The changelog entry is properly formatted and includes all required elements (version, date, upgrade reference, change description with PR link and author attribution).

The static analysis tool suggests using an em dash, but this is a minor typographical preference that can be safely ignored.


207-209: LGTM! Version links properly updated.

The unreleased comparison link, release tag link, and PR reference are all correctly added for version 1.17.6.

Also applies to: 230-230

.github/workflows/reusable-python-linter.yml (1)

38-38: LGTM! Description clearly states the nox session requirement.

The updated description accurately reflects the new nox-based approach and clearly communicates what projects need to provide.

UPGRADING.md (1)

253-254: LGTM! Version links properly updated.

The unreleased comparison link and release tag link are correctly updated to reference v1.17.6.

@burgholzer
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 21, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@burgholzer
Copy link
Member Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 21, 2025

✅ Actions performed

Full review triggered.

@burgholzer burgholzer merged commit 2acb397 into main Dec 21, 2025
4 of 5 checks passed
@burgholzer burgholzer deleted the improved-stub-check branch December 21, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

continuous integration Anything related to the CI setup python Anything related to Python code usability Anything related to usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants