Skip to content

Drop support for Django 4.2#897

Open
p-r-a-v-i-n wants to merge 4 commits intostrawberry-graphql:mainfrom
p-r-a-v-i-n:drop-django4.2
Open

Drop support for Django 4.2#897
p-r-a-v-i-n wants to merge 4 commits intostrawberry-graphql:mainfrom
p-r-a-v-i-n:drop-django4.2

Conversation

@p-r-a-v-i-n
Copy link
Copy Markdown

@p-r-a-v-i-n p-r-a-v-i-n commented Apr 1, 2026

Description

Django 4.2 will reach end of support on April 30, 2026.

I’m opening this PR early so we can prepare for removing support without any rush.

source: https://endoflife.date/django

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Summary by Sourcery

Drop support for Django 4.2 across the project and standardize on Django 5.0+.

Enhancements:

  • Raise the minimum supported Django version to 5.0 in project dependencies and metadata.

Build:

  • Update packaging metadata to remove Django 4.2 classifier and require Django 5.0 or newer.

CI:

  • Remove Django 4.2 from the CI test matrix and its related Python version exclusions.

Documentation:

  • Update internal contributor documentation to describe the new Django 5.0–6.0 CI support matrix.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 1, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Drops Django 4.2 from the supported/tested matrix and raises the minimum Django version to 5.0 in packaging metadata, keeping CI, metadata, and docs aligned on Django 5.0–6.0 support.

File-Level Changes

Change Details Files
Update CI test matrix to stop running against Django 4.2.
  • Remove Django 4.2 from the list of Django versions in the GitHub Actions tests workflow matrix.
  • Delete Django 4.2-specific Python version exclusions that are no longer needed once 4.2 is removed.
.github/workflows/tests.yml
Raise the declared minimum supported Django version to 5.0 in packaging metadata.
  • Drop the Django 4.2 classifier from the project metadata.
  • Change the Django dependency lower bound from 4.2 to 5.0 while keeping other dependencies unchanged.
pyproject.toml
Align contributor documentation with the new Django support range.
  • Update the CI & Releases section to state that the matrix now covers Django 5.0–6.0 instead of 4.2–6.0.
AGENTS.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@botberry
Copy link
Copy Markdown
Member

botberry commented Apr 1, 2026

Thanks for adding the RELEASE.md file!

Below is the changelog that will be used for the release.


Drop support for Django 4.2.

  • Django 4.2 will reach end of support on April 30, 2026. check here

This release was contributed by @p-r-a-v-i-n in #897

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="pyproject.toml" line_range="34" />
<code_context>
 ]
 requires-python = ">=3.10,<4.0"
-dependencies = ["django>=4.2", "asgiref>=3.8", "strawberry-graphql>=0.310.1"]
+dependencies = ["django>=5.0", "asgiref>=3.8", "strawberry-graphql>=0.310.1"]

 [project.urls]
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Align Django dependency range with the explicitly supported versions to avoid accidental incompatibilities with future major releases.

Classifiers state support only up to Django 6.0, but the dependency is unbounded on the upper end (`django>=5.0`). If you don’t intend to guarantee compatibility with Django 7+, please cap it (e.g. `django>=5.0,<7.0`) to match the stated support and avoid breakages on future major releases.

```suggestion
dependencies = ["django>=5.0,<7.0", "asgiref>=3.8", "strawberry-graphql>=0.310.1"]
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread pyproject.toml
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.61%. Comparing base (f660c3b) to head (c84c7ec).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #897      +/-   ##
==========================================
- Coverage   91.62%   91.61%   -0.02%     
==========================================
  Files          51       51              
  Lines        4632     4625       -7     
==========================================
- Hits         4244     4237       -7     
  Misses        388      388              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@bellini666 bellini666 left a comment

Choose a reason for hiding this comment

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

Nice! :)

You can probably update https://github.com/strawberry-graphql/strawberry-django/blob/main/.pre-commit-config.yaml#L42-L42 as well to target 5.0 and run it to see if it changes anything

@bellini666
Copy link
Copy Markdown
Member

Also, create a RELEASE.md so it can be released: #897 (comment)

@p-r-a-v-i-n
Copy link
Copy Markdown
Author

Nice! :)

You can probably update https://github.com/strawberry-graphql/strawberry-django/blob/main/.pre-commit-config.yaml#L42-L42 as well to target 5.0 and run it to see if it changes anything

this was indeed critical.

@p-r-a-v-i-n
Copy link
Copy Markdown
Author

Hey @bellini666 ,
I never used autopub/autopub-action and i also know nothing about it. I'm really curious to know how does this work ?

  • Does it create a release each time with new version string ?

Do you mind giving me some information about this ?

@bellini666
Copy link
Copy Markdown
Member

bellini666 commented Apr 5, 2026

Hey @bellini666 , I never used autopub/autopub-action and i also know nothing about it. I'm really curious to know how does this work ?

  • Does it create a release each time with new version string ?

Do you mind giving me some information about this ?

Np! :)

In short, by having RELEASE.md when this gets merged, it will automatically turn into a new release.

Like this, turned into this release (this is the commit it creates where it also removes the file: 60e8869)

regarding what you added here, 2 asks:

  1. Make it a minor, because we have not released 1.0 yet. Otherwise it would =P
  2. Can you add a little bit of explanation to "why" we are dropping it? Like "Django 4.2 reaches EOL on April 30, 2026, ..."

@bellini666
Copy link
Copy Markdown
Member

Thanks! ❤️

I'll wait and merge this on April 30th

@p-r-a-v-i-n
Copy link
Copy Markdown
Author

p-r-a-v-i-n commented Apr 5, 2026

Thanks! ❤️

I'll wait and merge this on April 30th

That's fair. If anything is there before merging please let me know, I will be happy to addressed it.

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.

3 participants