Repository: saleor/saleor

Issue:
Black should use target version py38
Since we only use python version specified in dockerfile, we can format code using only one target.

Warning: this will trigger style changes all over the code.


Discussion:

Resolving patch:
diff --git a/saleor/graphql/checkout/mutations.py b/saleor/graphql/checkout/mutations.py
--- a/saleor/graphql/checkout/mutations.py
+++ b/saleor/graphql/checkout/mutations.py
@@ -224,9 +224,10 @@ def clean_input(cls, info, instance: models.Checkout, data):
         # Resolve and process the lines, retrieving the variants and quantities
         lines = data.pop("lines", None)
         if lines:
-            cleaned_input["variants"], cleaned_input[
-                "quantities"
-            ] = cls.process_checkout_lines(lines)
+            (
+                cleaned_input["variants"],
+                cleaned_input["quantities"],
+            ) = cls.process_checkout_lines(lines)
 
         cleaned_input["shipping_address"] = cls.retrieve_shipping_address(user, data)
         cleaned_input["billing_address"] = cls.retrieve_billing_address(user, data)
diff --git a/saleor/product/utils/availability.py b/saleor/product/utils/availability.py
--- a/saleor/product/utils/availability.py
+++ b/saleor/product/utils/availability.py
@@ -63,7 +63,7 @@ def get_product_availability_status(product: "Product") -> ProductAvailabilitySt
 
 
 def get_variant_availability_status(
-    variant: ProductVariant
+    variant: ProductVariant,
 ) -> VariantAvailabilityStatus:
     if not variant.is_in_stock():
         return VariantAvailabilityStatus.OUT_OF_STOCK
diff --git a/saleor/product/utils/costs.py b/saleor/product/utils/costs.py
--- a/saleor/product/utils/costs.py
+++ b/saleor/product/utils/costs.py
@@ -21,7 +21,7 @@ def __post_init__(self):
 
 
 def get_product_costs_data(
-    product: "Product"
+    product: "Product",
 ) -> Tuple[MoneyRange, Tuple[float, float]]:
 
     purchase_costs_range = MoneyRange(start=zero_money(), stop=zero_money())


Test patch:
diff --git a/tests/api/test_webhook.py b/tests/api/test_webhook.py
--- a/tests/api/test_webhook.py
+++ b/tests/api/test_webhook.py
@@ -484,7 +484,7 @@ def test_query_webhooks_with_sort(
 
 
 def test_query_webhooks_by_service_account_without_permissions(
-    service_account_api_client
+    service_account_api_client,
 ):
     second_sa = ServiceAccount.objects.create(
         name="Sample service account", is_active=True
@@ -557,7 +557,7 @@ def test_query_webhook_by_service_account(service_account_api_client, webhook):
 
 
 def test_query_webhook_by_service_account_without_permission(
-    service_account_api_client
+    service_account_api_client,
 ):
     second_sa = ServiceAccount.objects.create(
         name="Sample service account", is_active=True
diff --git a/tests/extensions/plugins/test_plugins.py b/tests/extensions/plugins/test_plugins.py
--- a/tests/extensions/plugins/test_plugins.py
+++ b/tests/extensions/plugins/test_plugins.py
@@ -36,7 +36,7 @@ def test_update_config_items_convert_to_bool_value():
 
 
 def test_base_plugin__update_configuration_structure_configuration_has_not_change(
-    plugin_configuration
+    plugin_configuration,
 ):
     plugin = PluginSample()
     old_configuration = plugin_configuration.configuration.copy()
diff --git a/tests/test_order_actions.py b/tests/test_order_actions.py
--- a/tests/test_order_actions.py
+++ b/tests/test_order_actions.py
@@ -62,9 +62,12 @@ def test_handle_fully_paid_order_digital_lines(
 
     fulfillment = order.fulfillments.first()
 
-    event_order_paid, event_email_sent, event_order_fulfilled, event_digital_links = (
-        order.events.all()
-    )
+    (
+        event_order_paid,
+        event_email_sent,
+        event_order_fulfilled,
+        event_digital_links,
+    ) = order.events.all()
     assert event_order_paid.type == OrderEvents.ORDER_FULLY_PAID
 
     assert event_email_sent.type == OrderEvents.EMAIL_SENT
diff --git a/tests/test_product_availability.py b/tests/test_product_availability.py
--- a/tests/test_product_availability.py
+++ b/tests/test_product_availability.py
@@ -86,7 +86,7 @@ def test_variant_availability_status(variant, stock, expected_status):
 
 
 def test_variant_is_still_available_when_another_variant_is_unavailable(
-    product_variant_list
+    product_variant_list,
 ):
     """
     Ensure a variant is not incorrectly flagged as out of stock when another variant
diff --git a/tests/test_wishlist.py b/tests/test_wishlist.py
--- a/tests/test_wishlist.py
+++ b/tests/test_wishlist.py
@@ -15,7 +15,7 @@ def test_remove_only_variant_also_removes_wishlist_item(customer_wishlist_item):
 
 
 def test_remove_single_variant_from_wishlist_item(
-    customer_wishlist_item_with_two_variants
+    customer_wishlist_item_with_two_variants,
 ):
     assert customer_wishlist_item_with_two_variants.variants.count() == 2
     [variant_1, variant_2] = customer_wishlist_item_with_two_variants.variants.all()