Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Drop django-debug-toolbar
Patryk Zawadzkia18f398d01b0
diff --git a/poetry.lock b/poetry.lockindex 9e4c96e61b..d2f858f785 100644--- a/poetry.lock+++ b/poetry.lock@@ -1081,34 +1081,6 @@ maintainer = ["django", "zest.releaser[recommended]"]pyuca = ["pyuca"]test = ["djangorestframework", "graphene-django", "pytest", "pytest-cov", "pytest-django"]-[[package]]-name = "django-debug-toolbar"-version = "4.4.6"-description = "A configurable set of panels that display various debug information about the current request/response."-optional = false-python-versions = ">=3.8"-files = [- {file = "django_debug_toolbar-4.4.6-py3-none-any.whl", hash = "sha256:3beb671c9ec44ffb817fad2780667f172bd1c067dbcabad6268ce39a81335f45"},- {file = "django_debug_toolbar-4.4.6.tar.gz", hash = "sha256:36e421cb908c2f0675e07f9f41e3d1d8618dc386392ec82d23bcfcd5d29c7044"},-]--[package.dependencies]-django = ">=4.2.9"-sqlparse = ">=0.2"--[[package]]-name = "django-debug-toolbar-request-history"-version = "0.1.4"-description = "Request History Panel for Django Debug Toolbar"-optional = false-python-versions = "*"-files = [- {file = "django_debug_toolbar_request_history-0.1.4-py2.py3-none-any.whl", hash = "sha256:753ebed8b88dc8f71a8920cac5d69be18d56f510b25f841c877413c4549a2733"},-]--[package.dependencies]-django-debug-toolbar = ">=2.0"-[[package]]name = "django-extensions"version = "3.2.3"@@ -1137,22 +1109,6 @@ files = [[package.dependencies]Django = ">=3.2"-[[package]]-name = "django-graphiql-debug-toolbar"-version = "0.2.0"-description = "Django Debug Toolbar for GraphiQL IDE."-optional = false-python-versions = ">=3.6,<4.0"-files = [- {file = "django-graphiql-debug-toolbar-0.2.0.tar.gz", hash = "sha256:aec7a9e096594123d9fc359a583da794a0020b5391d941dda584ce1e667e0afd"},- {file = "django_graphiql_debug_toolbar-0.2.0-py3-none-any.whl", hash = "sha256:85bf4e4bdf6b699aa07567bcd28f16454742bf24b3c3334c502bc0be40777777"},-]--[package.dependencies]-Django = ">=2.2"-django-debug-toolbar = ">=3.1"-graphene-django = ">=2.0.0"-[[package]]name = "django-js-asset"version = "2.2.0"@@ -1719,30 +1675,6 @@ django = ["graphene-django"]sqlalchemy = ["graphene-sqlalchemy"]test = ["coveralls", "fastdiff (==0.2.0)", "iso8601", "mock", "promise", "pytest", "pytest-benchmark", "pytest-cov", "pytest-mock", "pytz", "six", "snapshottest"]-[[package]]-name = "graphene-django"-version = "2.16.0"-description = "Graphene Django integration"-optional = false-python-versions = "*"-files = [- {file = "graphene-django-2.16.0.tar.gz", hash = "sha256:dcf650ebfae52c2e9927d6e8bb005d06366f710b17a015c821c920eda1270566"},- {file = "graphene_django-2.16.0-py2.py3-none-any.whl", hash = "sha256:ec89469ec94507c1ed998f85ee087d634ec489e20fe08a72893c3ca5e646fc14"},-]--[package.dependencies]-Django = ">=2.2"-graphene = ">=2.1.7,<3"-graphql-core = ">=2.1.0,<3"-promise = ">=2.1"-singledispatch = ">=3.4.0.3"-text-unidecode = "*"--[package.extras]-dev = ["black (==22.6.0)", "coveralls", "django-filter (>=2)", "djangorestframework (>=3.6.3)", "flake8 (>=5,<6)", "flake8-black (==0.3.3)", "flake8-bugbear (==22.7.1)", "mock", "pytest (>=3.6.3)", "pytest-cov", "pytest-django (>=3.3.2)", "pytz"]-rest-framework = ["djangorestframework (>=3.6.3)"]-test = ["coveralls", "django-filter (>=2)", "djangorestframework (>=3.6.3)", "mock", "pytest (>=3.6.3)", "pytest-cov", "pytest-django (>=3.3.2)", "pytz"]-[[package]]name = "graphql-core"version = "2.3.2"@@ -4048,24 +3980,24 @@ python-versions = ">=3.6"files = [{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b42169467c42b692c19cf539c38d4602069d8c1505e97b86387fcf7afb766e1d"},{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-macosx_13_0_arm64.whl", hash = "sha256:07238db9cbdf8fc1e9de2489a4f68474e70dffcb32232db7c08fa61ca0c7c462"},+ {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:d92f81886165cb14d7b067ef37e142256f1c6a90a65cd156b063a43da1708cfd"},{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:fff3573c2db359f091e1589c3d7c5fc2f86f5bdb6f24252c2d8e539d4e45f412"},- {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_24_aarch64.whl", hash = "sha256:aa2267c6a303eb483de8d02db2871afb5c5fc15618d894300b88958f729ad74f"},{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:840f0c7f194986a63d2c2465ca63af8ccbbc90ab1c6001b1978f05119b5e7334"},{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:024cfe1fc7c7f4e1aff4a81e718109e13409767e4f871443cbff3dba3578203d"},{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-win32.whl", hash = "sha256:c69212f63169ec1cfc9bb44723bf2917cbbd8f6191a00ef3410f5a7fe300722d"},{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-win_amd64.whl", hash = "sha256:cabddb8d8ead485e255fe80429f833172b4cadf99274db39abc080e068cbcc31"},{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bef08cd86169d9eafb3ccb0a39edb11d8e25f3dae2b28f5c52fd997521133069"},{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-macosx_13_0_arm64.whl", hash = "sha256:b16420e621d26fdfa949a8b4b47ade8810c56002f5389970db4ddda51dbff248"},+ {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux2014_aarch64.whl", hash = "sha256:b5edda50e5e9e15e54a6a8a0070302b00c518a9d32accc2346ad6c984aacd279"},{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:25c515e350e5b739842fc3228d662413ef28f295791af5e5110b543cf0b57d9b"},- {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux_2_24_aarch64.whl", hash = "sha256:1707814f0d9791df063f8c19bb51b0d1278b8e9a2353abbb676c2f685dee6afe"},{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:46d378daaac94f454b3a0e3d8d78cafd78a026b1d71443f4966c696b48a6d899"},{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:09b055c05697b38ecacb7ac50bdab2240bfca1a0c4872b0fd309bb07dc9aa3a9"},{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-win32.whl", hash = "sha256:53a300ed9cea38cf5a2a9b069058137c2ca1ce658a874b79baceb8f892f915a7"},{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-win_amd64.whl", hash = "sha256:c2a72e9109ea74e511e29032f3b670835f8a59bbdc9ce692c5b4ed91ccf1eedb"},{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:ebc06178e8821efc9692ea7544aa5644217358490145629914d8020042c24aa1"},{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-macosx_13_0_arm64.whl", hash = "sha256:edaef1c1200c4b4cb914583150dcaa3bc30e592e907c01117c08b13a07255ec2"},+ {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux2014_aarch64.whl", hash = "sha256:7048c338b6c86627afb27faecf418768acb6331fc24cfa56c93e8c9780f815fa"},{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d176b57452ab5b7028ac47e7b3cf644bcfdc8cacfecf7e71759f7f51a59e5c92"},- {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_24_aarch64.whl", hash = "sha256:1dc67314e7e1086c9fdf2680b7b6c2be1c0d8e3a8279f2e993ca2a7545fecf62"},{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:3213ece08ea033eb159ac52ae052a4899b56ecc124bb80020d9bbceeb50258e9"},{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:aab7fd643f71d7946f2ee58cc88c9b7bfc97debd71dcc93e03e2d174628e7e2d"},{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-win32.whl", hash = "sha256:5c365d91c88390c8d0a8545df0b5857172824b1c604e867161e6b3d59a827eaa"},@@ -4073,7 +4005,7 @@ files = [{file = "ruamel.yaml.clib-0.2.8-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a5aa27bad2bb83670b71683aae140a1f52b0857a2deff56ad3f6c13a017a26ed"},{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c58ecd827313af6864893e7af0a3bb85fd529f862b6adbefe14643947cfe2942"},{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-macosx_12_0_arm64.whl", hash = "sha256:f481f16baec5290e45aebdc2a5168ebc6d35189ae6fea7a58787613a25f6e875"},- {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux_2_24_aarch64.whl", hash = "sha256:77159f5d5b5c14f7c34073862a6b7d34944075d9f93e681638f6d753606c6ce6"},+ {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:3fcc54cb0c8b811ff66082de1680b4b14cf8a81dce0d4fbf665c2265a81e07a1"},{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7f67a1ee819dc4562d444bbafb135832b0b909f81cc90f7aa00260968c9ca1b3"},{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4ecbf9c3e19f9562c7fdd462e8d18dd902a47ca046a2e64dba80699f0b6c09b7"},{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:87ea5ff66d8064301a154b3933ae406b0863402a799b16e4a1d24d9fbbcbe0d3"},@@ -4081,7 +4013,7 @@ files = [{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-win_amd64.whl", hash = "sha256:3f215c5daf6a9d7bbed4a0a4f760f3113b10e82ff4c5c44bec20a68c8014f675"},{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1b617618914cb00bf5c34d4357c37aa15183fa229b24767259657746c9077615"},{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:a6a9ffd280b71ad062eae53ac1659ad86a17f59a0fdc7699fd9be40525153337"},- {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux_2_24_aarch64.whl", hash = "sha256:305889baa4043a09e5b76f8e2a51d4ffba44259f6b4c72dec8ca56207d9c6fe1"},+ {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:665f58bfd29b167039f714c6998178d27ccd83984084c286110ef26b230f259f"},{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:700e4ebb569e59e16a976857c8798aee258dceac7c7d6b50cab63e080058df91"},{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:e2b4c44b60eadec492926a7270abb100ef9f72798e18743939bdbf037aab8c28"},{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e79e5db08739731b0ce4850bed599235d601701d5694c36570a99a0c5ca41a9d"},@@ -4089,7 +4021,7 @@ files = [{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-win_amd64.whl", hash = "sha256:56f4252222c067b4ce51ae12cbac231bce32aee1d33fbfc9d17e5b8d6966c312"},{file = "ruamel.yaml.clib-0.2.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:03d1162b6d1df1caa3a4bd27aa51ce17c9afc2046c31b0ad60a0a96ec22f8001"},{file = "ruamel.yaml.clib-0.2.8-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:bba64af9fa9cebe325a62fa398760f5c7206b215201b0ec825005f1b18b9bccf"},- {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux_2_24_aarch64.whl", hash = "sha256:a1a45e0bb052edf6a1d3a93baef85319733a888363938e1fc9924cb00c8df24c"},+ {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:9eb5dee2772b0f704ca2e45b1713e4e5198c18f515b52743576d196348f374d3"},{file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:da09ad1c359a728e112d60116f626cc9f29730ff3e0e7db72b9a2dbc2e4beed5"},{file = "ruamel.yaml.clib-0.2.8-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:184565012b60405d93838167f425713180b949e9d8dd0bbc7b49f074407c5a8b"},{file = "ruamel.yaml.clib-0.2.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a75879bacf2c987c003368cf14bed0ffe99e8e85acfa6c0bfffc21a090f16880"},@@ -4285,21 +4217,6 @@ core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.tedoc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"]test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.11.*)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"]-[[package]]-name = "singledispatch"-version = "4.1.0"-description = "Backport functools.singledispatch to older Pythons."-optional = false-python-versions = ">=3.8"-files = [- {file = "singledispatch-4.1.0-py2.py3-none-any.whl", hash = "sha256:6061bd291204beaeac90cdbc342b68d213b7a6efb44ae6c5e6422a78be351c8a"},- {file = "singledispatch-4.1.0.tar.gz", hash = "sha256:f3430b886d5b4213d07d715096a75da5e4a8105284c497b9aee6d6d48bfe90cb"},-]--[package.extras]-docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"]-testing = ["pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-ruff"]-[[package]]name = "six"version = "1.16.0"@@ -5262,4 +5179,4 @@ type = ["pytest-mypy"][metadata]lock-version = "2.0"python-versions = "~3.12"-content-hash = "06b2efb6fbe57f606064afe02d1995f2a74497638d0caf1a1da691b0e011cc67"+content-hash = "e3a3588e4f4777d756fe8309c05153925c6f23cf5d7e403cd9676e3c82caea40"diff --git a/pyproject.toml b/pyproject.tomlindex a15ff5fe66..8cf3385c5e 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -104,9 +104,6 @@ documentation = "https://docs.saleor.io/"before_after = "^1.0.1"coverage = "^7.2"deptry = "^0.20.0"- django-debug-toolbar = "^4.0"- django-debug-toolbar-request-history = "^0"- django-graphiql-debug-toolbar = "^0.2.0"django-extensions = "^3.1.2"django-stubs = { version = "^4.2.7", extras = ["compatible-mypy"] }fakeredis = "^2.10"@@ -149,7 +146,6 @@ extend_exclude = ["conftest\\.py", ".*/conftest\\.py", ".*/tests/.*"][tool.deptry.per_rule_ignores]DEP001 = ["pkg_resources"]DEP002 = ["azure-common", "azure-storage-blob", "azure-storage-common", "django-redis", "gunicorn", "psycopg", "pyxb"]- DEP004 = ["debug_toolbar", "graphiql_debug_toolbar"][tool.django-stubs]django_settings_module = "saleor.settings"diff --git a/saleor/graphql/middleware.py b/saleor/graphql/middleware.pyindex fbf805b346..9b629bec32 100644--- a/saleor/graphql/middleware.py+++ b/saleor/graphql/middleware.py@@ -1,5 +1,3 @@-from django.conf import settings-from .views import GraphQLView@@ -8,14 +6,3 @@ def process_view(self, request, view_func, *args):view_func.view_class, GraphQLView):request._graphql_view = True---if settings.ENABLE_DEBUG_TOOLBAR:- import warnings-- try:- from graphiql_debug_toolbar.middleware import DebugToolbarMiddleware- except ImportError:- warnings.warn("The graphiql debug toolbar was not installed.", stacklevel=1)- else:- DebugToolbarMiddleware.process_view = process_viewdiff --git a/saleor/settings.py b/saleor/settings.pyindex 4d99192d26..1370a1b1ab 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -313,31 +313,6 @@ if ENABLE_DJANGO_EXTENSIONS:"django_extensions",]-ENABLE_DEBUG_TOOLBAR = get_bool_from_env("ENABLE_DEBUG_TOOLBAR", False)-if ENABLE_DEBUG_TOOLBAR:- # Ensure the graphiql debug toolbar is actually installed before adding it- try:- __import__("graphiql_debug_toolbar")- except ImportError as exc:- msg = (- f"{exc} -- Install the missing dependencies by "- f"running `poetry install --no-root`"- )- warnings.warn(msg, stacklevel=1)- else:- INSTALLED_APPS += ["django.forms", "debug_toolbar", "graphiql_debug_toolbar"]- MIDDLEWARE.append("saleor.graphql.middleware.DebugToolbarMiddleware")-- DEBUG_TOOLBAR_PANELS = [- "ddt_request_history.panels.request_history.RequestHistoryPanel",- "debug_toolbar.panels.timer.TimerPanel",- "debug_toolbar.panels.headers.HeadersPanel",- "debug_toolbar.panels.request.RequestPanel",- "debug_toolbar.panels.sql.SQLPanel",- "debug_toolbar.panels.profiling.ProfilingPanel",- ]- DEBUG_TOOLBAR_CONFIG = {"RESULTS_CACHE_SIZE": 100}-# Make the `logging` Python module capture `warnings.warn()` calls# This is needed in order to log them as JSON when DEBUG=Falselogging.captureWarnings(True)diff --git a/saleor/urls.py b/saleor/urls.pyindex eb01f36e46..fd77704009 100644--- a/saleor/urls.py+++ b/saleor/urls.py@@ -1,7 +1,7 @@from django.conf import settingsfrom django.conf.urls.static import staticfrom django.contrib.staticfiles.views import serve-from django.urls import include, re_path+from django.urls import re_pathfrom django.views.decorators.csrf import csrf_exemptfrom .core.views import jwks@@ -54,23 +54,8 @@ urlpatterns = []if settings.DEBUG:- import warnings-from .core import views- try:- import debug_toolbar- except ImportError:- warnings.warn(- "The debug toolbar was not installed. Ignore the error. \- settings.py should already have warned the user about it.",- stacklevel=1,- )- else:- urlpatterns += [- re_path(r"^__debug__/", include(debug_toolbar.urls)) # type: ignore- ]-urlpatterns += static("/media/", document_root=settings.MEDIA_ROOT) + [re_path(r"^static/(?P<path>.*)$", serve),re_path(r"^$", views.home, name="home"),