Skip to content

Conversation

marianoeramirez
Copy link
Collaborator

@marianoeramirez marianoeramirez commented Aug 30, 2025

Summary by CodeRabbit

  • New Features
    • Added official compatibility testing for Python 3.13 and Django 5.2.
  • Tests
    • Expanded test matrix to cover Python 3.13 across supported Django versions, ensuring broader compatibility.
  • Chores
    • Updated continuous integration to include Python 3.13 and switched the CI database image to a more current Postgres variant.
    • Minor formatting cleanups in configuration files.

Copy link

coderabbitai bot commented Aug 30, 2025

Walkthrough

Adds Python 3.13 to CI and tox test matrices, introduces Django 5.2 environments, and switches the CI Postgres image from postgres:14-alpine to postgres:alpine.

Changes

Cohort / File(s) Summary
CI workflow updates
.github/workflows/django.yml
Added Python 3.13 to matrix; changed Postgres service image from postgres:14-alpine to postgres:alpine.
Tox environments and dependencies
tox.ini
Added py313 across environments; introduced Django 5.2 envs; updated deps to include Django>=5.2,<5.3; minor formatting adjustments; mapped GitHub Actions to py313.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws on fresh new ground,
3.13 hops in with a cheerful sound;
Postgres sheds its alpine coat,
Django 5.2 joins the boat.
Carrots compiled, tests aligned—
CI burrows, green and fine. 🥕✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch support_new_versions

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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

Caution

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

⚠️ Outside diff range comments (2)
.github/workflows/django.yml (1)

44-48: Bump Actions to current majors to ensure Py3.13 availability and security updates.

actions/checkout@v1 and actions/setup-python@v3 are outdated; setup-python@v5 has the freshest toolcache support, including 3.13.

-    - uses: actions/checkout@v1
+    - uses: actions/checkout@v4
@@
-      uses: actions/setup-python@v3
+      uses: actions/setup-python@v5
tox.ini (1)

64-72: Constrain Django 5.1 to 5.1.3+ when running on Py3.13.

Django 5.1 gained official Python 3.13 support in 5.1.3. Add a factor-conditional dep to avoid resolving 5.1.0–5.1.2 under py313. (docs.djangoproject.com)

 deps =
     {[test]deps}
     django32: Django>=3.2,<4.0
     django40: Django>=4.0,<4.1
     django41: Django>=4.1,<4.2
     django42: Django>=4.2,<5.0
     django50: Django>=5.0,<5.1
     django51: Django>=5.1,<5.2
+    py313-django51: Django>=5.1.3,<5.2
     django52: Django>=5.2,<5.3
🧹 Nitpick comments (2)
.github/workflows/django.yml (1)

37-43: Add a MySQL healthcheck to reduce flakiness.

Postgres has a healthcheck; MySQL doesn’t. Add one so tox doesn’t race the service.

       mysql:
         image: mysql
         ports:
         - 3306:3306
         env:
           MYSQL_ROOT_PASSWORD: cities_light
+        options: >-
+          --health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -pcities_light"
+          --health-interval=10s
+          --health-timeout=5s
+          --health-retries=10
tox.ini (1)

72-73: Consider psycopg 3 for Py3.13 and Django ≥4.2.

psycopg2-binary==2.9.9 may lag wheels for newest Python; Django ≥4.2 officially supports psycopg 3. Consider switching to psycopg[binary] (and keep ENGINE=django.db.backends.postgresql). (docs.djangoproject.com)

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b661582 and 615b63d.

📒 Files selected for processing (2)
  • .github/workflows/django.yml (1 hunks)
  • tox.ini (3 hunks)
🔇 Additional comments (2)
.github/workflows/django.yml (1)

22-22: Add Py3.13: OK, but CI will fail against unsupported Django combos unless tox matrix is fixed.

Django 3.2 (max 3.10), 4.0 (max 3.10), 4.1 (max 3.11), and 4.2 (max 3.12) don’t support Python 3.13. Keep 3.13 here, but align tox envlist to only pair 3.13 with Django ≥5.1 (ideally 5.1.3+) and 5.2. (docs.djangoproject.com)

Do you want me to push an updated tox envlist diff?

tox.ini (1)

23-23: GH Actions mapping for 3.13 looks correct.

3.13: py313 enables tox-gh-actions to select all py313-* envs. Good.

