Skip to content

Commit

Permalink
remove all occurences of import unicode_literals
Browse files Browse the repository at this point in the history
drop Python 2 support
  • Loading branch information
jrief committed May 4, 2020
1 parent f560578 commit f477d32
Show file tree
Hide file tree
Showing 95 changed files with 6 additions and 285 deletions.
2 changes: 0 additions & 2 deletions docs/release-notes/0.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ merchant implementation. Such a migration file must contain a datamigration, for

.. code-block:: python
from __future__ import unicode_literals
from django.db import migrations, models
def forwards(apps, schema_editor):
Expand Down
3 changes: 0 additions & 3 deletions docs/release-notes/0.9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ Next, edit the migration file to look like this:

.. code-block:: python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from setuptools import setup, find_packages
import shop

Expand Down
3 changes: 0 additions & 3 deletions shop/admin/customer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
Expand Down
3 changes: 0 additions & 3 deletions shop/admin/defaults/commodity.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf import settings
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
Expand Down
3 changes: 0 additions & 3 deletions shop/admin/defaults/customer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.contrib import admin
from django.utils.html import format_html_join
from django.utils.translation import ugettext_lazy as _
Expand Down
3 changes: 0 additions & 3 deletions shop/admin/defaults/order.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from shop.admin.order import BaseOrderAdmin, OrderPaymentInline


Expand Down
3 changes: 0 additions & 3 deletions shop/admin/delivery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf.urls import url
from django.contrib import admin
from django.db.models import Sum
Expand Down
3 changes: 0 additions & 3 deletions shop/admin/notification.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from collections import OrderedDict

from django.contrib import admin
Expand Down
3 changes: 0 additions & 3 deletions shop/admin/order.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf.urls import url
from django.contrib import admin
from django.db.models.fields import Field, FieldDoesNotExist
Expand Down
3 changes: 0 additions & 3 deletions shop/admin/product.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.contrib import admin
Expand Down
3 changes: 0 additions & 3 deletions shop/cascade/breadcrumb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.core.exceptions import ImproperlyConfigured
from django.forms import fields, widgets
from django.template import engines, TemplateDoesNotExist
Expand Down
3 changes: 0 additions & 3 deletions shop/cascade/extensions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _
from cms.plugin_pool import plugin_pool
from cmsplugin_cascade.plugin_base import TransparentContainer
Expand Down
3 changes: 0 additions & 3 deletions shop/cascade/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from cmsplugin_cascade.bootstrap4.mixins import BootstrapUtilities
Expand Down
3 changes: 0 additions & 3 deletions shop/cms_apphooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from cms.app_base import CMSApp
Expand Down
3 changes: 0 additions & 3 deletions shop/cms_menus.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _, override

from cms.menu_bases import CMSAttachMenu
Expand Down
4 changes: 0 additions & 4 deletions shop/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


class DefaultSettings(object):
def _setting(self, name, default=None):
from django.conf import settings
Expand Down
4 changes: 0 additions & 4 deletions shop/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


class ProductNotAvailable(Exception):
"""
The product being purchased isn't available anymore.
Expand Down
3 changes: 0 additions & 3 deletions shop/filters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django_filters import filters

from djng.forms import fields
Expand Down
3 changes: 0 additions & 3 deletions shop/forms/auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf import settings
from django.contrib.auth import get_user_model, authenticate, login, password_validation
from django.contrib.auth.forms import PasswordResetForm
Expand Down
3 changes: 0 additions & 3 deletions shop/forms/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from formtools.wizard.views import normalize_name

from django.contrib.auth import get_user_model
Expand Down
3 changes: 0 additions & 3 deletions shop/forms/checkout.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.contrib.auth import get_user_model
from django.forms import widgets, Media
from django.forms.utils import ErrorDict
Expand Down
3 changes: 0 additions & 3 deletions shop/forms/widgets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.forms import widgets


Expand Down
3 changes: 0 additions & 3 deletions shop/forms/wizards.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf import settings
from django.db.models import Max
from django.forms import models, fields, widgets
Expand Down
3 changes: 0 additions & 3 deletions shop/management/commands/shop.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from cms.models.static_placeholder import StaticPlaceholder
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
Expand Down
3 changes: 0 additions & 3 deletions shop/management/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from djangocms_text_ckeditor.models import Text
from djangocms_text_ckeditor.utils import plugin_tags_to_id_list, replace_plugin_tags
from cms.api import add_plugin
Expand Down
2 changes: 0 additions & 2 deletions shop/messages.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
"""
A wrapper around Django's messages framework for easier integration with Javascript based messages.
"""
from __future__ import unicode_literals

import json
from django.contrib import messages as django_messages
Expand Down
3 changes: 0 additions & 3 deletions shop/middleware.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.utils.deprecation import MiddlewareMixin
from django.utils.functional import SimpleLazyObject
from django.utils import timezone
Expand Down
2 changes: 0 additions & 2 deletions shop/models/address.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Holds all the information relevant to the client (addresses for instance)
"""
Expand Down
3 changes: 0 additions & 3 deletions shop/models/cart.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from six import with_metaclass
import warnings
from collections import OrderedDict
Expand Down
3 changes: 0 additions & 3 deletions shop/models/customer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import string
from importlib import import_module
import warnings
Expand Down
3 changes: 0 additions & 3 deletions shop/models/defaults/address.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

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

