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

django-allauth v64 migration #655

Merged
merged 13 commits into from
Dec 1, 2024

Conversation

dpgraham4401
Copy link
Contributor

@dpgraham4401 dpgraham4401 commented Sep 20, 2024

Description

This PR migrates dj-rest-auth to the newest major version of django-allauth. It, unfortunately, forces `dj-rest-auth to increment the major version since it follows django-allauth support for django, and drops support for django < 4.2.

Related tickets

closes #646

see also #639

Notes

  • fixes a format error that was causing CI to fail from refresh token is not shown in the swagger #247
  • I removed a couple test that were dependent on objects that are no longer exported from django-allauth (see a89f6df)
  • Since these changes add support for django 5.0, it replaces django.utils.timezone usage (which was deprecated in django 4.1 and removed in django 5) with the standard library datetime module (see django deprecateion notice here)
  • I converted the requirement.pip files to requirements.txt file which is newer widely used name. I did this for convenience for my local development environment, but can be reverted. The changes also include changes to the docs.
  • adjust the CI to reflect the removed and added support for django version.

@dpgraham4401 dpgraham4401 marked this pull request as draft September 20, 2024 01:52
@Downchuck
Copy link

@iMerica Checking in on the status of this PR?

@dan-blanchard
Copy link

  • Since these changes add support for django 5.0, it replaces django.utils.timezone usage (which was deprecated in django 4.1 and removed in django 5) with the standard library datetime module (see django deprecateion notice here)

django.utils.timezone was not removed entirely and django.utils.timezone.now is still the recommended way to get tz-aware datetimes in the Django docs. What was removed were a few aliases they had before and supports for pytz. The changes you have related to that are unnecessary, and datetime.utcnow() is actually deprecated and not something that you should be replacing it with (because ironically utcnow() does not get you are tz-aware date).

@iMerica iMerica marked this pull request as ready for review November 30, 2024 23:16
@iMerica
Copy link
Owner

iMerica commented Nov 30, 2024

Can you address merge conflicts?

@dpgraham4401
Copy link
Contributor Author

@iMerica yes, I can address the merge conflicts.

@dpgraham4401 dpgraham4401 force-pushed the allauth_v64_migration branch from 3948e3d to 7e6938b Compare December 1, 2024 15:37
@dpgraham4401
Copy link
Contributor Author

@iMerica this is ready for review

dj_rest_auth/jwt_auth.py Outdated Show resolved Hide resolved
@dpgraham4401 dpgraham4401 force-pushed the allauth_v64_migration branch from 7e6938b to 32831fa Compare December 1, 2024 15:44
@iMerica
Copy link
Owner

iMerica commented Dec 1, 2024

Linter:

dj_rest_auth/tests/test_api.py:531:5: E303 too many blank lines (2)

@dpgraham4401
Copy link
Contributor Author

dpgraham4401 commented Dec 1, 2024

@dan-blanchard I've make the timezone import changes per your docs, thanks for the pointer!

@iMerica I've made a few changes to the flake8 configs that align running the linter locally and in the CI.

  1. update the flake8 version in the various configs (requirements.txt, setup.py). I could not even run flake8 v3 with pyhton 3.12 locally.
  2. Make sure the same version is used in GitHub actions as what's in the requirements.txt file.
  3. I took the liberty of inlining the additional .flake8 config file into setup.cfg, this simplifies the call to lint through just the flake8 CLI and in the tox config and CI definition. However, I can undo this if there was a good reason for these configs to reside in .flake8
  4. Add the socialacount optional dependency group of django-allauth in the test/requirements.txt file so the tests pass.
  5. Add Python 3.12 to the tox GitHub Actions config

@iMerica iMerica merged commit 545fd1f into iMerica:master Dec 1, 2024
10 checks passed
@dpgraham4401 dpgraham4401 deleted the allauth_v64_migration branch December 1, 2024 17:23
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.

django-allauth >= v64.0.0 support
4 participants