services:
postgres:
image: postgres:14-alpine
image: postgres:alpine
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid floating DB image tags; pin Postgres to a major (or digest).

postgres:alpine is mutable and risks flaky CI. Pin to a stable major like postgres:16-alpine (or the project’s required version).

-        image: postgres:alpine
+        image: postgres:16-alpine
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
image: postgres:alpine
image: postgres:16-alpine
🤖 Prompt for AI Agents
.github/workflows/django.yml around line 25: the workflow uses the floating
image tag "postgres:alpine", which is mutable and can cause flaky CI; update the
image to a pinned, stable tag such as "postgres:16-alpine" (or the project's
required major version) or pin to a specific digest; replace the image value
with the chosen pinned tag/digest everywhere it’s used in the workflow to ensure
reproducible builds.

Comment on lines +3 to +9
py{310,311,312, 313}-django52-{sqlite,mysql,postgresql}
py{310,311,312, 313}-django51-{sqlite,mysql,postgresql}
py{310,311,312, 313}-django50-{sqlite,mysql,postgresql}
py{38,39,310,311,312, 313}-django42-{sqlite,mysql,postgresql}
py{38,39,310,311, 313}-django41-{sqlite,mysql,postgresql}
py{38,39,310, 313}-django40-{sqlite,mysql,postgresql}
py{38,39,310, 313}-django32-{sqlite,mysql,postgresql}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix unsupported Python/Django combos that will break CI.

  • py313 must not be paired with Django 3.2/4.0/4.1/4.2/5.0.
  • py313 is supported by Django 5.2, and by Django 5.1 starting from 5.1.3. (docs.djangoproject.com)

Apply:

-    py{310,311,312, 313}-django52-{sqlite,mysql,postgresql}
-    py{310,311,312, 313}-django51-{sqlite,mysql,postgresql}
-    py{310,311,312, 313}-django50-{sqlite,mysql,postgresql}
-    py{38,39,310,311,312, 313}-django42-{sqlite,mysql,postgresql}
-    py{38,39,310,311, 313}-django41-{sqlite,mysql,postgresql}
-    py{38,39,310, 313}-django40-{sqlite,mysql,postgresql}
-    py{38,39,310, 313}-django32-{sqlite,mysql,postgresql}
+    py{310,311,312,313}-django52-{sqlite,mysql,postgresql}
+    py{310,311,312,313}-django51-{sqlite,mysql,postgresql}
+    py{310,311,312}-django50-{sqlite,mysql,postgresql}
+    py{38,39,310,311,312}-django42-{sqlite,mysql,postgresql}
+    py{38,39,310,311}-django41-{sqlite,mysql,postgresql}
+    py{38,39,310}-django40-{sqlite,mysql,postgresql}
+    py{38,39,310}-django32-{sqlite,mysql,postgresql}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
py{310,311,312, 313}-django52-{sqlite,mysql,postgresql}
py{310,311,312, 313}-django51-{sqlite,mysql,postgresql}
py{310,311,312, 313}-django50-{sqlite,mysql,postgresql}
py{38,39,310,311,312, 313}-django42-{sqlite,mysql,postgresql}
py{38,39,310,311, 313}-django41-{sqlite,mysql,postgresql}
py{38,39,310, 313}-django40-{sqlite,mysql,postgresql}
py{38,39,310, 313}-django32-{sqlite,mysql,postgresql}
py{310,311,312,313}-django52-{sqlite,mysql,postgresql}
py{310,311,312,313}-django51-{sqlite,mysql,postgresql}
py{310,311,312}-django50-{sqlite,mysql,postgresql}
py{38,39,310,311,312}-django42-{sqlite,mysql,postgresql}
py{38,39,310,311}-django41-{sqlite,mysql,postgresql}
py{38,39,310}-django40-{sqlite,mysql,postgresql}
py{38,39,310}-django32-{sqlite,mysql,postgresql}
🤖 Prompt for AI Agents
In tox.ini lines 3-9, py313 is incorrectly paired with unsupported Django
versions (3.2, 4.0, 4.1, 4.2, 5.0) which will break CI; remove py313 from the
django32, django40, django41, django42 and django50 envlists and ensure py313
only appears in the django52 envlist (and in django51 only if your project pins
Django>=5.1.3 — otherwise remove it from django51 too); update the envlist
entries accordingly so py313 is only used with supported Django versions.

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