Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Simplify isort config
Patryk Zawadzki009f2b302348
diff --git a/.editorconfig b/.editorconfigindex 9009232132..988be9ee06 100644--- a/.editorconfig+++ b/.editorconfig@@ -9,6 +9,7 @@ trim_trailing_whitespace = true[*.py]indent_size = 4+combine_as_imports = truemax_line_length = 79multi_line_output = 4quote_type = singlediff --git a/saleor/core/analytics.py b/saleor/core/analytics.pyindex 692cd50592..01ef9daa25 100644--- a/saleor/core/analytics.py+++ b/saleor/core/analytics.py@@ -1,8 +1,8 @@import uuid+import google_measurement_protocol as gafrom celery import shared_taskfrom django.conf import settings-import google_measurement_protocol as gaFINGERPRINT_PARTS = ['HTTP_ACCEPT_ENCODING',diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.pyindex e74bf9ee7d..28edd81a62 100644--- a/saleor/core/utils/random_data.py+++ b/saleor/core/utils/random_data.py@@ -1,8 +1,8 @@-from collections import defaultdictimport itertoolsimport osimport randomimport unicodedata+from collections import defaultdictfrom django.conf import settingsfrom django.contrib.auth.models import Group, Permissiondiff --git a/saleor/graphql/core/types.py b/saleor/graphql/core/types.pyindex 38287b3956..a0e59145f3 100644--- a/saleor/graphql/core/types.py+++ b/saleor/graphql/core/types.py@@ -1,5 +1,5 @@-from django_prices.templatetags import prices_i18nimport graphene+from django_prices.templatetags import prices_i18nclass PriceType(graphene.ObjectType):diff --git a/saleor/graphql/product/types.py b/saleor/graphql/product/types.pyindex 20c5a5e5b7..66f3cbe6ac 100644--- a/saleor/graphql/product/types.py+++ b/saleor/graphql/product/types.py@@ -1,8 +1,8 @@import functoolsimport operator-from django.db.models import Qimport graphene+from django.db.models import Qfrom graphene import relayfrom graphene_django import DjangoConnectionField, DjangoObjectTypediff --git a/saleor/product/views.py b/saleor/product/views.pyindex 98d46c438f..3183728d8e 100644--- a/saleor/product/views.py+++ b/saleor/product/views.py@@ -12,8 +12,8 @@ from .filters import ProductCategoryFilter, ProductCollectionFilterfrom .models import Category, Collectionfrom .utils import (get_availability, get_product_attributes_data, get_product_images,- get_variant_picker_data, handle_cart_form, product_json_ld,- products_for_cart, get_product_list_context, products_with_details)+ get_product_list_context, get_variant_picker_data, handle_cart_form,+ product_json_ld, products_for_cart, products_with_details)def product_details(request, slug, product_id, form=None):diff --git a/saleor/settings.py b/saleor/settings.pyindex 789c8161f0..3565b054c0 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -3,8 +3,8 @@ import os.pathimport dj_database_urlimport dj_email_url-from django.contrib.messages import constants as messagesimport django_cache_url+from django.contrib.messages import constants as messagesdef get_list(text):diff --git a/saleor/userprofile/i18n.py b/saleor/userprofile/i18n.pyindex 5114db3c57..67a521f384 100644--- a/saleor/userprofile/i18n.py+++ b/saleor/userprofile/i18n.py@@ -1,10 +1,10 @@from collections import defaultdict+import i18naddressfrom django import formsfrom django.forms.forms import BoundFieldfrom django.utils.translation import pgettext_lazyfrom django_countries.data import COUNTRIES-import i18naddressfrom phonenumber_field.formfields import PhoneNumberFieldfrom .models import Addressdiff --git a/saleor/userprofile/templatetags/i18n_address_tags.py b/saleor/userprofile/templatetags/i18n_address_tags.pyindex 30aa03d7b7..b7ef2f70e7 100644--- a/saleor/userprofile/templatetags/i18n_address_tags.py+++ b/saleor/userprofile/templatetags/i18n_address_tags.py@@ -1,6 +1,6 @@+import i18naddressfrom django import templatefrom django.utils.translation import pgettext-import i18naddressregister = template.Library()diff --git a/setup.cfg b/setup.cfgindex 90ef6a664b..1d9cf12f23 100644--- a/setup.cfg+++ b/setup.cfg@@ -41,12 +41,10 @@ inherit = falsematch-dir = (?!migrations)[^\.].*[isort]-skip = migrations,-indent = ' '-multi_line_output = 4-length_sort = false-balanced_wrapping = false-combine_as_imports = true-combine_star = true-use_parentheses = true-force_sort_within_sections = true+skip =+ .direnv+ .tox+ .venv+ docs+ migrations+ node_modulesdiff --git a/tests/dashboard/test_chips.py b/tests/dashboard/test_chips.pyindex 2d755bd0ab..38ff9314e9 100644--- a/tests/dashboard/test_chips.py+++ b/tests/dashboard/test_chips.py@@ -2,9 +2,9 @@ import django_filtersfrom django.http import QueryDictfrom saleor.dashboard.templatetags.chips import (- CHIPS_PATTERN, handle_default, handle_single_choice,- handle_multiple_choice, handle_nullboolean, handle_single_model_choice,- handle_multiple_model_choice, handle_range)+ CHIPS_PATTERN, handle_default, handle_multiple_choice,+ handle_multiple_model_choice, handle_nullboolean, handle_range,+ handle_single_choice, handle_single_model_choice)from saleor.dashboard.widgets import PriceRangeWidgetfrom saleor.product.models import Category, Productdiff --git a/tests/dashboard/test_order.py b/tests/dashboard/test_order.pyindex 7e85b918f6..c0e5341f00 100644--- a/tests/dashboard/test_order.py+++ b/tests/dashboard/test_order.py@@ -1,17 +1,15 @@from decimal import Decimalfrom unittest.mock import patch-from django.urls import reverseimport pytest+from django.urls import reversefrom django_fsm import TransitionNotAllowedfrom prices import Price-from tests.utils import get_redirect_location, get_url_pathfrom saleor.cart.models import Cart-from saleor.dashboard.order.forms import ChangeQuantityForm+from saleor.dashboard.order.forms import ChangeQuantityForm, OrderNoteFormfrom saleor.order import GroupStatus-from saleor.dashboard.order.forms import OrderNoteFormfrom saleor.order.models import (DeliveryGroup, Order, OrderHistoryEntry, OrderLine, OrderNote)from saleor.order.transitions import process_delivery_groupdiff --git a/tests/dashboard/test_product.py b/tests/dashboard/test_product.pyindex 65aacb7242..18da90807d 100644--- a/tests/dashboard/test_product.py+++ b/tests/dashboard/test_product.py@@ -1,22 +1,21 @@-from io import BytesIOimport json+from io import BytesIO+from unittest.mock import MagicMock, Mock-from unittest.mock import Mock, MagicMock--from PIL import Image+import pytestfrom django.conf import settingsfrom django.core.files.uploadedfile import SimpleUploadedFilefrom django.forms import HiddenInputfrom django.urls import reversefrom django.utils.encoding import smart_text-import pytest+from PIL import Imagefrom saleor.dashboard.product import ProductBulkActionfrom saleor.dashboard.product.forms import (- ProductBulkUpdate, ProductTypeForm, ProductForm)+ ProductBulkUpdate, ProductForm, ProductTypeForm)from saleor.product.forms import VariantChoiceFieldfrom saleor.product.models import (- Collection, AttributeChoiceValue, Product, ProductAttribute, ProductImage,+ AttributeChoiceValue, Collection, Product, ProductAttribute, ProductImage,ProductType, ProductVariant, Stock, StockLocation)HTTP_STATUS_OK = 200diff --git a/tests/dashboard/test_site_settings.py b/tests/dashboard/test_site_settings.pyindex ebd4c97274..f7cc1170cf 100644--- a/tests/dashboard/test_site_settings.py+++ b/tests/dashboard/test_site_settings.py@@ -1,9 +1,9 @@+import pytestfrom django.contrib.sites.models import Sitefrom django.db.utils import IntegrityErrorfrom django.test.client import RequestFactoryfrom django.urls import reversefrom django.utils.encoding import smart_text-import pytestfrom saleor.dashboard.sites.forms import SiteForm, SiteSettingsFormfrom saleor.site import utilsdiff --git a/tests/test_cart.py b/tests/test_cart.pyindex 5e5942650f..0a6da1a908 100644--- a/tests/test_cart.py+++ b/tests/test_cart.py@@ -1,7 +1,8 @@import json-from uuid import uuid4from unittest.mock import MagicMock, Mock+from uuid import uuid4+import pytestfrom django.contrib.auth.models import AnonymousUserfrom django.core import signingfrom django.core.exceptions import ObjectDoesNotExist@@ -9,7 +10,6 @@ from django.http import HttpResponsefrom django.urls import reversefrom django_babel.templatetags.babel import currencyfmtfrom prices import Price-import pytestfrom satchless.item import InsufficientStockfrom saleor.cart import CartStatus, forms, utilsdiff --git a/tests/test_checkout.py b/tests/test_checkout.pyindex b898e846f0..f0add06e4e 100644--- a/tests/test_checkout.py+++ b/tests/test_checkout.py@@ -1,15 +1,14 @@from unittest.mock import MagicMock, Mock+import pytestfrom django.conf import settingsfrom django.contrib.auth.models import AnonymousUserfrom prices import Price-import pytestfrom satchless.item import InsufficientStockfrom saleor.checkout import viewsfrom saleor.checkout.core import STORAGE_SESSION_KEY, Checkoutfrom saleor.checkout.forms import NoteForm-from saleor.shipping.models import ShippingMethodCountryfrom saleor.userprofile.models import Addressdiff --git a/tests/test_collection.py b/tests/test_collection.pyindex 2c232cfa04..703fce2822 100644--- a/tests/test_collection.py+++ b/tests/test_collection.py@@ -1,11 +1,11 @@import pytest-from django.urls import reverse-from .utils import get_redirect_locationfrom saleor.dashboard.collection.forms import CollectionFormfrom saleor.product.models import Collection+from .utils import get_redirect_location+@pytest.fixturedef collection(db):diff --git a/tests/test_core.py b/tests/test_core.pyindex 22d7569aa5..b804e76b9b 100644--- a/tests/test_core.py+++ b/tests/test_core.py@@ -12,7 +12,6 @@ from saleor.product.models import Productfrom saleor.shipping.models import ShippingMethodfrom saleor.userprofile.models import Address, User-type_schema = {'Vegetable': {'category': 'Food',diff --git a/tests/test_elasticsearch.py b/tests/test_elasticsearch.pyindex 8f26796d98..7f97cc0e34 100644--- a/tests/test_elasticsearch.py+++ b/tests/test_elasticsearch.py@@ -1,8 +1,8 @@from decimal import Decimal+import pytestfrom django.urls import reversefrom elasticsearch_dsl.connections import connections-import pytestfrom saleor.order.models import Orderfrom saleor.product.models import Productdiff --git a/tests/test_order.py b/tests/test_order.pyindex 98b8ac6082..903ea50af2 100644--- a/tests/test_order.py+++ b/tests/test_order.py@@ -1,11 +1,12 @@from decimal import Decimal+from django.urls import reversefrom prices import Price+from tests.utils import get_redirect_location-from saleor.order import models, OrderStatus+from saleor.order import OrderStatus, modelsfrom saleor.order.forms import OrderNoteFormfrom saleor.order.utils import add_variant_to_delivery_group-from tests.utils import get_redirect_locationdef test_total_property():diff --git a/tests/test_postgresql_search.py b/tests/test_postgresql_search.pyindex 9de73177fd..be4a8ea53e 100644--- a/tests/test_postgresql_search.py+++ b/tests/test_postgresql_search.py@@ -1,10 +1,11 @@-from saleor.product.models import Product-from saleor.order.models import Order-from saleor.userprofile.models import Address, User--from django.urls import reversefrom decimal import Decimal+import pytest+from django.urls import reverse++from saleor.order.models import Order+from saleor.product.models import Product+from saleor.userprofile.models import Address, User@pytest.fixture(scope='function', autouse=True)diff --git a/tests/test_registration.py b/tests/test_registration.pyindex b80e2cc150..cd1838cbdc 100644--- a/tests/test_registration.py+++ b/tests/test_registration.py@@ -1,7 +1,7 @@+import pytestfrom django.contrib.auth import get_user_modelfrom django.contrib.auth.models import AnonymousUserfrom django.urls import reverse-import pytestfrom saleor.registration.backends import BaseBackendfrom saleor.registration.forms import LoginForm, SignupForm