Hello community,
here is the log from the commit of package python-django-debug-toolbar for
openSUSE:Factory checked in at 2020-01-07 23:54:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-debug-toolbar (Old)
and /work/SRC/openSUSE:Factory/.python-django-debug-toolbar.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-debug-toolbar"
Tue Jan 7 23:54:26 2020 rev:15 rq:761487 version:2.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-django-debug-toolbar/python-django-debug-toolbar.changes
2019-09-17 13:37:50.305838752 +0200
+++
/work/SRC/openSUSE:Factory/.python-django-debug-toolbar.new.6675/python-django-debug-toolbar.changes
2020-01-07 23:54:46.956075822 +0100
@@ -1,0 +2,9 @@
+Tue Jan 7 09:27:43 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Update to 2.1:
+ * Changed the Travis CI matrix to run style checks first.
+ * Exposed the djdt.init function too.
+ * Small improvements to the code to take advantage of newer Django APIs and
avoid warnings because of deprecated code.
+ * Verified compatibility with the upcoming Django 3.0 (at the time of
writing).
+
+-------------------------------------------------------------------
Old:
----
2.0.tar.gz
New:
----
2.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-django-debug-toolbar.spec ++++++
--- /var/tmp/diff_new_pack.ODbQjO/_old 2020-01-07 23:54:47.408076056 +0100
+++ /var/tmp/diff_new_pack.ODbQjO/_new 2020-01-07 23:54:47.408076056 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-django-debug-toolbar
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,21 +19,20 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-django-debug-toolbar
-Version: 2.0
+Version: 2.1
Release: 0
Summary: A configurable set of panels that display various debug
information
License: BSD-3-Clause
-Group: Development/Languages/Python
URL: https://github.com/jazzband/django-debug-toolbar
Source:
https://github.com/jazzband/django-debug-toolbar/archive/%{version}.tar.gz
-BuildRequires: %{python_module Django >= 1.11}
+BuildRequires: %{python_module Django >= 2.0}
BuildRequires: %{python_module django-jinja}
BuildRequires: %{python_module html5lib}
BuildRequires: %{python_module isort}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module sqlparse >= 0.2.0}
BuildRequires: fdupes
-Requires: python-Django >= 1.11
+Requires: python-Django >= 2.0
Requires: python-django-jinja
Requires: python-sqlparse >= 0.2.0
BuildArch: noarch
++++++ 2.0.tar.gz -> 2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-debug-toolbar-2.0/.travis.yml
new/django-debug-toolbar-2.1/.travis.yml
--- old/django-debug-toolbar-2.0/.travis.yml 2019-06-20 07:55:52.000000000
+0200
+++ new/django-debug-toolbar-2.1/.travis.yml 2019-11-12 09:17:34.000000000
+0100
@@ -1,10 +1,14 @@
dist: xenial
-sudo: false
language: python
cache: pip
matrix:
fast_finish: true
include:
+ - env: TOXENV=flake8
+ - python: 3.7
+ env: TOXENV=style
+ - python: 3.7
+ env: TOXENV=readme
- python: 3.5
env: TOXENV=py35-dj111
- python: 3.6
@@ -30,6 +34,10 @@
- python: 3.7
env: TOXENV=py37-dj22
- python: 3.6
+ env: TOXENV=py36-dj30
+ - python: 3.7
+ env: TOXENV=py37-dj30
+ - python: 3.6
env: TOXENV=py36-djmaster
- python: 3.7
env: TOXENV=py37-djmaster
@@ -48,11 +56,6 @@
- mysql -u root -e "CREATE DATABASE debug_toolbar;"
- mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'travis'@'%';";
- tox -v
- - env: TOXENV=flake8
- - python: 3.7
- env: TOXENV=style
- - python: 3.7
- env: TOXENV=readme
allow_failures:
- env: TOXENV=py36-djmaster
- env: TOXENV=py37-djmaster
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-debug-toolbar-2.0/README.rst
new/django-debug-toolbar-2.1/README.rst
--- old/django-debug-toolbar-2.0/README.rst 2019-06-20 07:55:52.000000000
+0200
+++ new/django-debug-toolbar-2.1/README.rst 2019-11-12 09:17:34.000000000
+0100
@@ -31,7 +31,7 @@
In addition to the built-in panels, a number of third-party panels are
contributed by the community.
-The current stable version of the Debug Toolbar is 1.11. It works on
+The current stable version of the Debug Toolbar is 2.1. It works on
Django ≥ 1.11.
Documentation, including installation and configuration instructions, is
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-debug-toolbar-2.0/debug_toolbar/panels/sql/tracking.py
new/django-debug-toolbar-2.1/debug_toolbar/panels/sql/tracking.py
--- old/django-debug-toolbar-2.0/debug_toolbar/panels/sql/tracking.py
2019-06-20 07:55:52.000000000 +0200
+++ new/django-debug-toolbar-2.1/debug_toolbar/panels/sql/tracking.py
2019-11-12 09:17:34.000000000 +0100
@@ -3,7 +3,7 @@
from threading import local
from time import time
-from django.utils.encoding import force_text
+from django.utils.encoding import force_str
from debug_toolbar import settings as dt_settings
from debug_toolbar.utils import get_stack, get_template_info, tidy_stacktrace
@@ -113,10 +113,10 @@
if isinstance(param, dict):
return {key: self._decode(value) for key, value in param.items()}
- # make sure datetime, date and time are converted to string by
force_text
+ # make sure datetime, date and time are converted to string by
force_str
CONVERT_TYPES = (datetime.datetime, datetime.date, datetime.time)
try:
- return force_text(param, strings_only=not isinstance(param,
CONVERT_TYPES))
+ return force_str(param, strings_only=not isinstance(param,
CONVERT_TYPES))
except UnicodeDecodeError:
return "(encoded string)"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-debug-toolbar-2.0/debug_toolbar/panels/templates/panel.py
new/django-debug-toolbar-2.1/debug_toolbar/panels/templates/panel.py
--- old/django-debug-toolbar-2.0/debug_toolbar/panels/templates/panel.py
2019-06-20 07:55:52.000000000 +0200
+++ new/django-debug-toolbar-2.1/debug_toolbar/panels/templates/panel.py
2019-11-12 09:17:34.000000000 +0100
@@ -67,15 +67,8 @@
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.templates = []
- # Refs GitHub issue #910
- # Hold a series of seen dictionaries within Contexts. A dictionary is
- # considered seen if it is `in` this list, requiring that the __eq__
- # for the dictionary matches. If *anything* in the dictionary is
- # different it is counted as a new layer.
- self.seen_layers = []
- # Holds all dictionaries which have been prettified for output.
- # This should align with the seen_layers such that an index here is
- # the same as the index there.
+ # An associated list of dictionaries and their prettified
+ # representation.
self.pformat_layers = []
def _store_template_info(self, sender, **kwargs):
@@ -94,15 +87,15 @@
context_list = []
for context_layer in context.dicts:
if hasattr(context_layer, "items") and context_layer:
- # Refs GitHub issue #910
- # If we can find this layer in our pseudo-cache then find the
- # matching prettified version in the associated list.
+ # Check if the layer is in the cache.
key_values = sorted(context_layer.items())
- if key_values in self.seen_layers:
- index = self.seen_layers.index(key_values)
- pformatted = self.pformat_layers[index]
- context_list.append(pformatted)
- else:
+ pformatted = None
+ for _key_values, _pformatted in self.pformat_layers:
+ if _key_values == key_values:
+ pformatted = _pformatted
+ break
+
+ if pformatted is None:
temp_layer = {}
for key, value in context_layer.items():
# Replace any request elements - they have a large
@@ -121,15 +114,13 @@
# QuerySet would trigger the database: user can run the
# query from SQL Panel
elif isinstance(value, (QuerySet, RawQuerySet)):
- model_name = "{}.{}".format(
- value.model._meta.app_label,
value.model.__name__
- )
temp_layer[key] = "<<{} of {}>>".format(
- value.__class__.__name__.lower(), model_name
+ value.__class__.__name__.lower(),
+ value.model._meta.label,
)
else:
+ recording(False)
try:
- recording(False)
saferepr(value) # this MAY trigger a db query
except SQLQueryTriggered:
temp_layer[key] = "<<triggers database query>>"
@@ -141,19 +132,9 @@
temp_layer[key] = value
finally:
recording(True)
- # Execute pformat first - if for some reason pformat/repr
- # causes more templates to be rendered, seen/pformat layers
- # will still be consistent
pformatted = pformat(temp_layer)
- # Refs GitHub issue #910
- # If we've not seen the layer before then we will add it
- # so that if we see it again we can skip formatting it.
- self.seen_layers.append(key_values)
- # Note: this *ought* to be len(...) - 1 but let's be safe.
- index = self.seen_layers.index(key_values)
- # Note: this *ought* to be len(...) - 1 but let's be safe.
- self.pformat_layers.insert(index, pformatted)
- context_list.append(pformatted)
+ self.pformat_layers.append((key_values, pformatted))
+ context_list.append(pformatted)
kwargs["context"] = context_list
kwargs["context_processors"] = getattr(context, "context_processors",
None)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-debug-toolbar-2.0/debug_toolbar/static/debug_toolbar/js/toolbar.js
new/django-debug-toolbar-2.1/debug_toolbar/static/debug_toolbar/js/toolbar.js
---
old/django-debug-toolbar-2.0/debug_toolbar/static/debug_toolbar/js/toolbar.js
2019-06-20 07:55:52.000000000 +0200
+++
new/django-debug-toolbar-2.1/debug_toolbar/static/debug_toolbar/js/toolbar.js
2019-11-12 09:17:34.000000000 +0100
@@ -322,6 +322,7 @@
window.djdt = {
show_toolbar: djdt.show_toolbar,
hide_toolbar: djdt.hide_toolbar,
+ init: djdt.init,
close: djdt.hide_one_level,
cookie: djdt.cookie,
applyStyle: djdt.applyStyle
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-debug-toolbar-2.0/debug_toolbar/utils.py
new/django-debug-toolbar-2.1/debug_toolbar/utils.py
--- old/django-debug-toolbar-2.0/debug_toolbar/utils.py 2019-06-20
07:55:52.000000000 +0200
+++ new/django-debug-toolbar-2.1/debug_toolbar/utils.py 2019-11-12
09:17:34.000000000 +0100
@@ -137,10 +137,8 @@
def get_name_from_obj(obj):
if hasattr(obj, "__name__"):
name = obj.__name__
- elif hasattr(obj, "__class__") and hasattr(obj.__class__, "__name__"):
- name = obj.__class__.__name__
else:
- name = "<unknown>"
+ name = obj.__class__.__name__
if hasattr(obj, "__module__"):
module = obj.__module__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-debug-toolbar-2.0/docs/changes.rst
new/django-debug-toolbar-2.1/docs/changes.rst
--- old/django-debug-toolbar-2.0/docs/changes.rst 2019-06-20
07:55:52.000000000 +0200
+++ new/django-debug-toolbar-2.1/docs/changes.rst 2019-11-12
09:17:34.000000000 +0100
@@ -1,6 +1,17 @@
Change log
==========
+2.1 (2019-11-12)
+----------------
+
+* Changed the Travis CI matrix to run style checks first.
+* Exposed the ``djdt.init`` function too.
+* Small improvements to the code to take advantage of newer Django APIs
+ and avoid warnings because of deprecated code.
+* Verified compatibility with the upcoming Django 3.0 (at the time of
+ writing).
+
+
2.0 (2019-06-20)
----------------
@@ -49,7 +60,7 @@
altogether.
* Reformatted the code using `black <https://github.com/ambv/black>`__.
* Added the Django mail panel to the list of third-party panels.
-* Convert system check errors to warnings to accomodate exotic
+* Convert system check errors to warnings to accommodate exotic
configurations.
* Fixed a crash when explaining raw querysets.
* Fixed an obscure unicode error with binary data fields.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-debug-toolbar-2.0/docs/commands.rst
new/django-debug-toolbar-2.1/docs/commands.rst
--- old/django-debug-toolbar-2.0/docs/commands.rst 2019-06-20
07:55:52.000000000 +0200
+++ new/django-debug-toolbar-2.1/docs/commands.rst 2019-11-12
09:17:34.000000000 +0100
@@ -22,7 +22,7 @@
FROM "page_page"
WHERE "page_page"."id" = 1
- >>> print p.template.name
+ >>> print(p.template.name)
SELECT "page_template"."id",
"page_template"."name",
"page_template"."description"
@@ -43,5 +43,5 @@
INNER JOIN "page_template" ON ("page_page"."template_id" =
"page_template"."id")
WHERE "page_page"."id" = 1
- >>> print p.template.name
+ >>> print(p.template.name)
Home
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-debug-toolbar-2.0/docs/conf.py
new/django-debug-toolbar-2.1/docs/conf.py
--- old/django-debug-toolbar-2.0/docs/conf.py 2019-06-20 07:55:52.000000000
+0200
+++ new/django-debug-toolbar-2.1/docs/conf.py 2019-11-12 09:17:34.000000000
+0100
@@ -59,9 +59,9 @@
# built documents.
#
# The short X.Y version.
-version = '2.0'
+version = '2.1'
# The full version, including alpha/beta/rc tags.
-release = '2.0'
+release = '2.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-debug-toolbar-2.0/docs/configuration.rst
new/django-debug-toolbar-2.1/docs/configuration.rst
--- old/django-debug-toolbar-2.0/docs/configuration.rst 2019-06-20
07:55:52.000000000 +0200
+++ new/django-debug-toolbar-2.1/docs/configuration.rst 2019-11-12
09:17:34.000000000 +0100
@@ -32,6 +32,7 @@
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
+ 'debug_toolbar.panels.profiling.ProfilingPanel',
]
This setting allows you to:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-debug-toolbar-2.0/docs/contributing.rst
new/django-debug-toolbar-2.1/docs/contributing.rst
--- old/django-debug-toolbar-2.0/docs/contributing.rst 2019-06-20
07:55:52.000000000 +0200
+++ new/django-debug-toolbar-2.1/docs/contributing.rst 2019-11-12
09:17:34.000000000 +0100
@@ -85,9 +85,9 @@
Style
-----
-The Django Debug Toolbar uses `black <https://github.com/python/black>`__
-to format code and additionally uses flake8 and isort. You can reformat
-the code using::
+The Django Debug Toolbar uses `black <https://github.com/psf/black>`__ to
+format code and additionally uses flake8 and isort. You can reformat the code
+using::
$ make style
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-debug-toolbar-2.0/setup.py
new/django-debug-toolbar-2.1/setup.py
--- old/django-debug-toolbar-2.0/setup.py 2019-06-20 07:55:52.000000000
+0200
+++ new/django-debug-toolbar-2.1/setup.py 2019-11-12 09:17:34.000000000
+0100
@@ -12,7 +12,7 @@
setup(
name="django-debug-toolbar",
- version="2.0",
+ version="2.1",
description="A configurable set of panels that display various debug "
"information about the current request/response.",
long_description=readall("README.rst"),
@@ -34,6 +34,7 @@
"Framework :: Django :: 2.0",
"Framework :: Django :: 2.1",
"Framework :: Django :: 2.2",
+ "Framework :: Django :: 3.0",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-debug-toolbar-2.0/tests/panels/test_template.py
new/django-debug-toolbar-2.1/tests/panels/test_template.py
--- old/django-debug-toolbar-2.0/tests/panels/test_template.py 2019-06-20
07:55:52.000000000 +0200
+++ new/django-debug-toolbar-2.1/tests/panels/test_template.py 2019-11-12
09:17:34.000000000 +0100
@@ -32,9 +32,14 @@
# ensure the query was NOT logged
self.assertEqual(len(self.sql_panel._queries), 0)
- ctx = self.panel.templates[0]["context"][1]
- self.assertIn("<<queryset of auth.User>>", ctx)
- self.assertIn("<<triggers database query>>", ctx)
+ self.assertEqual(
+ self.panel.templates[0]["context"],
+ [
+ "{'False': False, 'None': None, 'True': True}",
+ "{'deep_queryset': '<<triggers database query>>',\n"
+ " 'queryset': '<<queryset of auth.User>>'}",
+ ],
+ )
def test_template_repr(self):
# Force widget templates to be included
@@ -88,6 +93,17 @@
with self.settings(DEBUG_TOOLBAR_CONFIG=config):
self.assertFalse(self.panel.enabled)
+ def test_empty_context(self):
+ t = Template("")
+ c = Context({})
+ t.render(c)
+
+ # Includes the builtin context but not the empty one.
+ self.assertEqual(
+ self.panel.templates[0]["context"],
+ ["{'False': False, 'None': None, 'True': True}"],
+ )
+
@override_settings(
DEBUG=True,
DEBUG_TOOLBAR_PANELS=["debug_toolbar.panels.templates.TemplatesPanel"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-debug-toolbar-2.0/tox.ini
new/django-debug-toolbar-2.1/tox.ini
--- old/django-debug-toolbar-2.0/tox.ini 2019-06-20 07:55:52.000000000
+0200
+++ new/django-debug-toolbar-2.1/tox.ini 2019-11-12 09:17:34.000000000
+0100
@@ -1,22 +1,24 @@
[tox]
envlist =
+ flake8
+ style
+ readme
py{35,36,37}-dj111
py{35,36,37}-dj20
py{35,36,37}-dj21
py{35,36,37}-dj22
+ py{36,37}-dj30
py{36,37}-djmaster
- postgresql,
- mariadb,
- flake8,
- style,
- readme
+ postgresql
+ mariadb
[testenv]
deps =
- dj111: Django>=1.11,<2.0
- dj20: Django>=2.0,<2.1
- dj21: Django>=2.1,<2.2
- dj22: Django>=2.2,<3.0
+ dj111: Django==1.11.*
+ dj20: Django==2.0.*
+ dj21: Django==2.1.*
+ dj22: Django==2.2.*
+ dj30: Django>=3.0b1,<3.1
djmaster: https://github.com/django/django/archive/master.tar.gz
coverage
Jinja2
@@ -31,7 +33,7 @@
[testenv:postgresql]
deps =
- Django>=2.1,<2.2
+ Django==2.1.*
coverage
Jinja2
html5lib
@@ -47,7 +49,7 @@
[testenv:mariadb]
deps =
- Django>=2.1,<2.2
+ Django==2.1.*
coverage
Jinja2
html5lib