Skip to content

Commit ee906af

Browse files
author
mizvyt
committed
Drop support for python 2, enforce python >=3.5
1 parent 231d4b0 commit ee906af

File tree

10 files changed

+6
-26
lines changed

10 files changed

+6
-26
lines changed

rest_framework_social_oauth2/authentication.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
try:
42
from django.urls import reverse
53
except ImportError: # Will be removed in Django 2.0

rest_framework_social_oauth2/backends.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
try:
42
from django.urls import reverse
53
except ImportError: # Will be removed in Django 2.0

rest_framework_social_oauth2/management/commands/createapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from django.contrib.auth.models import User
12
from django.core.management.base import BaseCommand, CommandError
23
from oauth2_provider.models import Application
3-
from django.contrib.auth.models import User
44
from oauth2_provider.generators import generate_client_id, generate_client_secret
55

66

rest_framework_social_oauth2/oauth2_backends.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
3-
from __future__ import unicode_literals
4-
51
from oauth2_provider.oauth2_backends import OAuthLibCore
62
from oauth2_provider.settings import oauth2_settings
73

rest_framework_social_oauth2/oauth2_endpoints.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
3-
from __future__ import unicode_literals
4-
51
import logging
62

73
from django.http import HttpRequest

rest_framework_social_oauth2/oauth2_grants.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
3-
from __future__ import unicode_literals
4-
51
import logging
62

73
try:

rest_framework_social_oauth2/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
from django.conf import settings
32

43
DRFSO2_PROPRIETARY_BACKEND_NAME = getattr(settings, 'DRFSO2_PROPRIETARY_BACKEND_NAME', "Django")

rest_framework_social_oauth2/urls.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
from django.conf.urls import url, include
42
from oauth2_provider.views import AuthorizationView
53

rest_framework_social_oauth2/views.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
import json
32

43
from braces.views import CsrfExemptMixin
@@ -8,10 +7,7 @@
87
from social_django.utils import load_strategy, load_backend
98
from social_django.views import NAMESPACE
109

11-
try:
12-
from oauth2_provider.contrib.rest_framework import OAuth2Authentication
13-
except ImportError:
14-
from oauth2_provider.ext.rest_framework import OAuth2Authentication
10+
from oauth2_provider.contrib.rest_framework import OAuth2Authentication
1511
from oauth2_provider.models import Application, AccessToken
1612
from oauth2_provider.settings import oauth2_settings
1713
from oauth2_provider.views.mixins import OAuthLibMixin

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
from setuptools import setup, find_packages
2+
import sys
3+
4+
if sys.version_info < (3, 5):
5+
raise SystemError("This package is for Python 3.5 and above.")
26

37
setup(
48
name='django-rest-framework-social-oauth2',
@@ -15,7 +19,6 @@
1519
"Environment :: Web Environment",
1620
"Framework :: Django",
1721
"License :: OSI Approved :: MIT License",
18-
"Programming Language :: Python :: 2.7",
1922
"Programming Language :: Python :: 3",
2023
"Topic :: Internet :: WWW/HTTP",
2124
"Topic :: Software Development :: Libraries :: Python Modules",

0 commit comments

Comments
 (0)