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

Upgrade/py3.10 dj3.2 #310

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Spirit documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 24 08:30:18 2017.
Expand Down
14 changes: 6 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Django>=2.2,<3.2
django-haystack==3.0
whoosh==2.7.4
Django>=3.2
django-haystack>=3.0
elasticsearch<8.0,>=7.0 # django-haystack only supports ES<8 (see "https://github.com/django-haystack/django-haystack/blob/master/setup.py")
mistune==0.8.4
Pillow==8.0.1
olefile==0.46
django-infinite-scroll-pagination>=1.1.0,<1.2
django-djconfig>=0.8.0,<0.11
pytz
Pillow>=9.0
django-infinite-scroll-pagination>=1.2
django-djconfig>=0.10.0
2 changes: 0 additions & 2 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

import os
import sys
Expand Down
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

import sys
import os
Expand All @@ -11,12 +9,12 @@

BASE_DIR = os.path.join(os.path.dirname(__file__))

with io.open(os.path.join(BASE_DIR, 'README.md'), encoding='utf-8') as f:
with open(os.path.join(BASE_DIR, 'README.md'), encoding='utf-8') as f:
README = f.read()

VERSION = __import__('spirit').__version__

with io.open(os.path.join(BASE_DIR, 'requirements.txt'), encoding='utf-8') as fh:
with open(os.path.join(BASE_DIR, 'requirements.txt'), encoding='utf-8') as fh:
REQUIREMENTS = fh.read()

if sys.platform.startswith(('win32', 'darwin')):
Expand All @@ -25,7 +23,7 @@
PYTHON_MAGIC_DEP = ['python-magic==0.4.15']

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
os.chdir(os.path.normpath(os.path.join(__file__, os.pardir)))

setup(
name='django-spirit',
Expand Down
2 changes: 0 additions & 2 deletions spirit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

__version__ = '0.12.3'
2 changes: 0 additions & 2 deletions spirit/admin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

default_app_config = 'spirit.admin.apps.SpiritAdminConfig'
2 changes: 0 additions & 2 deletions spirit/admin/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.apps import AppConfig


Expand Down
2 changes: 0 additions & 2 deletions spirit/admin/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django import forms
from django.utils.translation import gettext_lazy as _

Expand Down
2 changes: 0 additions & 2 deletions spirit/admin/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.test import TestCase, RequestFactory
from django.urls import reverse
from django.core.exceptions import PermissionDenied
Expand Down
5 changes: 2 additions & 3 deletions spirit/admin/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

from django.conf.urls import include, re_path
from django.urls import include
from django.conf.urls import re_path

from . import views
import spirit.category.admin.urls
Expand Down
2 changes: 0 additions & 2 deletions spirit/admin/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.shortcuts import render
from django.contrib import messages
from django.utils.translation import gettext as _
Expand Down
2 changes: 0 additions & 2 deletions spirit/category/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

default_app_config = 'spirit.category.apps.SpiritCategoryConfig'
2 changes: 0 additions & 2 deletions spirit/category/admin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

default_app_config = 'spirit.category.admin.apps.SpiritCategoryAdminConfig'
2 changes: 0 additions & 2 deletions spirit/category/admin/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.apps import AppConfig


Expand Down
2 changes: 0 additions & 2 deletions spirit/category/admin/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import re

from django import forms
Expand Down
2 changes: 0 additions & 2 deletions spirit/category/admin/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import datetime

from django.test import TestCase, RequestFactory, override_settings
Expand Down
2 changes: 0 additions & 2 deletions spirit/category/admin/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.conf.urls import re_path

from ...core.conf import settings
Expand Down
2 changes: 0 additions & 2 deletions spirit/category/admin/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth import get_user_model
from django.urls import reverse
Expand Down
2 changes: 0 additions & 2 deletions spirit/category/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.apps import AppConfig


Expand Down
2 changes: 0 additions & 2 deletions spirit/category/managers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.db import models
from django.db.models import Q

Expand Down
1 change: 0 additions & 1 deletion spirit/category/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import models, migrations
import spirit.core.utils.models

Expand Down
1 change: 0 additions & 1 deletion spirit/category/migrations/0002_auto_20150728_0442.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import models, migrations


Expand Down
1 change: 0 additions & 1 deletion spirit/category/migrations/0003_category_is_global.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import models, migrations


Expand Down
1 change: 0 additions & 1 deletion spirit/category/migrations/0004_category_color.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import migrations, models


Expand Down
1 change: 0 additions & 1 deletion spirit/category/migrations/0005_category_reindex_at.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import migrations, models
import django.utils.timezone

Expand Down
2 changes: 0 additions & 2 deletions spirit/category/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.db import models
from django.utils.translation import gettext_lazy as _
from django.urls import reverse
Expand Down
2 changes: 0 additions & 2 deletions spirit/category/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import datetime
import importlib

Expand Down
2 changes: 0 additions & 2 deletions spirit/category/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.conf.urls import re_path

from . import views
Expand Down
2 changes: 0 additions & 2 deletions spirit/category/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.views.generic import ListView
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponsePermanentRedirect
Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

default_app_config = 'spirit.comment.apps.SpiritCommentConfig'
2 changes: 0 additions & 2 deletions spirit/comment/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.apps import AppConfig


Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/bookmark/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

default_app_config = 'spirit.comment.bookmark.apps.SpiritCommentBookmarkConfig'
2 changes: 0 additions & 2 deletions spirit/comment/bookmark/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.apps import AppConfig


Expand Down
4 changes: 1 addition & 3 deletions spirit/comment/bookmark/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django import forms

from .models import CommentBookmark
Expand All @@ -12,7 +10,7 @@ class Meta:
fields = ['comment_number']

def __init__(self, user=None, topic=None, *args, **kwargs):
super(BookmarkForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self.user = user
self.topic = topic

Expand Down
3 changes: 1 addition & 2 deletions spirit/comment/bookmark/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import models, migrations
from django.conf import settings

Expand Down Expand Up @@ -26,6 +25,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='commentbookmark',
unique_together=set([('user', 'topic')]),
unique_together={('user', 'topic')},
),
]
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import models, migrations
from django.conf import settings

Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/bookmark/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.db import models
from django.utils.translation import gettext_lazy as _

Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/bookmark/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.test import TestCase
from django.urls import reverse
from django.template import Template, Context
Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/bookmark/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.conf.urls import re_path

