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

support django 4.0.0 #1046

Closed
wants to merge 1 commit into from
Closed

support django 4.0.0 #1046

wants to merge 1 commit into from

Conversation

dulmandakh
Copy link
Contributor

Description of the Change

When I try do install django-oauth-toolkit using Poetry I get following error. So this PR fixes django 4.0.0 support.

SolverProblemError

  Because no versions of django-oauth-toolkit match >1.6.0,<2.0.0
   and django-oauth-toolkit (1.6.0) depends on django (>=2.2,<4.0.0 || >4.0.0), django-oauth-toolkit (>=1.6.0,<2.0.0) requires django (>=2.2,<4.0.0 || >4.0.0).
  And because no versions of django match >4.0.0,<5.0, django-oauth-toolkit (>=1.6.0,<2.0.0) requires Django (>=2.2,<4.0.0 || >=5.0).
  So, because backend depends on both Django (^4.0) and django-oauth-toolkit (^1.6.0), version solving failed.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@codecov
Copy link

codecov bot commented Dec 20, 2021

Codecov Report

Merging #1046 (43f4fea) into master (6aeb1b2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1046   +/-   ##
=======================================
  Coverage   96.64%   96.64%           
=======================================
  Files          31       31           
  Lines        1756     1756           
=======================================
  Hits         1697     1697           
  Misses         59       59           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6aeb1b2...43f4fea. Read the comment docs.

@n2ygk n2ygk added this to the 1.6.1 milestone Dec 20, 2021
@n2ygk n2ygk added the bug label Dec 20, 2021
@Andrew-Chen-Wang
Copy link
Member

Andrew-Chen-Wang commented Dec 20, 2021

Django 4.0.0 support will not be included due to a regression that caused a migration file to be created. My past experience indicates many devs actually create and migrate these in their virtual environments on production. When Django 4.0.1 is released, those who upgrade their Django will have migration errors if we allow support of Django 4.0.0.

Thanks for understanding. 4.0.1 should be released soon anyways.

@n2ygk
Copy link
Member

n2ygk commented Dec 20, 2021

@Andrew-Chen-Wang the problem is that we are incorrectly reporting 4.0 support in setup.cfg:

        Framework :: Django :: 4.0

So we should undo that and anywhere else where it's happening.

Also, how is it that the 4.0 tox tests are succeeding?

@Andrew-Chen-Wang
Copy link
Member

Andrew-Chen-Wang commented Dec 20, 2021

tl;dr The trove classifier should stay as is since 4.0.1+ is supported, just not released, but a new release of this package just to update a trove classifier is unnecessary. 4.0.0 is technically compatible, and that's why tox still runs fine with 4.0.0. What will be a massive future headache is when people make migrations on production in a virtual environment. I'd like to avoid that. Ref past headache; this package will have it worse because it's a foreign key


@n2ygk there is no user behavior that makes 4.0.0 incompatible with django-oauth-toolkit. The problem is that a new migration file can be created. If you have a custom User model, the new migration will cause the foreign key on one of the django-oauth-toolkit tables to reference auth.user. But if you don't use that table, then your production environment is broken (unless the package makes changes so that your accidental migration file won't break on a future package release, ref). If you're careful, you won't create the migration file; if not, your production will go down on Django 4.0.1+ release.

In our tox environment, we don't have a custom user model. There is no API that has changed, so I left the 4.0 tox running.

So we should undo that and anywhere else where it's happening.

Perhaps...? It definitely causes confusion given 4.0.1 isn't released, but I don't really think a patch version just to say "4.0 is supported" in the trove classifier is necessary. In other words, I think leaving as is is the best option.

@Andrew-Chen-Wang
Copy link
Member

@dulmandakh Apologies for the poetry resolving problem. Poetry should have a feature to allow you to install django-oauth-toolkit from git. Install at a commit that does not include our new setup.cfg change and you should be good to go with your current production. After Django 4.0.1 release, revert back to package version number in poetry config. Sorry!

@n2ygk
Copy link
Member

n2ygk commented Dec 20, 2021

Closing this PR as it won't be merged.

@n2ygk n2ygk closed this Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants