diff --git a/djstripe/contrib/rest_framework/urls.py b/djstripe/contrib/rest_framework/urls.py index 153b09a8ea..cfa4b39e69 100644 --- a/djstripe/contrib/rest_framework/urls.py +++ b/djstripe/contrib/rest_framework/urls.py @@ -20,7 +20,6 @@ from . import views - app_name = "djstripe_rest_framework" urlpatterns = [ diff --git a/djstripe/event_handlers.py b/djstripe/event_handlers.py index 7169bf4591..64ae78285a 100644 --- a/djstripe/event_handlers.py +++ b/djstripe/event_handlers.py @@ -18,7 +18,6 @@ from .enums import SourceType from .utils import convert_tstamp - logger = logging.getLogger(__name__) diff --git a/djstripe/fields.py b/djstripe/fields.py index 740f579aba..0ee75e340b 100644 --- a/djstripe/fields.py +++ b/djstripe/fields.py @@ -9,7 +9,6 @@ from .settings import USE_NATIVE_JSONFIELD from .utils import convert_tstamp - if USE_NATIVE_JSONFIELD: from django.contrib.postgres.fields import JSONField as BaseJSONField else: diff --git a/djstripe/middleware.py b/djstripe/middleware.py index 973ff00ad0..99549bc132 100644 --- a/djstripe/middleware.py +++ b/djstripe/middleware.py @@ -14,7 +14,6 @@ from .settings import SUBSCRIPTION_REDIRECT, subscriber_request_callback from .utils import subscriber_has_active_subscription - DJSTRIPE_SUBSCRIPTION_REQUIRED_EXCEPTION_URLS = getattr( settings, "DJSTRIPE_SUBSCRIPTION_REQUIRED_EXCEPTION_URLS", () ) diff --git a/djstripe/migrations/0001_initial.py b/djstripe/migrations/0001_initial.py index 44aa9ad324..4f31de6f13 100644 --- a/djstripe/migrations/0001_initial.py +++ b/djstripe/migrations/0001_initial.py @@ -12,7 +12,6 @@ import djstripe.models from djstripe.models.webhooks import _get_version - DJSTRIPE_SUBSCRIBER_MODEL = getattr( settings, "DJSTRIPE_SUBSCRIBER_MODEL", settings.AUTH_USER_MODEL ) diff --git a/djstripe/models/base.py b/djstripe/models/base.py index d942072c26..d7bda30476 100644 --- a/djstripe/models/base.py +++ b/djstripe/models/base.py @@ -10,7 +10,6 @@ from ..fields import JSONField, StripeDateTimeField, StripeIdField from ..managers import StripeModelManager - logger = logging.getLogger(__name__) diff --git a/djstripe/models/core.py b/djstripe/models/core.py index 12ae3b9ce9..25999d98d2 100644 --- a/djstripe/models/core.py +++ b/djstripe/models/core.py @@ -21,7 +21,6 @@ from .base import StripeModel, logger from .connect import Account, Transfer - # Override the default API version used by the Stripe library. djstripe_settings.set_stripe_api_version() diff --git a/djstripe/settings.py b/djstripe/settings.py index 283124e923..e99983a406 100644 --- a/djstripe/settings.py +++ b/djstripe/settings.py @@ -9,7 +9,6 @@ from .checks import validate_stripe_api_version - DEFAULT_STRIPE_API_VERSION = "2018-05-21" diff --git a/djstripe/signals.py b/djstripe/signals.py index df782ca4b3..0e9eb489d8 100644 --- a/djstripe/signals.py +++ b/djstripe/signals.py @@ -8,7 +8,6 @@ from . import settings as djstripe_settings - webhook_processing_error = Signal(providing_args=["data", "exception"]) # A signal for each Event type. See https://stripe.com/docs/api#event_types diff --git a/djstripe/urls.py b/djstripe/urls.py index 826c37c593..8f3573c289 100644 --- a/djstripe/urls.py +++ b/djstripe/urls.py @@ -20,7 +20,6 @@ from . import settings as app_settings from . import views - app_name = "djstripe" urlpatterns = [ diff --git a/djstripe/utils.py b/djstripe/utils.py index 20f2704a5d..d15cc1c0bd 100644 --- a/djstripe/utils.py +++ b/djstripe/utils.py @@ -11,7 +11,6 @@ from django.db.models.query import QuerySet from django.utils import timezone - ANONYMOUS_USER_ERROR_MSG = ( "dj-stripe's payment checking mechanisms require the user " "be authenticated before use. Please use django.contrib.auth's " diff --git a/djstripe/views.py b/djstripe/views.py index beba7181af..4af550642e 100644 --- a/djstripe/views.py +++ b/djstripe/views.py @@ -10,7 +10,6 @@ from .models import WebhookEventTrigger - logger = logging.getLogger(__name__) diff --git a/djstripe/webhooks.py b/djstripe/webhooks.py index 8c410c4806..575af49f89 100644 --- a/djstripe/webhooks.py +++ b/djstripe/webhooks.py @@ -19,7 +19,6 @@ import itertools from collections import defaultdict - __all__ = ["handler", "handler_all", "call_handlers"] diff --git a/docs/conf.py b/docs/conf.py index 2b163ba9bc..da3c5f6f9d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,7 +16,6 @@ import djstripe # noqa - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. diff --git a/makemigrations.py b/makemigrations.py index 2409d93b9e..be3b18413b 100644 --- a/makemigrations.py +++ b/makemigrations.py @@ -13,7 +13,6 @@ from django.db import connections from django.db.utils import OperationalError - DEFAULT_SETTINGS = dict( DATABASES={"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}, DEBUG=True, diff --git a/manage.py b/manage.py index c0e66c8416..6b9b804ab3 100755 --- a/manage.py +++ b/manage.py @@ -2,7 +2,6 @@ import os import sys - if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings") try: diff --git a/setup.py b/setup.py index a29d087374..9d0460fec7 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,6 @@ from setuptools import setup - if sys.argv[-1] == "publish": os.system("python setup.py bdist_wheel upload --sign") sys.exit() diff --git a/tests/settings.py b/tests/settings.py index e0a82e155c..c37ddb29b3 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -1,6 +1,5 @@ import os - test_db_name = os.environ.get("DJSTRIPE_TEST_DB_NAME", "djstripe") test_db_user = os.environ.get("DJSTRIPE_TEST_DB_USER", "postgres") test_db_pass = os.environ.get("DJSTRIPE_TEST_DB_PASS", "") diff --git a/tests/test_api_keys.py b/tests/test_api_keys.py index 12fc11146e..9f7f236131 100644 --- a/tests/test_api_keys.py +++ b/tests/test_api_keys.py @@ -5,7 +5,6 @@ from djstripe import models from djstripe import settings as djstripe_settings - try: reload except NameError: diff --git a/tests/test_contrib/test_rest_framework_permissions.py b/tests/test_contrib/test_rest_framework_permissions.py index 561e8e3e5c..1e354ee277 100644 --- a/tests/test_contrib/test_rest_framework_permissions.py +++ b/tests/test_contrib/test_rest_framework_permissions.py @@ -4,7 +4,6 @@ from .. import FAKE_CUSTOMER - try: import rest_framework except ImportError: diff --git a/tests/test_utils.py b/tests/test_utils.py index 31676ae176..6bd8f39c41 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -24,7 +24,6 @@ from . import FAKE_CUSTOMER, FAKE_SUBSCRIPTION from .apps.testapp.models import Organization - TZ_IS_UTC = time.tzname == ("UTC", "UTC") diff --git a/tests/test_zz_jsonfield.py b/tests/test_zz_jsonfield.py index 83e6820d27..09374d1d55 100644 --- a/tests/test_zz_jsonfield.py +++ b/tests/test_zz_jsonfield.py @@ -11,7 +11,6 @@ from djstripe import fields as fields from djstripe import settings as djstripe_settings - try: reload except NameError: diff --git a/tests/urls.py b/tests/urls.py index a74688cf29..699896a94e 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -2,7 +2,6 @@ from django.contrib import admin from django.http.response import HttpResponse - admin.autodiscover() diff --git a/tox.ini b/tox.ini index f60fad84ad..8726088f9c 100644 --- a/tox.ini +++ b/tox.ini @@ -86,7 +86,6 @@ max-line-length = 113 [isort] default_section = THIRDPARTY -lines_after_imports = 2 known_first_party = djstripe multi_line_output = 5 skip = djstripe/migrations/, .tox/