Skip to content

Commit

Permalink
Fixes #676 - Remove reference to django2.2 (#677)
Browse files Browse the repository at this point in the history
* Fixes #676 - Remove reference to django2.2

Support for django 2.2 has come and gone. Let's move forwards.
Commit removes references of django 2.2 as well as removing compatibility code found in compat.py.
* Remove reference to django.core.urlresolvers (depricated django 1.10)
* Remove CallableBool

Tests have been update to reflect code changes.

* Remove Django 2.2 from CI

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 26, 2023
1 parent b0b8d1e commit 60ab226
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 70 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ jobs:
max-parallel: 5
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
django-version: ['2.2', '3.2', '4.0', '4.1', 'main']
django-version: ['3.2', '4.0', '4.1']
drf-version: ['3.10', '3.11', '3.12', '3.13']
exclude:
- python-version: '3.7'
django-version: 'main'
- python-version: '3.10'
django-version: '2.2'

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ build-docs:
tests/* \
rest_framework_simplejwt/token_blacklist/* \
rest_framework_simplejwt/backends.py \
rest_framework_simplejwt/compat.py \
rest_framework_simplejwt/exceptions.py \
rest_framework_simplejwt/settings.py \
rest_framework_simplejwt/state.py
Expand Down
55 changes: 0 additions & 55 deletions rest_framework_simplejwt/compat.py

This file was deleted.

5 changes: 2 additions & 3 deletions rest_framework_simplejwt/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from django.db.models.manager import EmptyManager
from django.utils.functional import cached_property

from .compat import CallableFalse, CallableTrue
from .settings import api_settings


Expand Down Expand Up @@ -95,11 +94,11 @@ def has_module_perms(self, module):

@property
def is_anonymous(self):
return CallableFalse
return False

@property
def is_authenticated(self):
return CallableTrue
return True

def get_username(self):
return self.username
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from datetime import timedelta

from django.contrib.auth import get_user_model
from django.urls import reverse

from rest_framework_simplejwt.compat import reverse
from rest_framework_simplejwt.settings import api_settings
from rest_framework_simplejwt.tokens import AccessToken

Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from django.db import connection
from django.db.migrations.executor import MigrationExecutor
from django.test import TestCase, TransactionTestCase
from django.urls import reverse
from rest_framework.test import APIClient

from rest_framework_simplejwt.compat import reverse
from rest_framework_simplejwt.settings import api_settings


Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ python=

[gh-actions:env]
DJANGO=
2.2: dj22
3.2: dj32
4.0: dj40
4.1: dj41
Expand All @@ -35,7 +34,6 @@ extras=
setenv=
PYTHONDONTWRITEBYTECODE=1
deps=
dj22: Django>=2.2,<2.3
dj32: Django>=3.2,<3.3
dj40: Django>=4.0,<4.1
dj41: Django>=4.1,<4.2
Expand Down

0 comments on commit 60ab226

Please sign in to comment.