-
Notifications
You must be signed in to change notification settings - Fork 128
Support new versions Django 5.2 and python 3.13 #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughAdds 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
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
andactions/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@v5tox.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=10tox.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 topsycopg[binary]
(and keepENGINE=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.
📒 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 allpy313-*
envs. Good.
services: | ||
postgres: | ||
image: postgres:14-alpine | ||
image: postgres:alpine |
There was a problem hiding this comment.
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.
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.
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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Summary by CodeRabbit