Expand Down
3 changes: 0 additions & 3 deletions shop/models/defaults/cart.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db.models import SET_DEFAULT

from shop import deferred
Expand Down
3 changes: 0 additions & 3 deletions shop/models/defaults/cart_item.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db.models import PositiveIntegerField
from shop.models import cart

Expand Down
2 changes: 0 additions & 2 deletions shop/models/defaults/commodity.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
"""
In django-SHOP, a Commodity product-model is considered a very basic product without any attributes,
which can be used on a generic CMS page to describe anything.
"""
from __future__ import unicode_literals

from django.conf import settings
from django.core.validators import MinValueValidator
Expand Down
3 changes: 0 additions & 3 deletions shop/models/defaults/customer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
from django.template.loader import select_template
from django.utils.translation import ugettext_lazy as _
Expand Down
3 changes: 0 additions & 3 deletions shop/models/defaults/delivery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _
from shop.models.delivery import BaseDelivery

Expand Down
3 changes: 0 additions & 3 deletions shop/models/defaults/delivery_item.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
from django.utils.translation import ugettext_lazy as _
from shop.models.delivery import BaseDeliveryItem
Expand Down
2 changes: 0 additions & 2 deletions shop/models/defaults/mapping.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Some models in the merchant's implementation require a many-to-many relation with models from
outside django-SHOP. Therefore these mapping tables must be materialized by the merchant's
Expand Down
3 changes: 0 additions & 3 deletions shop/models/defaults/order.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import binascii
from os import urandom
from urllib.parse import urljoin
Expand Down
3 changes: 0 additions & 3 deletions shop/models/defaults/order_item.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db.models import PositiveIntegerField
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
from shop.models import order
Expand Down
3 changes: 0 additions & 3 deletions shop/models/delivery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from six import with_metaclass
from django.core import checks
from django.db import models
Expand Down
3 changes: 0 additions & 3 deletions shop/models/fields.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import enum
import six
from django.conf import settings
Expand Down
3 changes: 0 additions & 3 deletions shop/models/inventory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.core import checks
from django.db import models
from django.db.models.aggregates import Sum
Expand Down
3 changes: 0 additions & 3 deletions shop/models/notification.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf import settings
from django.db import models
from django.db.models import Q
Expand Down
3 changes: 0 additions & 3 deletions shop/models/order.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from decimal import Decimal
import logging
from urllib.parse import urljoin
Expand Down
3 changes: 0 additions & 3 deletions shop/models/product.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from distutils.version import LooseVersion
from functools import reduce
import operator
Expand Down
3 changes: 0 additions & 3 deletions shop/models/related.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
from django.utils.six import with_metaclass
from django.utils.translation import ugettext_lazy as _
Expand Down
4 changes: 0 additions & 4 deletions shop/modifiers/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


class BaseCartModifier(object):
"""
Cart Modifiers are the cart's counterpart to backends.
Expand Down
3 changes: 0 additions & 3 deletions shop/modifiers/defaults.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from decimal import Decimal
from django.utils.translation import ugettext_lazy as _
from shop import messages
Expand Down
3 changes: 0 additions & 3 deletions shop/modifiers/pool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.core.exceptions import ImproperlyConfigured
from shop.conf import app_settings

Expand Down
4 changes: 1 addition & 3 deletions shop/modifiers/taxes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from shop.conf import app_settings
from shop.serializers.cart import ExtraCartRow
from shop.modifiers.base import BaseCartModifier
Expand Down
3 changes: 0 additions & 3 deletions shop/money/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from shop.money.money_maker import MoneyMaker, AbstractMoney

# The default Money type for this shop
Expand Down
5 changes: 2 additions & 3 deletions shop/money/fields.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from decimal import Decimal

from django.core.exceptions import ValidationError
from django import forms
from django.db import models
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _

from shop.conf import app_settings
from shop.money.iso4217 import CURRENCIES
from shop.money.money_maker import MoneyMaker, AbstractMoney
Expand Down
Loading

0 comments on commit f477d32

Please sign in to comment.