Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-django-silk for openSUSE:Factory checked in at 2022-05-12 23:00:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-silk (Old) and /work/SRC/openSUSE:Factory/.python-django-silk.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-silk" Thu May 12 23:00:43 2022 rev:10 rq:976558 version:4.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-silk/python-django-silk.changes 2021-12-26 13:30:55.274976723 +0100 +++ /work/SRC/openSUSE:Factory/.python-django-silk.new.1538/python-django-silk.changes 2022-05-12 23:01:14.576867902 +0200 @@ -1,0 +2,29 @@ +Thu May 12 06:39:30 UTC 2022 - pgaj...@suse.com + +- version update to 4.3.0 + * Jazzband: Synced file(s) with jazzband/.github by @jazzband-bot in #518 + * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #520 + * Fix installation instructions in README by @side2k in #521 + * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #523 + * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #524 + * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #526 + * Add Python 3.10 compatibility by @hramezani in #527 + * Django main by @hramezani in #528 + * Remove unneeded dependency Pygments by @jayvdb in #532 + * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #533 + * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #535 + * Replace assertDictContainsSubset by @albertyw in #536 + * Use correct db in a multi db setup by @glujan in #538 + * Update django version by @eduzen in #544 + * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #552 + * Some tests misusing assertTrue for comparisons fix by @code-review-doctor in #550 + * Standardize supported django versions by @albertyw in #553 + * Drop support for python 3.6 by @albertyw in #554 + * Remove duplicate requirements.txt dependencies by @albertyw in #555 + * Pin dependencies in requirements.txt by @albertyw in #556 + * Release version v4.3.0 by @albertyw in #557 +- python-mock is not required for build +- deleted patches + - 2610f91.patch (upstreamed) + +------------------------------------------------------------------- Old: ---- 2610f91.patch django-silk-4.2.0.tar.gz New: ---- django-silk-4.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-silk.spec ++++++ --- /var/tmp/diff_new_pack.8REzl8/_old 2022-05-12 23:01:15.248868804 +0200 +++ /var/tmp/diff_new_pack.8REzl8/_new 2022-05-12 23:01:15.252868810 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-django-silk # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,13 +19,12 @@ %define skip_python2 1 %define skip_python36 1 Name: python-django-silk -Version: 4.2.0 +Version: 4.3.0 Release: 0 Summary: Profiling for the Django Framework License: MIT URL: https://github.com/jazzband/django-silk Source: https://files.pythonhosted.org/packages/source/d/django-silk/django-silk-%{version}.tar.gz -Patch0: https://github.com/jazzband/django-silk/commit/2610f91.patch BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -51,7 +50,6 @@ BuildRequires: %{python_module factory_boy >= 2.8.1} BuildRequires: %{python_module freezegun} BuildRequires: %{python_module gprof2dot >= 2017.09.19} -BuildRequires: %{python_module mock} BuildRequires: %{python_module networkx >= 1.11} BuildRequires: %{python_module pydotplus >= 2.0.2} BuildRequires: %{python_module pydot} @@ -68,8 +66,7 @@ Profiling for the Django Framework. %prep -%setup -q -n django-silk-%{version} -%patch0 -p1 +%autosetup -p1 -n django-silk-%{version} # see https://github.com/jazzband/django-silk/pull/532 sed -i '/Pygments/d' setup.py chmod a-x silk/static/silk/lib/* ++++++ django-silk-4.2.0.tar.gz -> django-silk-4.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/.github/workflows/test.yml new/django-silk-4.3.0/.github/workflows/test.yml --- old/django-silk-4.2.0/.github/workflows/test.yml 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/.github/workflows/test.yml 2022-03-05 07:08:05.000000000 +0100 @@ -9,8 +9,8 @@ strategy: fail-fast: false matrix: - python-version: ['3.6', '3.7', '3.8', '3.9'] - django-version: ['2.2', '3.1', '3.2', 'main'] + python-version: ['3.7', '3.8', '3.9', '3.10'] + django-version: ['2.2', '3.2', '4.0', 'main'] services: postgres: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/.pre-commit-config.yaml new/django-silk-4.3.0/.pre-commit-config.yaml --- old/django-silk-4.2.0/.pre-commit-config.yaml 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/.pre-commit-config.yaml 2022-03-05 07:08:05.000000000 +0100 @@ -1,24 +1,24 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 'v4.0.1' + rev: 'v4.1.0' hooks: - id: check-merge-conflict - repo: https://github.com/hadialqattan/pycln - rev: v1.0.3 + rev: v1.2.4 hooks: - id: pycln args: ['--all'] - repo: https://github.com/asottile/yesqa - rev: v1.2.3 + rev: v1.3.0 hooks: - id: yesqa - repo: https://github.com/pycqa/isort - rev: '5.9.3' + rev: '5.10.1' hooks: - id: isort args: ['--profile', 'black'] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 'v4.0.1' + rev: 'v4.1.0' hooks: - id: end-of-file-fixer exclude: >- @@ -47,12 +47,12 @@ - id: detect-private-key exclude: ^examples|(?:tests/ssl)/ - repo: https://github.com/asottile/pyupgrade - rev: 'v2.29.0' + rev: 'v2.31.0' hooks: - id: pyupgrade - args: ['--py36-plus', '--keep-mock'] + args: ['--py37-plus', '--keep-mock'] - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: 'v1.5.7' + rev: 'v1.6.0' hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/CHANGELOG.md new/django-silk-4.3.0/CHANGELOG.md --- old/django-silk-4.2.0/CHANGELOG.md 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/CHANGELOG.md 2022-03-05 07:08:05.000000000 +0100 @@ -1,6 +1,30 @@ # Change Log ## Unreleased +## [4.3.0](https://github.com/jazzband/django-silk/tree/4.3.0) (2022-03-01) +:release-by: Albert Wang (@albertyw) +[Full Changelog](https://github.com/jazzband/django-silk/compare/4.2.0...4.3.0) + +**Fixes:** + +- Use correct db in a multi db setup (https://github.com/jazzband/django-silk/issues/522) + +**Dependencies:** +- Drop support for Python 3.6 +- Add Python 3.10 compatibility +- Add Django 4.0 to tox.ini +- Update django version (#544) +- Django main (#528) +- Remove unneeded dependency Pygments + +**Maintenance and Cleanup:** + +- Jazzband: Created local 'CODE_OF_CONDUCT.md' from remote 'CODE_OF_CONDUCT.md' +- fix installation instructions in README +- Replace assertDictContainsSubset (#536) +- Fix issue avoid-misusing-assert-true found at https://codereview.doctor (#550) +- pre-commit autoupdate + ## [4.2.0](https://github.com/jazzband/django-silk/tree/4.2.0) (2021-23-10) :release-by: Asif Saif Uddin (@auvipy) [Full Changelog](https://github.com/jazzband/django-silk/compare/4.1.0...4.2.0) @@ -33,7 +57,7 @@ - remove python 2 style codes from across the codebase - Fix broken test on Windows 10 (SQLite) (#504) - Remove Make Migrations (#503) - +- Add Python 3.10 compatibility (#527) ## [4.1.0](https://github.com/jazzband/django-silk/tree/4.1.0) (2020-08-07) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/CODE_OF_CONDUCT.md new/django-silk-4.3.0/CODE_OF_CONDUCT.md --- old/django-silk-4.2.0/CODE_OF_CONDUCT.md 1970-01-01 01:00:00.000000000 +0100 +++ new/django-silk-4.3.0/CODE_OF_CONDUCT.md 2022-03-05 07:08:05.000000000 +0100 @@ -0,0 +1,46 @@ +# Code of Conduct + +As contributors and maintainers of the Jazzband projects, and in the interest of +fostering an open and welcoming community, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in the Jazzband a harassment-free experience +for everyone, regardless of the level of experience, gender, gender identity and +expression, sexual orientation, disability, personal appearance, body size, race, +ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery +- Personal attacks +- Trolling or insulting/derogatory comments +- Public or private harassment +- Publishing other's private information, such as physical or electronic addresses, + without explicit permission +- Other unethical or unprofessional conduct + +The Jazzband roadies have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are not +aligned to this Code of Conduct, or to ban temporarily or permanently any contributor +for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +By adopting this Code of Conduct, the roadies commit themselves to fairly and +consistently applying these principles to every aspect of managing the jazzband +projects. Roadies who do not follow or enforce the Code of Conduct may be permanently +removed from the Jazzband roadies. + +This code of conduct applies both within project spaces and in public spaces when an +individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by +contacting the roadies at `road...@jazzband.co`. All complaints will be reviewed and +investigated and will result in a response that is deemed necessary and appropriate to +the circumstances. Roadies are obligated to maintain confidentiality with regard to the +reporter of an incident. + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version +1.3.0, available at [https://contributor-covenant.org/version/1/3/0/][version] + +[homepage]: https://contributor-covenant.org +[version]: https://contributor-covenant.org/version/1/3/0/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/PKG-INFO new/django-silk-4.3.0/PKG-INFO --- old/django-silk-4.2.0/PKG-INFO 2021-10-23 02:56:44.733330500 +0200 +++ new/django-silk-4.3.0/PKG-INFO 2022-03-05 07:08:18.395949400 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: django-silk -Version: 4.2.0 +Version: 4.3.0 Summary: Silky smooth profiling for the Django Framework Home-page: https://github.com/jazzband/django-silk Author: Michael Ford @@ -11,18 +11,18 @@ Classifier: Environment :: Web Environment Classifier: Framework :: Django Classifier: Framework :: Django :: 2.2 -Classifier: Framework :: Django :: 3.1 Classifier: Framework :: Django :: 3.2 +Classifier: Framework :: Django :: 4.0 Classifier: Intended Audience :: Developers Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Internet :: WWW/HTTP Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content -Requires-Python: >=3.6 +Requires-Python: >=3.7 Description-Content-Type: text/markdown License-File: LICENSE @@ -58,8 +58,8 @@ Silk has been tested with: -* Django: 2.2, 3.1, 3.2 -* Python: 3.6, 3.7, 3.8, 3.9 +* Django: 2.2, 3.2, 4.0 +* Python: 3.7, 3.8, 3.9, 3.10 ## Installation @@ -80,7 +80,7 @@ INSTALLED_APPS = ( ... - 'silk.apps.SilkAppConfig' + 'silk' ) ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/README.md new/django-silk-4.3.0/README.md --- old/django-silk-4.2.0/README.md 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/README.md 2022-03-05 07:08:05.000000000 +0100 @@ -30,8 +30,8 @@ Silk has been tested with: -* Django: 2.2, 3.1, 3.2 -* Python: 3.6, 3.7, 3.8, 3.9 +* Django: 2.2, 3.2, 4.0 +* Python: 3.7, 3.8, 3.9, 3.10 ## Installation @@ -52,7 +52,7 @@ INSTALLED_APPS = ( ... - 'silk.apps.SilkAppConfig' + 'silk' ) ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/django_silk.egg-info/PKG-INFO new/django-silk-4.3.0/django_silk.egg-info/PKG-INFO --- old/django-silk-4.2.0/django_silk.egg-info/PKG-INFO 2021-10-23 02:56:44.000000000 +0200 +++ new/django-silk-4.3.0/django_silk.egg-info/PKG-INFO 2022-03-05 07:08:17.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: django-silk -Version: 4.2.0 +Version: 4.3.0 Summary: Silky smooth profiling for the Django Framework Home-page: https://github.com/jazzband/django-silk Author: Michael Ford @@ -11,18 +11,18 @@ Classifier: Environment :: Web Environment Classifier: Framework :: Django Classifier: Framework :: Django :: 2.2 -Classifier: Framework :: Django :: 3.1 Classifier: Framework :: Django :: 3.2 +Classifier: Framework :: Django :: 4.0 Classifier: Intended Audience :: Developers Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Internet :: WWW/HTTP Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content -Requires-Python: >=3.6 +Requires-Python: >=3.7 Description-Content-Type: text/markdown License-File: LICENSE @@ -58,8 +58,8 @@ Silk has been tested with: -* Django: 2.2, 3.1, 3.2 -* Python: 3.6, 3.7, 3.8, 3.9 +* Django: 2.2, 3.2, 4.0 +* Python: 3.7, 3.8, 3.9, 3.10 ## Installation @@ -80,7 +80,7 @@ INSTALLED_APPS = ( ... - 'silk.apps.SilkAppConfig' + 'silk' ) ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/django_silk.egg-info/SOURCES.txt new/django-silk-4.3.0/django_silk.egg-info/SOURCES.txt --- old/django-silk-4.2.0/django_silk.egg-info/SOURCES.txt 2021-10-23 02:56:44.000000000 +0200 +++ new/django-silk-4.3.0/django_silk.egg-info/SOURCES.txt 2022-03-05 07:08:18.000000000 +0100 @@ -2,6 +2,7 @@ .gitignore .pre-commit-config.yaml CHANGELOG.md +CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE MANIFEST.in @@ -91,6 +92,7 @@ project/tests/data/__init__.py project/tests/data/dynamic.py project/tests/test_lib/__init__.py +project/tests/test_lib/assertion.py project/tests/test_lib/mock_suite.py screenshots/1.png screenshots/10.png diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/django_silk.egg-info/requires.txt new/django-silk-4.3.0/django_silk.egg-info/requires.txt --- old/django-silk-4.2.0/django_silk.egg-info/requires.txt 2021-10-23 02:56:44.000000000 +0200 +++ new/django-silk-4.3.0/django_silk.egg-info/requires.txt 2022-03-05 07:08:18.000000000 +0100 @@ -1,5 +1,4 @@ Django>=2.2 -Pygments python-dateutil requests sqlparse diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/docs/index.rst new/django-silk-4.3.0/docs/index.rst --- old/django-silk-4.2.0/docs/index.rst 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/docs/index.rst 2022-03-05 07:08:05.000000000 +0100 @@ -57,5 +57,5 @@ Requirements ------------ -* Django: 2.2, 3.1, 3.2 -* Python: 3.6, 3.7, 3.8, 3.9 +* Django: 2.2, 3.2, 4.0 +* Python: 3.7, 3.8, 3.9, 3.10 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/package.json new/django-silk-4.3.0/package.json --- old/django-silk-4.2.0/package.json 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/package.json 2022-03-05 07:08:05.000000000 +0100 @@ -1,6 +1,6 @@ { "name": "silk", - "version": "4.2.0", + "version": "4.3.0", "description": "https://github.com/jazzband/django-silk", "main": "index.js", "directories": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/project/project/settings.py new/django-silk-4.3.0/project/project/settings.py --- old/django-silk-4.2.0/project/project/settings.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/project/project/settings.py 2022-03-05 07:08:05.000000000 +0100 @@ -57,8 +57,6 @@ USE_I18N = True -USE_L10N = True - USE_TZ = True LOGGING = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/project/tests/test_dynamic_profiling.py new/django-silk-4.3.0/project/tests/test_dynamic_profiling.py --- old/django-silk-4.2.0/project/tests/test_dynamic_profiling.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/project/tests/test_dynamic_profiling.py 2022-03-05 07:08:05.000000000 +0100 @@ -9,6 +9,7 @@ profile_function_or_method, ) +from .test_lib.assertion import dict_contains from .util import mock_data_collector @@ -72,13 +73,13 @@ MyClass().foo() self.assertEqual(mock_DataCollector.return_value.register_profile.call_count, 1) call_args = mock_DataCollector.return_value.register_profile.call_args[0][0] - self.assertDictContainsSubset({ + self.assertTrue(dict_contains({ 'func_name': foo.__name__, 'dynamic': True, 'file_path': source_file_name(), 'name': 'test', 'line_num': foo.__code__.co_firstlineno - }, call_args) + }, call_args)) def test_func_as_str(self): name = foo.__name__ @@ -89,10 +90,10 @@ foo() self.assertEqual(mock_DataCollector.return_value.register_profile.call_count, 1) call_args = mock_DataCollector.return_value.register_profile.call_args[0][0] - self.assertDictContainsSubset({ + self.assertTrue(dict_contains({ 'func_name': name, 'dynamic': True, 'file_path': source_file_name(), 'name': 'test', 'line_num': line_num - }, call_args) + }, call_args)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/project/tests/test_execute_sql.py new/django-silk-4.3.0/project/tests/test_execute_sql.py --- old/django-silk-4.2.0/project/tests/test_execute_sql.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/project/tests/test_execute_sql.py 2022-03-05 07:08:05.000000000 +0100 @@ -10,12 +10,26 @@ def mock_sql(): - mock_sql_query = Mock(spec_set=['_execute_sql', 'query', 'as_sql']) + mock_sql_query = Mock(spec_set=['_execute_sql', 'query', 'as_sql', 'connection']) mock_sql_query._execute_sql = Mock() mock_sql_query.query = NonCallableMock(spec_set=['model']) mock_sql_query.query.model = Mock() query_string = 'SELECT * from table_name' mock_sql_query.as_sql = Mock(return_value=(query_string, ())) + + mock_sql_query.connection = NonCallableMock( + spec_set=['cursor', 'features', 'ops'], + cursor=Mock( + spec_set=['__call__'], + return_value=NonCallableMagicMock(spec_set=['__enter__', '__exit__', 'execute']) + ), + features=NonCallableMock( + spec_set=['supports_explaining_query_execution'], + supports_explaining_query_execution=True + ), + ops=NonCallableMock(spec_set=['explain_query_prefix']), + ) + return mock_sql_query, query_string @@ -29,8 +43,7 @@ } cls.args = [1, 2] cls.kwargs = kwargs - with patch('silk.sql.connection'): - execute_sql(cls.mock_sql, *cls.args, **cls.kwargs) + execute_sql(cls.mock_sql, *cls.args, **cls.kwargs) class TestCallNoRequest(TestCase): @@ -86,16 +99,14 @@ def test_request(self): DataCollector().configure(request=Request.objects.create(path='/path/to/somewhere')) sql, _ = mock_sql() - with patch('silk.sql.connection'): - execute_sql(sql) + execute_sql(sql) query = self._query() self.assertEqual(query['request'], DataCollector().request) def test_registration(self): DataCollector().configure(request=Request.objects.create(path='/path/to/somewhere')) sql, _ = mock_sql() - with patch('silk.sql.connection'): - execute_sql(sql) + execute_sql(sql) query = self._query() self.assertIn(query, DataCollector().queries.values()) @@ -103,8 +114,7 @@ DataCollector().configure(request=Request.objects.create(path='/path/to/somewhere')) sql, qs = mock_sql() prefix = "EXPLAIN" - with patch('silk.sql.connection') as m: - mock_cursor = m.cursor.return_value.__enter__.return_value - m.ops.explain_query_prefix.return_value = prefix - execute_sql(sql) - mock_cursor.execute.assert_called_once_with(f"{prefix} {qs}", ()) + mock_cursor = sql.connection.cursor.return_value.__enter__.return_value + sql.connection.ops.explain_query_prefix.return_value = prefix + execute_sql(sql) + mock_cursor.execute.assert_called_once_with(f"{prefix} {qs}", ()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/project/tests/test_lib/assertion.py new/django-silk-4.3.0/project/tests/test_lib/assertion.py --- old/django-silk-4.2.0/project/tests/test_lib/assertion.py 1970-01-01 01:00:00.000000000 +0100 +++ new/django-silk-4.3.0/project/tests/test_lib/assertion.py 2022-03-05 07:08:05.000000000 +0100 @@ -0,0 +1,7 @@ +def dict_contains(child_dict, parent_dict): + for key, value in child_dict.items(): + if key not in parent_dict: + return False + if parent_dict[key] != value: + return False + return True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/project/tests/test_silky_profiler.py new/django-silk-4.3.0/project/tests/test_silky_profiler.py --- old/django-silk-4.2.0/project/tests/test_silky_profiler.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/project/tests/test_silky_profiler.py 2022-03-05 07:08:05.000000000 +0100 @@ -56,7 +56,7 @@ sleep(0.1) def test_one_object(self): - self.assertTrue(len(DataCollector().profiles), 1) + self.assertEqual(len(DataCollector().profiles), 1) def test_name(self): profile = list(DataCollector().profiles.values())[0] @@ -82,7 +82,7 @@ func() def test_one_object(self): - self.assertTrue(len(DataCollector().profiles), 1) + self.assertEqual(len(DataCollector().profiles), 1) def test_name(self): profile = list(DataCollector().profiles.values())[0] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/project/tests/test_view_profiling.py new/django-silk-4.3.0/project/tests/test_view_profiling.py --- old/django-silk-4.2.0/project/tests/test_view_profiling.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/project/tests/test_view_profiling.py 2022-03-05 07:08:05.000000000 +0100 @@ -4,6 +4,7 @@ from silk.views.profiling import ProfilingView +from .test_lib.assertion import dict_contains from .test_lib.mock_suite import MockSuite @@ -59,13 +60,13 @@ request.GET = {} request.session = {} context = ProfilingView()._create_context(request) - self.assertDictContainsSubset({ + self.assertTrue(dict_contains({ 'show': ProfilingView.default_show, 'order_by': ProfilingView.defualt_order_by, 'options_show': ProfilingView.show, 'options_order_by': ProfilingView.order_by, 'options_func_names': ProfilingView()._get_function_names() - }, context) + }, context)) self.assertNotIn('path', context) self.assertIn('results', context) @@ -81,7 +82,7 @@ 'name': name, 'order_by': order_by} context = ProfilingView()._create_context(request) - self.assertDictContainsSubset({ + self.assertTrue(dict_contains({ 'show': show, 'order_by': order_by, 'func_name': func_name, @@ -89,5 +90,5 @@ 'options_show': ProfilingView.show, 'options_order_by': ProfilingView.order_by, 'options_func_names': ProfilingView()._get_function_names() - }, context) + }, context)) self.assertIn('results', context) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/project/tests/test_view_requests.py new/django-silk-4.3.0/project/tests/test_view_requests.py --- old/django-silk-4.2.0/project/tests/test_view_requests.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/project/tests/test_view_requests.py 2022-03-05 07:08:05.000000000 +0100 @@ -6,6 +6,7 @@ from silk.views.requests import RequestsView +from .test_lib.assertion import dict_contains from .test_lib.mock_suite import MockSuite @@ -29,13 +30,13 @@ request.session = {} request.GET = {} context = RequestsView()._create_context(request) - self.assertDictContainsSubset({ + self.assertTrue(dict_contains({ 'show': RequestsView.default_show, 'order_by': RequestsView.default_order_by, 'options_show': RequestsView.show, 'options_order_by': RequestsView().options_order_by, 'options_order_dir': RequestsView().options_order_dir, - }, context) + }, context)) self.assertQuerysetEqual(context['options_paths'], RequestsView()._get_paths()) self.assertNotIn('path', context) self.assertIn('results', context) @@ -50,14 +51,14 @@ 'path': path, 'order_by': order_by} context = RequestsView()._create_context(request) - self.assertDictContainsSubset({ + self.assertTrue(dict_contains({ 'show': show, 'order_by': order_by, 'path': path, 'options_show': RequestsView.show, 'options_order_by': RequestsView().options_order_by, 'options_order_dir': RequestsView().options_order_dir, - }, context) + }, context)) self.assertQuerysetEqual(context['options_paths'], RequestsView()._get_paths()) self.assertIn('results', context) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/project/tests/urlconf_without_silk.py new/django-silk-4.3.0/project/tests/urlconf_without_silk.py --- old/django-silk-4.2.0/project/tests/urlconf_without_silk.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/project/tests/urlconf_without_silk.py 2022-03-05 07:08:05.000000000 +0100 @@ -1,7 +1,7 @@ -from django.conf.urls import include, url +from django.urls import include, re_path urlpatterns = [ - url( + re_path( r'^example_app/', include('example_app.urls', namespace='example_app') ), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/requirements.txt new/django-silk-4.3.0/requirements.txt --- old/django-silk-4.2.0/requirements.txt 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/requirements.txt 2022-03-05 07:08:05.000000000 +0100 @@ -1,17 +1,11 @@ -autopep8 -contextlib2 -coverage -factory-boy -freezegun -jinja2 -networkx -pillow -pydot -pygments -pytest-cov -pytest-django -python-dateutil -pytz -requests -simplejson -sqlparse +contextlib2==21.6.0 +coverage==6.3.2 +factory-boy==3.2.1 +freezegun==1.1.0 +networkx==2.6 +pillow==9.0.1 +pydot==1.4.2 +pygments==2.11.2 +pytest-cov==3.0.0 +pytest-django==4.5.2 +simplejson==3.17.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/setup.py new/django-silk-4.3.0/setup.py --- old/django-silk-4.2.0/setup.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/setup.py 2022-03-05 07:08:05.000000000 +0100 @@ -22,21 +22,20 @@ 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.1', 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.0', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], install_requires=[ 'Django>=2.2', - 'Pygments', 'python-dateutil', 'requests', 'sqlparse', @@ -45,6 +44,6 @@ 'pytz', 'gprof2dot>=2017.09.19', ], - python_requires='>=3.6', + python_requires='>=3.7', setup_requires=['setuptools_scm'], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/silk/profiling/profiler.py new/django-silk-4.3.0/silk/profiling/profiler.py --- old/django-silk-4.2.0/silk/profiling/profiler.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/silk/profiling/profiler.py 2022-03-05 07:08:05.000000000 +0100 @@ -11,7 +11,7 @@ from silk.config import SilkyConfig from silk.models import _time_taken -Logger = logging.getLogger('silk.profiling.profiler') +logger = logging.getLogger('silk.profiling.profiler') # noinspection PyPep8Naming @@ -35,7 +35,7 @@ end_time = timezone.now() exception_raised = exc_type is not None if exception_raised: - Logger.error('Exception when performing meta profiling, dumping trace below') + logger.error('Exception when performing meta profiling, dumping trace below') traceback.print_exception(exc_type, exc_val, exc_tb) request = getattr(DataCollector().local, 'request', None) if request: @@ -102,7 +102,7 @@ 'start_time': timezone.now(), } else: - Logger.warn('Cannot execute silk_profile as silk is not installed correctly.') + logger.warning('Cannot execute silk_profile as silk is not installed correctly.') def _finalise_queries(self): collector = DataCollector() @@ -172,7 +172,7 @@ return decorator(target) else: - Logger.warning('Cannot execute silk_profile as silk is not installed correctly.') + logger.warning('Cannot execute silk_profile as silk is not installed correctly.') return target def distinct_queries(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/silk/request_filters.py new/django-silk-4.3.0/silk/request_filters.py --- old/django-silk-4.2.0/silk/request_filters.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/silk/request_filters.py 2022-03-05 07:08:05.000000000 +0100 @@ -228,5 +228,5 @@ f = filter_class(value) filters[ident] = f except FilterValidationError: - logger.warn(f'Validation error when processing filter {typ}({value})') + logger.warning(f'Validation error when processing filter {typ}({value})') return filters diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/silk/sql.py new/django-silk-4.3.0/silk/sql.py --- old/django-silk-4.2.0/silk/sql.py 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/silk/sql.py 2022-03-05 07:08:05.000000000 +0100 @@ -2,7 +2,6 @@ import traceback from django.core.exceptions import EmptyResultSet -from django.db import connection from django.utils import timezone from silk.collector import DataCollector @@ -29,7 +28,7 @@ yield row -def _explain_query(q, params): +def _explain_query(connection, q, params): if connection.features.supports_explaining_query_execution: if SilkyConfig().SILKY_ANALYZE_QUERIES: # Work around some DB engines not supporting analyze option @@ -91,7 +90,7 @@ if request: query_dict['request'] = request if self.query.model.__module__ != 'silk.models': - query_dict['analysis'] = _explain_query(q, params) + query_dict['analysis'] = _explain_query(self.connection, q, params) DataCollector().register_query(query_dict) else: DataCollector().register_silk_query(query_dict) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-silk-4.2.0/tox.ini new/django-silk-4.3.0/tox.ini --- old/django-silk-4.2.0/tox.ini 2021-10-23 02:56:34.000000000 +0200 +++ new/django-silk-4.3.0/tox.ini 2022-03-05 07:08:05.000000000 +0100 @@ -1,21 +1,22 @@ [gh-actions] python = - 3.6: py36 3.7: py37 3.8: py38 3.9: py39 + 3.10: py310 [gh-actions:env] DJANGO = 2.2: dj22 - 3.1: dj31 3.2: dj32 + 4.0: dj40 main: djmain [tox] envlist = - py{36,37,38,39}-dj{22,31,32}-{sqlite3,mysql,postgresql} - py{38,39}-djmain-{sqlite3,mysql,postgresql} + py{37,38,39}-dj{22,32}-{sqlite3,mysql,postgresql} + py{37,38,39,310}-dj32-{sqlite3,mysql,postgresql} + py{38,39,310}-dj{40,main}-{sqlite3,mysql,postgresql} [testenv] usedevelop = True @@ -27,8 +28,8 @@ mysql: mysqlclient postgresql: psycopg2-binary<2.9 dj22: django>=2.2,<2.3 - dj31: django>=3.1,<3.2 dj32: django>=3.2,<3.3 + dj40: django>=4.0,<4.1 djmain: https://github.com/django/django/archive/main.tar.gz setenv = PYTHONPATH={toxinidir}:{toxinidir}