Skip to content

Conversation

@lu11y0
Copy link
Contributor

@lu11y0 lu11y0 commented Dec 23, 2025

Related Issue

Closes #272

Summary

  • TESTED - Core Cortex deps work perfectly
  • anthropic ✓ | openai ✓ | rich ✓ | pyyaml ✓ | python-dotenv ✓
  • All imports clean in Python 3.13 venv
  • No compatibility issues found
  • FIXED - Zero new warnings
  • Add 3.13 to GitHub Actions matrix
    • .github/workflows/ci.yml: python-version: [3.10, 3.11, 3.12, 3.13]
    • .github/workflows/automation.yml: python-version: [3.10, 3.11, 3.12, 3.13]

Performance benchmarks 3.11 vs 3.13

  • Run 1: 3.11=0.1526s | 3.13=0.1246s → 3.13 18% FASTER
  • Run 2: 3.11=0.1327s | 3.13=0.1065s → 3.13 20% FASTER
    AVERAGE: 3.11=0.1427s | 3.13=0.1156s → 3.13 = 19% FASTER!

Run :

python3.11 benchmark_313.py and python3.13 benchmark_313.py

Recordings

benchmark_313.py execution :

Screen.Recording.2025-12-23.170834.mp4

647 tests passing and benchmark test:

Screen.Recording.2025-12-22.220446.1.mp4

other tests :

Screen.Recording.2025-12-22.223159.mp4

