Skip to content

Commit

Permalink
Sort imports using isort
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandgeider committed Jun 28, 2020
1 parent 9e0f427 commit dcd3163
Show file tree
Hide file tree
Showing 200 changed files with 409 additions and 320 deletions.
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Standard Library
import sys

# Third Party
# Django
from django.core.management import execute_from_command_line

# wger
Expand Down
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ line_length=119
# A comment to consistently place directly above future imports.
import_heading_future=Future

# A comment to consistently place directly above django imports.
import_heading_django=Django

# A comment to consistently place directly above imports from the standard library.
import_heading_stdlib=Standard Library

# A comment to consistently place directly above thirdparty imports.
import_heading_thirdparty=Third Party

# A comment to consistently place directly above imports from the current
# project.
# A comment to consistently place directly above wger imports.
import_heading_firstparty=wger

# A comment to consistently place directly above imports that start with '.'.
Expand All @@ -60,6 +62,7 @@ indent=' '
# A list of imports that will be forced to display withing the first party
# category.
known_first_party=wger
known_django=django

# An integer that represents how you want imports to be displayed if their long
# enough to span multiple lines. A full definition of all possible modes can be
Expand Down
2 changes: 2 additions & 0 deletions wger/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.


# wger
from wger import get_version


VERSION = get_version()
default_app_config = 'wger.config.apps.ConfigConfig'
2 changes: 1 addition & 1 deletion wger/config/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU Affero General Public License

# Third Party
# Django
from django.apps import AppConfig


Expand Down
2 changes: 1 addition & 1 deletion wger/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Standard Library
import logging

# Third Party
# Django
from django.core.cache import cache
from django.db import models
from django.utils.translation import ugettext_lazy as _
Expand Down
2 changes: 1 addition & 1 deletion wger/config/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License


# Third Party
# Django
from django.db.models.signals import post_save
from django.dispatch import receiver

Expand Down
2 changes: 1 addition & 1 deletion wger/config/tests/test_custom_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.

# Third Party
# Django
from django.urls import reverse

# wger
Expand Down
2 changes: 1 addition & 1 deletion wger/config/tests/test_gym_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.

# Third Party
# Django
from django.contrib.auth.models import User
from django.urls import reverse

Expand Down
2 changes: 1 addition & 1 deletion wger/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.