from . import views
Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/bookmark/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404
from django.shortcuts import redirect
Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/flag/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

default_app_config = 'spirit.comment.flag.apps.SpiritCommentFlagConfig'
2 changes: 0 additions & 2 deletions spirit/comment/flag/admin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

default_app_config = 'spirit.comment.flag.admin.apps.SpiritCommentFlagAdminConfig'
2 changes: 0 additions & 2 deletions spirit/comment/flag/admin/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.apps import AppConfig


Expand Down
6 changes: 2 additions & 4 deletions spirit/comment/flag/admin/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django import forms

from ..models import CommentFlag
Expand All @@ -12,9 +10,9 @@ class Meta:
fields = ("is_closed", )

def __init__(self, user=None, *args, **kwargs):
super(CommentFlagForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self.user = user

def save(self, commit=True):
self.instance.moderator = self.user
return super(CommentFlagForm, self).save(commit)
return super().save(commit)
2 changes: 0 additions & 2 deletions spirit/comment/flag/admin/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.conf.urls import re_path

from . import views
Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/flag/admin/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from django.contrib import messages
Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/flag/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.apps import AppConfig


Expand Down
8 changes: 3 additions & 5 deletions spirit/comment/flag/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django import forms
from django.utils.translation import gettext_lazy as _
from django.db import IntegrityError, transaction
Expand All @@ -15,12 +13,12 @@ class Meta:
fields = ['reason', 'body']

def __init__(self, user=None, comment=None, *args, **kwargs):
super(FlagForm, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self.user = user
self.comment = comment

def clean(self):
cleaned_data = super(FlagForm, self).clean()
cleaned_data = super().clean()

flag = Flag.objects.filter(user=self.user,
comment=self.comment)
Expand All @@ -44,4 +42,4 @@ def save(self, commit=True):
except IntegrityError:
pass

return super(FlagForm, self).save(commit)
return super().save(commit)
3 changes: 1 addition & 2 deletions spirit/comment/flag/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
Expand Down Expand Up @@ -45,6 +44,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='flag',
unique_together=set([('user', 'comment')]),
unique_together={('user', 'comment')},
),
]
1 change: 0 additions & 1 deletion spirit/comment/flag/migrations/0002_auto_20150828_2003.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import models, migrations
from django.conf import settings

Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/flag/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.db import models
from django.utils.translation import gettext_lazy as _
from django.utils import timezone
Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/flag/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.test import TestCase
from django.urls import reverse

Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/flag/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.conf.urls import re_path

from . import views
Expand Down
2 changes: 0 additions & 2 deletions spirit/comment/flag/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404

Expand Down
Loading