Add support for DRF 3.15, drop Django <4.2 and DRF <3.14#186
Add support for DRF 3.15, drop Django <4.2 and DRF <3.14#186ruscoder merged 14 commits intobeda-software:masterfrom
Conversation
error: "type[UFMChild]" has no attribute "objects" [attr-defined] It's a Django model, this attribute exists...
# Conflicts: # tox.ini
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| 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 |
There was a problem hiding this comment.
@browniebroke Why do you remove mypy checks here and in the next line?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I can try to add them back if you still want them?
|
@ruscoder Could you please have a final look on this pull request and merge? |
|
Hi @browniebroke, thanks for the contribution, merged. I'll publish a new release as 0.7.1 |
|
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. |
Builds on top of #183