# Third Party
# Django
from django.conf.urls import (
include,
url
Expand Down
2 changes: 1 addition & 1 deletion wger/config/views/gym_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Standard Library
import logging

# Third Party
# Django
from django.urls import (
reverse,
reverse_lazy
Expand Down
2 changes: 1 addition & 1 deletion wger/config/views/language_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Standard Library
import logging

# Third Party
# Django
from django.contrib.auth.mixins import (
LoginRequiredMixin,
PermissionRequiredMixin
Expand Down
2 changes: 2 additions & 0 deletions wger/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.


# wger
from wger import get_version


VERSION = get_version()
default_app_config = 'wger.core.apps.CoreConfig'
4 changes: 3 additions & 1 deletion wger/core/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
# You should have received a copy of the GNU Affero General Public License
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.

# Third Party
# Django
from django.contrib.auth.models import User

# Third Party
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
Expand Down
2 changes: 1 addition & 1 deletion wger/core/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU Affero General Public License

# Third Party
# Django
from django.apps import AppConfig


Expand Down
2 changes: 1 addition & 1 deletion wger/core/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import random
import uuid

# Third Party
# Django
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
Expand Down
6 changes: 4 additions & 2 deletions wger/core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#
# You should have received a copy of the GNU Affero General Public License

# Third Party
from captcha.fields import ReCaptchaField
# Django
from django import forms
from django.contrib.auth.forms import (
AuthenticationForm,
Expand All @@ -32,6 +31,9 @@
)
from django.utils.translation import ugettext as _

# Third Party
from captcha.fields import ReCaptchaField

# wger
from wger.core.models import UserProfile

Expand Down
2 changes: 1 addition & 1 deletion wger/core/management/commands/clear-cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU Affero General Public License

# Third Party
# Django
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.management.base import (
Expand Down
2 changes: 1 addition & 1 deletion wger/core/management/commands/delete-temp-users.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Standard Library
import datetime

# Third Party
# Django
from django.core.management.base import BaseCommand
from django.utils.timezone import now

Expand Down
2 changes: 1 addition & 1 deletion wger/core/management/commands/extract-i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU Affero General Public License

# Third Party
# Django
from django.core.management.base import BaseCommand

# wger
Expand Down
2 changes: 1 addition & 1 deletion wger/core/management/commands/update-user-cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU Affero General Public License

# Third Party
# Django
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand

Expand Down
4 changes: 2 additions & 2 deletions wger/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
import datetime
import decimal

# Third Party
# Django
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.urls import reverse
from django.core.validators import (
MaxValueValidator,
MinValueValidator
)
from django.db import models
from django.db.models import IntegerField
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _

# wger
Expand Down
12 changes: 8 additions & 4 deletions wger/core/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
# You should have received a copy of the GNU Affero General Public License


# Third Party
# Standard Library
import datetime

# Django
from django.contrib.auth.models import User
from django.db.models.signals import post_save, pre_save
from django.db.models.signals import (
post_save,
pre_save
)
from django.dispatch import receiver

import datetime

# wger
from wger.core.models import (
UserCache,
Expand Down
2 changes: 1 addition & 1 deletion wger/core/templatetags/wger_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU Affero General Public License

# Third Party
# Django
from django import template
from django.conf import settings
from django.forms.widgets import (
Expand Down
4 changes: 3 additions & 1 deletion wger/core/tests/api_base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# You should have received a copy of the GNU Affero General Public License


# Third Party
# Django
from django.contrib.auth.models import User

# Third Party
from rest_framework import status
from rest_framework.test import APITestCase

Expand Down
4 changes: 2 additions & 2 deletions wger/core/tests/base_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import shutil
import tempfile

# Third Party
# Django
from django.conf import settings
from django.core.cache import cache
from django.test import TestCase
from django.urls import (
NoReverseMatch,
reverse
)
from django.test import TestCase

# wger
from wger.utils.constants import TWOPLACES
Expand Down
4 changes: 3 additions & 1 deletion wger/core/tests/test_apikey.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
# Standard Library
import logging

# Third Party
# Django
from django.contrib.auth.models import User
from django.urls import reverse

# Third Party
from rest_framework.authtoken.models import Token

# wger
Expand Down
2 changes: 1 addition & 1 deletion wger/core/tests/test_change_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Standard Library
import logging

# Third Party
# Django
from django.contrib.auth.models import User
from django.urls import reverse

Expand Down
2 changes: 1 addition & 1 deletion wger/core/tests/test_delete_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Standard Library
import logging

# Third Party
# Django
from django.contrib.auth.models import User
from django.urls import reverse

Expand Down
6 changes: 4 additions & 2 deletions wger/core/tests/test_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
#
# You should have received a copy of the GNU Affero General Public License

# Third Party
# Standard Library
from unittest import skip

# Django
from django.core import mail
from django.urls import reverse

# wger
from wger.core.tests.base_testcase import WorkoutManagerTestCase
from unittest import skip


class FeedbackTestCase(WorkoutManagerTestCase):
Expand Down
2 changes: 1 addition & 1 deletion wger/core/tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# You should have received a copy of the GNU Affero General Public License


# Third Party
# Django
from django.urls import reverse

# wger
Expand Down
2 changes: 1 addition & 1 deletion wger/core/tests/test_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.

# Third Party
# Django
from django.urls import reverse_lazy

# wger
Expand Down
2 changes: 1 addition & 1 deletion wger/core/tests/test_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import decimal
import logging

# Third Party
# Django
from django.contrib.auth.models import User
from django.urls import reverse

Expand Down
2 changes: 1 addition & 1 deletion wger/core/tests/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Standard Library
import logging

# Third Party
# Django
from django.contrib.auth.models import User
from django.urls import reverse

Expand Down
2 changes: 1 addition & 1 deletion wger/core/tests/test_robots_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# You should have received a copy of the GNU Affero General Public License

# Third Party
# Django
from django.urls import reverse

# wger
Expand Down
2 changes: 1 addition & 1 deletion wger/core/tests/test_sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# You should have received a copy of the GNU Affero General Public License

# Third Party
# Django
from django.urls import reverse

# wger
Expand Down
Loading

0 comments on commit dcd3163

Please sign in to comment.