Checklist

  • Tests pass (pytest tests/)
  • PR title format: [#XX] Description
  • MVP label added if closing MVP issue

Summary by CodeRabbit

  • Tests

    • Added a benchmark script that measures performance on Python 3.11 and 3.13 for YAML serialization and dictionary-comprehension workloads; prints per-block timings, total time, and a compatibility confirmation.
  • Chores

    • Extended Python 3.13 support across CI, project metadata, and tooling configuration so the newer interpreter is recognized, tested, and used by formatting/linting targets.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Walkthrough

Adds Python 3.13 to CI workflows and project metadata/tooling, and introduces a new benchmark script tests/benchmark_313.py that measures simple YAML and dict operation timings. No runtime logic, public API, or control-flow changes beyond CI/test matrix and tooling metadata.

Changes

Cohort / File(s) Summary
CI/CD Workflows
.github/workflows/automation.yml, .github/workflows/ci.yml
Expanded GitHub Actions Python test matrix to include Python 3.13; no other workflow control-flow changes.
Project Configuration & Tooling
pyproject.toml, setup.py
Added Python 3.13 to classifiers and Black target-version in pyproject.toml; only metadata/tooling values changed.
Benchmark Tests
tests/benchmark_313.py
New benchmark script that prints Python version and runs two 1000-iteration timings (PyYAML dump and dict-comprehension workflow), printing per-block and total timings and a compatibility note.

Sequence Diagram(s)

(omitted — changes are configuration/benchmarks without multi-component control-flow requiring visualization)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • mikejmorgan-ai

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: validating Python 3.13 compatibility for the project.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from issue #272: validates Python 3.13 compatibility, tests dependencies, adds 3.13 to CI matrix, and provides performance benchmarks.
Out of Scope Changes check ✅ Passed All changes are within scope: Python 3.13 version updates to workflows, configs, and adding a benchmark script directly support the issue #272 objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description comprehensively covers all required template sections with detailed testing results, benchmark data, and implementation details.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

🧹 Nitpick comments (4)
.github/workflows/automation.yml (1)

18-18: Fix spacing in YAML array for consistency.

There's a missing space after the comma between '3.12' and '3.13'. For consistency with the other elements, add a space.

🔎 Proposed fix
-        python-version: ['3.10', '3.11', '3.12','3.13']
+        python-version: ['3.10', '3.11', '3.12', '3.13']
.github/workflows/ci.yml (1)

48-48: Fix spacing in YAML array for consistency.

There's a missing space after the comma between "3.12" and "3.13". For consistency with the other elements, add a space.

🔎 Proposed fix
-        python-version: ["3.10", "3.11", "3.12","3.13"]
+        python-version: ["3.10", "3.11", "3.12", "3.13"]
pyproject.toml (1)

97-97: Fix spacing in array for consistency.

There's a missing space after the comma between "py312" and "py313". For consistency with the other elements, add a space.

🔎 Proposed fix
-target-version = ["py310", "py311", "py312","py313"]
+target-version = ["py310", "py311", "py312", "py313"]
tests/benchmark_313.py (1)

1-8: Fix typo in docstring.

Line 2 has a typo: "TO run" should be "To run" (lowercase 'o').

🔎 Proposed fix
 """Cortex Python 3.13 Benchmark - Issue #272
-TO run benchmarks:
+To run benchmarks:
 # Install PyYAML (only dep needed)
 pip install pyyaml
 # Test both versions
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 287a353 and ee72c6c.

📒 Files selected for processing (5)
  • .github/workflows/automation.yml
  • .github/workflows/ci.yml
  • pyproject.toml
  • setup.py
  • tests/benchmark_313.py
🧰 Additional context used
📓 Path-based instructions (3)
{setup.py,setup.cfg,pyproject.toml,**/__init__.py}

📄 CodeRabbit inference engine (AGENTS.md)

Use Python 3.10 or higher as the minimum supported version

Files:

  • pyproject.toml
  • setup.py
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Follow PEP 8 style guide
Type hints required in Python code
Docstrings required for all public APIs

Files:

  • tests/benchmark_313.py
  • setup.py
tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Maintain >80% test coverage for pull requests

Files:

  • tests/benchmark_313.py
🧠 Learnings (1)
📚 Learning: 2025-12-11T12:03:24.071Z
Learnt from: CR
Repo: cortexlinux/cortex PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-11T12:03:24.071Z
Learning: Applies to {setup.py,setup.cfg,pyproject.toml,**/__init__.py} : Use Python 3.10 or higher as the minimum supported version

Applied to files:

  • .github/workflows/ci.yml
  • .github/workflows/automation.yml
  • pyproject.toml
  • setup.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Package
  • GitHub Check: test (3.12)
  • GitHub Check: test (3.11)
  • GitHub Check: test (3.13)
  • GitHub Check: test (3.10)
🔇 Additional comments (3)
setup.py (1)

44-44: LGTM!

The Python 3.13 classifier addition is correct and consistent with the existing classifier pattern and the python_requires=">=3.10" constraint on line 47.

pyproject.toml (1)

40-40: LGTM!

The Python 3.13 classifier addition is correct and consistent with the requires-python = ">=3.10" constraint on line 44.

tests/benchmark_313.py (1)

10-33: LGTM!

The benchmark script correctly uses timeit for performance measurement and provides a simple, effective way to compare Python 3.11 vs 3.13 performance on relevant operations (YAML serialization and dict comprehensions). The approach is sound and aligns with the PR objectives to produce performance benchmarks.

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

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

48-48: Python 3.13 successfully added to test matrix.

The addition of Python 3.13 to the CI test matrix aligns with the PR objectives and is well-validated by the 647 passing tests.

Minor formatting nitpick: missing space after "3.12" before the comma for consistency with other entries.

🔎 Proposed formatting fix
-        python-version: ["3.10", "3.11", "3.12","3.13"]
+        python-version: ["3.10", "3.11", "3.12", "3.13"]
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee72c6c and c4bef96.

📒 Files selected for processing (2)
  • .github/workflows/automation.yml
  • .github/workflows/ci.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/automation.yml
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: cortexlinux/cortex PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-11T12:03:24.071Z
Learning: Applies to {setup.py,setup.cfg,pyproject.toml,**/__init__.py} : Use Python 3.10 or higher as the minimum supported version
📚 Learning: 2025-12-11T12:03:24.071Z
Learnt from: CR
Repo: cortexlinux/cortex PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-11T12:03:24.071Z
Learning: Applies to {setup.py,setup.cfg,pyproject.toml,**/__init__.py} : Use Python 3.10 or higher as the minimum supported version

Applied to files:

  • .github/workflows/ci.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Package
  • GitHub Check: test (3.11)
  • GitHub Check: test (3.12)
  • GitHub Check: test (3.13)
  • GitHub Check: test (3.10)

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: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c4bef96 and 767d73b.

📒 Files selected for processing (4)
  • .github/workflows/automation.yml
  • .github/workflows/ci.yml
  • pyproject.toml
  • tests/benchmark_313.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/ci.yml
  • .github/workflows/automation.yml
  • pyproject.toml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Follow PEP 8 style guide
Type hints required in Python code
Docstrings required for all public APIs

Files:

  • tests/benchmark_313.py
tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Maintain >80% test coverage for pull requests

Files:

  • tests/benchmark_313.py
🧬 Code graph analysis (1)
tests/benchmark_313.py (1)
cortex/semantic_cache.py (1)
  • total (30-32)
🔇 Additional comments (3)
tests/benchmark_313.py (3)

1-8: Clear documentation with usage instructions.

The module docstring effectively explains the benchmark's purpose and provides actionable setup/run commands.


24-29: Dict operations logic is correct.

The dict comprehension and filtering operations accurately test common patterns with proper logic.


31-33: Output logic is correct.

The total calculation and result presentation are appropriate for the benchmark's purpose.

@sonarqubecloud
Copy link

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

🧹 Nitpick comments (1)
tests/benchmark_313.py (1)

15-21: Previous issue resolved; dict comprehension now correct.

The dict comprehension on line 17 now correctly creates 100 unique key-value pairs using {f'test_{i}': i for i in range(100)}, addressing the concern from the previous review.

One optional enhancement: consider adding an early check for PyYAML availability to provide clearer error messages if the dependency is missing, though the docstring already documents this requirement.

🔎 Optional: Add early dependency check
 import sys
 import timeit
+
+try:
+    import yaml
+except ImportError:
+    print("Error: PyYAML is required. Install with: pip install pyyaml")
+    sys.exit(1)
 
 print(f"=== Cortex Python {sys.version_info.major}.{sys.version_info.minor} Benchmark ===\n")
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 767d73b and 08de887.

📒 Files selected for processing (1)
  • tests/benchmark_313.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Follow PEP 8 style guide
Type hints required in Python code
Docstrings required for all public APIs

Files:

  • tests/benchmark_313.py
tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Maintain >80% test coverage for pull requests

Files:

  • tests/benchmark_313.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: test (3.11)
  • GitHub Check: test (3.13)
  • GitHub Check: test (3.12)
  • GitHub Check: test (3.10)
🔇 Additional comments (4)
tests/benchmark_313.py (4)

1-8: Clear documentation for benchmark usage.

The module docstring effectively documents the benchmark's purpose, dependency requirements, and usage instructions.


10-13: LGTM!

Standard library imports are appropriate, and the benchmark header clearly identifies the Python version being tested.


23-29: LGTM!

The dict operations benchmark correctly creates 100 key-value pairs and filters values greater than 50. The structure is consistent with the YAML benchmark section.


31-33: LGTM!

The summary correctly totals the benchmark times and provides clear output confirming Python version compatibility.

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.

Python 3.13 Compatibility Testing

1 participant