Skip to content

feat: add Python 3.13 support#525

Open
patsevanton wants to merge 3 commits into
robusta-dev:mainfrom
patsevanton:Add-Python-3.13-support4
Open

feat: add Python 3.13 support#525
patsevanton wants to merge 3 commits into
robusta-dev:mainfrom
patsevanton:Add-Python-3.13-support4

Conversation

@patsevanton
Copy link
Copy Markdown
Contributor

Description

This PR adds Python 3.13 compatibility to the project while maintaining backward compatibility with Python 3.10–3.12.

Changes

pyproject.toml

  • Expand Python version range from >=3.10,<=3.12.9 to >=3.10,<3.14
  • Relax numpy version constraint from >=1.26.4,<1.27.0 to >=1.26.4,<3 (numpy 1.26.x does not support Python 3.13)
  • Relax pandas version constraint from ==2.2.2 to >=2.2.3,<4 (pandas 2.2.2 fails to compile on Python 3.13)
  • Upgrade typer from ^0.7.0 to >=0.9.0,<1 (typer 0.7.0 is incompatible with click 8.4+ required by Python 3.13)

robusta_krr/main.py

  • Fix show_severity option declaration: change " /--exclude-severity" to "--show-severity/--exclude-severity" — the old syntax caused TypeError: Secondary flag is not valid for non-boolean flag with newer click versions
  • Add None guard for namespaces and resources before checking "*" in value to prevent TypeError when these options are not provided

tests/test_krr.py, tests/test_runner.py

  • Remove mix_stderr=False argument from CliRunner() — this parameter was removed in newer typer versions

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3fba8c3e-37af-4f6b-b80c-04d592bf7ccc

📥 Commits

Reviewing files that changed from the base of the PR and between f5870ac and 14010da.

📒 Files selected for processing (1)
  • pyproject.toml

Walkthrough

Updates project tooling and dependency constraints (Python >=3.10,<3.14, Black targets), adjusts Typer CLI flag declaration and Config wildcard handling, and standardizes test CliRunner construction and test docstrings.

Changes

Python version and CLI tooling alignment

Layer / File(s) Summary
Project dependencies and tooling constraints
pyproject.toml
Black target-version updated to py310, py311, py312, py313. Poetry python requirement set to >=3.10,<3.14. Dependency constraints adjusted: typer to >=0.15.0,<1, numpy replaced with Python-version-conditioned ranges, and pandas widened to >=2.2.3,<4.
CLI flag declaration and wildcard expansion logic
robusta_krr/main.py
Typer show_severity option declared as paired flag --show-severity/--exclude-severity. Several CLI-related docstrings were clarified and Config now expands namespaces and resources to "*" only when the provided value is truthy and contains "*".
Test runner stderr handling standardization
tests/test_krr.py, tests/test_runner.py
Test fixtures now use CliRunner() defaults instead of CliRunner(mix_stderr=False). Multiple tests received brief docstring lines describing their intent.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add Python 3.13 support' directly and clearly summarizes the main objective of the PR, which is adding Python 3.13 compatibility.
Description check ✅ Passed The description is comprehensive and relates directly to the changeset, detailing specific updates to pyproject.toml, main.py, and test files for Python 3.13 support.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown

@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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pyproject.toml`:
- Line 27: The dependency constraint for the Typer package in the pyproject (the
line defining "typer = { extras = [\"all\"], version = \"...\" }") allows
versions older than 0.15.0 which lack Python 3.13 support; update that version
specifier to ">=0.15.0,<1" so the project requires Typer 0.15.0 or newer while
remaining below 1.0.
- Line 12: Update the Black configuration's target-version list in
pyproject.toml by adding 'py313' to the existing array (the key is
target-version) so it reads target-version = ['py310','py311','py312','py313'],
ensuring Black formats code for Python 3.13 as well as the other specified
versions.
- Line 31: The numpy dependency constraint in pyproject.toml currently allows
1.26.x which lacks Python 3.13 support; update the numpy entry to use
Python-version markers so projects on <3.13 keep 1.26.x and projects on >=3.13
get a compatible 2.x series (e.g., split the numpy key into two table entries
with version ranges tied to python = "<3.13" and python = ">=3.13" respectively,
using >=1.26.4,<1.27.0 for pre-3.13 and >=2.1.0,<3 for 3.13+).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 09678380-d426-4df9-8e59-5e88502fb9ed

📥 Commits

Reviewing files that changed from the base of the PR and between 4465a10 and a22ad2f.

📒 Files selected for processing (4)
  • pyproject.toml
  • robusta_krr/main.py
  • tests/test_krr.py
  • tests/test_runner.py

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
- Add py313 to Black target-version list
- Update typer constraint to >=0.15.0,<1 for Python 3.13 support
- Add Python version markers for numpy: >=2.1.0 for py313, >=1.26.4 for older
@patsevanton
Copy link
Copy Markdown
Contributor Author

patsevanton commented May 20, 2026

@aantn Please review the changes and provide feedback.

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

Successfully merging this pull request may close these issues.

1 participant