Skip to content
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

Add support for DRF 3.15, drop Django <4.2 and DRF <3.14 #186

Merged
merged 14 commits into from
Oct 29, 2024

Conversation

browniebroke
Copy link
Contributor

Builds on top of #183

Copy link

codecov bot commented Jul 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.23%. Comparing base (6b24fae) to head (fc2a87f).
Report is 15 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #186   +/-   ##
=======================================
  Coverage   98.23%   98.23%           
=======================================
  Files           3        3           
  Lines         227      227           
=======================================
  Hits          223      223           
  Misses          4        4           
Flag Coverage Δ
unittests 98.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

py{37,38,39,310,311}-dj{31,32}-drf{311,312,313,314}-{pytest,mypy}
py{38,39,310,311}-dj{40,41}-drf{313,314}-{pytest,mypy}
py{38,39,310,311}-dj{42}-drf{314}-{pytest,mypy}
py{38,39,310,311,312}-dj42-drf{314,315}-pytest
Copy link
Member

Choose a reason for hiding this comment

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

@browniebroke Why do you remove mypy checks here and in the next line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding was that DRF stubs (and django-stubs) are now linked to a specific version of DRF and Django. So you should ideally have stubs version == DRF version. This was changed in https://github.com/typeddjango/djangorestframework-stubs/releases/tag/3.14.0 and https://github.com/typeddjango/django-stubs/releases/tag/4.2.0

When you install djangorestframework-stubs==3.15.*, it installs django-stubs==5.0.*, which are for DRF 3.15 and Django 5.0 respectively. Although I just noticed that django-stubs=5.0.x has "partial" support for Django 4.2...

I suppose the problem with running mypy against the wrong versions is that the type check won't find type issues if the stubs are for a different version? What I mean is that if a Django API changed its signature between 4.2 and 5.0, but the stubs used by mypy are for v5, mypy won't detect the problem with 4.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can try to add them back if you still want them?

@browniebroke browniebroke requested a review from ir4y October 4, 2024 00:11
@ir4y
Copy link
Member

ir4y commented Oct 4, 2024

@ruscoder Could you please have a final look on this pull request and merge?

@ir4y ir4y requested a review from ruscoder October 4, 2024 00:29
@ruscoder ruscoder merged commit e12b356 into beda-software:master Oct 29, 2024
7 checks passed
@ruscoder
Copy link
Member

Hi @browniebroke, thanks for the contribution, merged. I'll publish a new release as 0.7.1

@browniebroke browniebroke deleted the upgrade-drf-315 branch October 29, 2024 06:58
@browniebroke
Copy link
Contributor Author

Thanks!

Since I opened this, Python 3.8 reached EOL, Python 3.13 was released as well as Django 5.1, so I've just opened a couple of follow up PRs to update CI and package metadata:

Should be pretty similar to this one.

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