Changelogs » Django-perf-rec

PyUp Safety actively tracks 362,670 Python packages for vulnerabilities and notifies you when to upgrade.



  * Support Django 4.0.


  * Add type hints.


  * Support arbitrary collections of keys being passed to Django cache operations.
  Previously only mappings and sequences were supported, now sets and mapping
  views will also work.
  Thanks to Peter Law in
  `PR 378 <>`__.


  * Re-add simplification of SQL ``IN`` clauses to always use ``(...)``. This was
  done in 4.6.0 but accidentally reverted with the sqlparse upgrade in 4.8.0.
  Thanks to Dan Palmer for the report in
  `Issue 373 <>`__.


  * Fix SQL simplication for ``UPDATE`` queries without a ``WHERE`` clause.
  Thanks to Peter Law for the report in
  `Issue 360 <>`__.


  * Stop distributing tests to reduce package size. Tests are not intended to be
  run outside of the tox setup in the repository. Repackagers can use GitHub's
  tarballs per tag.
  * Add support for hiding some operations from being recorded, via a new
  ``capture_operation`` callable to ``record``. This is potentially useful where
  a different backend is used in testing than would be used in production and
  thus a portion of the operations in a context are not representative.
  Thanks to Peter Law in
  `PR 342 <>`__.


  * Support Django 3.2.


  * Drop Python 3.5 support.
  * Remove ORM patching. Now that only Python 3.6 is supported, the
  insertion-order of ``dict``\s should mean Django's ORM always provides
  deterministic queries. The two patches django-perf-rec made on the ORM have
  been removed, and the corresponding dependency on patchy. You may need to
  regenerate your performance record files.
  This fixes an issue where use of ``annotate()`` with dependencies between the
  annotations could cause a query error after django-perf-rec sorted the
  annotation names.
  Thanks to Gordon Wrigley for the report in
  `Issue 322 <>`__.


  * Correctly record calls to ``cache.get_or_set()``.
  Thanks to Peter Law for the report in
  `Issue 319 <>`__.


  * Support Python 3.9.
  * Allow recording of tracebacks alongside db queries or cache operations,
  selected via a function passed as ``capture_traceback`` to ``record()``.
  Thanks to Nadege Michel in
  `PR 299 <>`__.


  * Drop Django 2.0 and 2.1 support.
  * Upgrade for sqlparse 0.4.0+. This required changing how SQL lists of one
  element are simplified, e.g. ``IN (1)`` will now be simplified to ``IN ()``
  instead of ``IN (...)``. You should regenerate your performance record files
  to match.


  * Add Django 3.1 support.


  * Create YAML files as non-executable. This will not be applied to existing
  files, modify their permissions if necessary, or delete and recreate.
  Thanks to Peter Law for the report in `Issue 264


  * Drop Django 1.11 support. Only Django 2.0+ is supported now.
  * Simplify SQL ``IN`` clauses to always use ``(...)``. Now ``x IN (1)`` and
  ``x IN (1,2)`` both simplify to ``x IN (...)``.
  Thanks to Dan Palmer in
  `PR 263 <>`__.


  * Update Python support to 3.5-3.8, as 3.4 has reached its end of life.
  * Converted setuptools metadata to configuration file. This meant removing the
  ``__version__`` attribute from the package. If you want to inspect the
  installed version, use
  (`docs <>`__ /
  `backport <>`__).
  * Fix ``Q()`` Patchy patch for Django 2.0+ with non-ANDed ``Q()``'s.


  * Normalize SQL whitespace. This will change fingerprinted SQL in some cases.


  * Add support for Django 2.2.


  * Work with, and require, ``sqlparse`` > 0.3.0.


  * Fix a bug in automatic test record naming when two different modules had a
  test with the same class + name that ran one after another.
  * Fix Python 3.7 ``DeprecationWarning`` for ```` (Python 3.7 not
  officially supported yet).


  * Drop Python 2 support, only Python 3.4+ is supported now.
  * Drop Django 1.8, 1.9, and 1.10 support. Only Django 1.11+ is supported now.
  * Dropped requirements for ``kwargs-only`` and ``six``.


  * Fix to actually obey the ``HIDE_COLUMNS`` option.


  * Add the ``HIDE_COLUMNS`` option in settings to disable replacing column lists
  with ``...`` in all places.


  * Don't replace columns in ORDER BY, GROUP BY and HAVING clauses.


  * Use ``kwargs-only`` library rather than vendored copy.
  * Erase volatile part of PostgreSQL cursor name.


  * Exposed the automatic naming logic used in ``record()`` in two new functions
  ``get_perf_path()`` and ``get_record_name()``, in order to ease creation of
  test records from calls outside of tests.
  * Made the automatic test detection work when running under a Pytest fixture.
  * Stopped throwing warnings on Python 3.
  * Fixed loading empty performance record files.


  * Make cascaded delete queries deterministic on Django <1.10, with another
  Patchy patch to make it match the order from 1.10+.


  * Arguments to ``record`` must be passed as keyword arguments.
  * ``file_name`` is removed as an argument to ``record`` following its
  deprecation in release 1.1.0.


  * Fix django session keys not being fingerprinted.
  * Show diff when records don't match (when not on pytest).
  * Add new 'MODE' setting with three modes. This allows customization of the
  behaviour for missing performance records. The new ``'none'`` mode is
  particularly useful for CI servers as it makes tests fail if their
  corresponding performance records have not been committed.


  * Fix automatic filenames for tests in ``.pyc`` files.
  * Add the ``path`` argument to ``record`` which allows specifying a relative
  directory or filename to use. This deprecates the ``file_name`` argument,
  which will be removed in a future major release. For more info see the


  * Work with ``sqlparse`` 0.2.2


  * Stopped ```` installing ``tests`` module.


  * Confirmed Django 1.8 and 1.10 support.


  * Fix ``install_requires`` in ````.


  * Initial version with ``record()`` that can record database queries and cache
  operations and error if they change between test runs.