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 3.1 support #6886

Merged
merged 26 commits into from Sep 3, 2020
Merged

Conversation

FinalAngel
Copy link
Member

@FinalAngel FinalAngel commented Aug 6, 2020

  • Added support for Django 3.1
  • Dropped support for Python 2.7 and Python 3.4
  • Dropped support for Django < 2.2

@coveralls
Copy link

coveralls commented Aug 6, 2020

Coverage Status

Coverage remained the same at 78.215% when pulling 1f9862a on FinalAngel:feature/django31 into aab6a4a on divio:develop.

@FinalAngel
Copy link
Member Author

@yakky and @Aiky30 would you be able to have a first look at the code? Overall it works so far, upgrading the other addons according to this.

@yakky
Copy link
Member

yakky commented Aug 13, 2020

@FinalAngel it looks straighforward to me 👍

Copy link
Contributor

@Aiky30 Aiky30 left a comment

Choose a reason for hiding this comment

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

I need to spend a bit of time trying to find any occurrences of anything that you've removed. Looks OK so far but would like to look back again.

@@ -59,7 +57,7 @@ def _verify_apphook(apphook, namespace):
apphook_name = apphook.__class__.__name__
elif hasattr(apphook, '__module__') and issubclass(apphook, CMSApp):
return apphook.__name__
elif isinstance(apphook, string_types):
elif isinstance(apphook, str):
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this is ok for Strings, I know you can't do this with list because Strings can be True when checking against a type of List.

Copy link
Member Author

Choose a reason for hiding this comment

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

string_types is equivalent to str in Python 3

@@ -9,7 +9,7 @@
import django
from django.contrib.admin.helpers import AdminForm
from django.conf import settings
from django.conf.urls import url
from django.urls import re_path
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess to ensure that the codebase worked as it did re_path is the same as url was, it is recommended to switch out to path but I think migrations like this should be staged and maybe pencil something in for a future change to use path vs re_path.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah some could potentially be migrated to django.urls.path but in this case we just want to be sure


class StaticFilesTest(TestCase):

def test_collectstatic_with_cached_static_files_storage(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this test removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Aiky30 it tests for django.contrib.staticfiles.storage.CachedStaticFilesStorage which has been removed in Django 3.1

setup.py Outdated Show resolved Hide resolved
@@ -24,8 +26,6 @@
from django.views.decorators.clickjacking import xframe_options_sameorigin
from django.views.decorators.http import require_POST

from six.moves.urllib.parse import parse_qsl, urlparse

from six import get_unbound_function, get_method_function
Copy link
Contributor

Choose a reason for hiding this comment

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

From what I can see in the diff six looks to be installed just for these two imports, I assume logic that was for 2 that needs to still work in 3.

Copy link
Member Author

Choose a reason for hiding this comment

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

six is now fully removed :)

@yakky
Copy link
Member

yakky commented Aug 21, 2020

Just dropping a comment here, I need to investigate further

django.core.management.base import CommandParser no longer accept cmd kwarg, so we must adapt cms.management.commands.subcommands.SubcommandsCommand

@yakky
Copy link
Member

yakky commented Aug 24, 2020 via email

@FinalAngel
Copy link
Member Author

@yakky wehee a passing build :D

@FinalAngel
Copy link
Member Author

@yakky or @jrief please approve if it can land :)

@yakky yakky self-requested a review September 3, 2020 08:41
@yakky
Copy link
Member

yakky commented Sep 3, 2020

@FinalAngel 👍 from me

@FinalAngel FinalAngel changed the title WIP: Django 3.1 support Django 3.1 support Sep 3, 2020
@FinalAngel FinalAngel merged commit e428cb3 into django-cms:develop Sep 3, 2020
@FinalAngel FinalAngel deleted the feature/django31 branch September 3, 2020 08:55
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.

None yet

4 participants