Skip to content

feat: add support for Python 3.13 and Django 5.2#81

Merged
zsoldosp merged 2 commits intozsoldosp:masterfrom
bartvanandel:feat/support-python313-django52
Apr 8, 2025
Merged

feat: add support for Python 3.13 and Django 5.2#81
zsoldosp merged 2 commits intozsoldosp:masterfrom
bartvanandel:feat/support-python313-django52

Conversation

@bartvanandel
Copy link
Contributor

Fixes #80

@bartvanandel
Copy link
Contributor Author

Note: according to the official Django download page, 5.2 will be the last version in the 5.x series. So the version constraint uses this logic.

Many other packages don't even restrict Django versions, they may give a lower limit to the version number, but no upper limit. But provided that PRs like this one can be picked up quickly, more strict version limits may be safer (plus, there's that DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO environment variable).

@zsoldosp
Copy link
Owner

zsoldosp commented Apr 7, 2025

@bartvanandel thank you! The PR is almost perfect, and on your first attempt! kudos & much appreciated!

One thing missing was that as per https://www.djangoproject.com/download/#supported-versions, 5.0 is not supported anymore asof April (though confusing, as https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django still lists it). This would suggest to change the version number to 0.9.0 rather to indicate this change.

The other missing update is due to adding support python3.13, which would require the CI build to be updated .github/workflows/tox.yml would also need the python 3.13 entry

Can you make those changes or should I do those? I'm happy to do it either way

@bartvanandel bartvanandel force-pushed the feat/support-python313-django52 branch from ff882b9 to 9607d5e Compare April 7, 2025 11:38
@bartvanandel
Copy link
Contributor Author

bartvanandel commented Apr 7, 2025

@bartvanandel thank you! The PR is almost perfect, and on your first attempt! kudos & much appreciated!

Thanks! I've been around for some time, good thing that it's paying off 😃

And thank you for your quick reply!

One thing missing was that as per https://www.djangoproject.com/download/#supported-versions, 5.0 is not supported anymore asof April (though confusing, as https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django still lists it). This would suggest to change the version number to 0.9.0 rather to indicate this change.

Not really. The fact that Django support stopped for 5.0 doesn't mean that it's a breaking change for django-currentuser. This is just a backward-compatible metadata patch, no code was even changed. See also semver. But if you think 0.9.0 is more appropriate, I can change it of course.

The other missing update is due to adding support python3.13, which would require the CI build to be updated .github/workflows/tox.yml would also need the python 3.13 entry

Ah, missed that one. I've updated the PR.

@zsoldosp
Copy link
Owner

zsoldosp commented Apr 7, 2025

One thing missing was that [...] 5.0 is not supported anymore asof April [...]

Not really. The fact that Django support stopped for 5.0 doesn't mean that it's a breaking change for django-currentuser. Nothing was removed (definitely no breaking changes), nothing major was even added, everything is still compatible with older versions, so a small increase should be fine.

I'd consider this change just a patch, not even a minor update, no code was even changed, just metadata. See also semver. But if you think 0.9.0 is more appropriate, I can change it of course.

I understand your reasoning, and I've been of a similar mindset in the past - why not support something that works with no extra effort. Theoretically, this code still might run with python 2.7... However, when something breaks, do I remove it only then? And if/when people complain why support was removed? Given that Django has a lifecycle, and it's a Django plugin, I just chose to follow the main project's lead, that way there is no confusion. And while I have worked on unsupported legacy code version projects in the past, DJANGO_CURRENTUSER_USE_UNSUPPORTED_DJANGO adequately supports that scenario so if someone needs to, they can run it with 5.0.

So django 5.0 support should be dropped, and as it's pre 1.0 (though probably should bump it to 1.0 at some point, as the code hasn't changed) and that's how prior drops for versions were versioned

But I'm happy to merge it as is, and change the version/support matrix in a following PR (won't be able to release it today anyway)

The other missing update is due to adding support python3.13, which would require the CI build to be updated .github/workflows/tox.yml would also need the python 3.13 entry

Ah, missed that one. I've updated the PR.

thanks!

@bartvanandel
Copy link
Contributor Author

bartvanandel commented Apr 7, 2025

I'll patch it, it's fine. People can stick with the current version anyway.

I'll remove Python 3.8 from the matrix as well then, since it went EOL six months ago. Nice and clean.

BREAKING CHANGES:
- Drop support for Python 3.8 and Django 5.0, both have reached EOL.
@bartvanandel
Copy link
Contributor Author

@zsoldosp Done.

I have another commit ready which updates all dev dependencies to their latest versions, including setuptools, tox and docutils, cleaning up tox.ini a bit more in the process. I can either add it to this PR (though somewhat unrelated), or create a new PR after this one has been merged, whichever you prefer.

@zsoldosp
Copy link
Owner

zsoldosp commented Apr 7, 2025 via email

@zsoldosp zsoldosp merged commit b97c505 into zsoldosp:master Apr 8, 2025
5 checks passed
@zsoldosp zsoldosp mentioned this pull request Apr 8, 2025
@zsoldosp
Copy link
Owner

zsoldosp commented Apr 8, 2025

released to pypi

@bartvanandel bartvanandel deleted the feat/support-python313-django52 branch April 8, 2025 15:52
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.

Compatubility against Django 5.2

2 participants