- Support Django 5.1.
- Optimize
sql_fingerprint()
a bit, yielding ~2% savings.
- Support Django 5.0.
- Drop Python 3.7 support.
- Support Python 3.12.
Fetch the test name from pytest where possible, which pulls in its parametrized name.
Thanks to Gert Van Gool in PR #537.
Avoid crashing when recording cache function calls that pass
key
orkeys
as a keyword argument, likecache.set(key="abc", value="def")
.Thanks to Benoît Casoetto in PR #545.
- Fix compatibility with sqlparse 0.4.4+.
sqlparse reverted a change made in 0.4.0 around
IN
, so the old behaviour in django-perf-rec has been restored. Upgrade to avoid regenerating your performance record files.
- Support Django 4.2.
- Support Python 3.11.
- Support Django 4.1.
Fix 'overwrite' mode to prevent file corruption.
Thanks to Peter Law for the report in Issue #468.
- Drop support for Django 2.2, 3.0, and 3.1.
Add new
MODE
option,'overwrite'
, which creates or updates missing records silently.Thanks to Peter Law in PR #461.
- Drop Python 3.6 support.
- Support Python 3.10.
- 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 aWHERE
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 torecord
. 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
torecord()
.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 toIN (#)
instead ofIN (...)
. 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(...)
. Nowx IN (1)
andx IN (1,2)
both simplify tox 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, useimportlib.metadata.version("django-perf-rec")
(docs / backport). - Fix
Q()
Patchy patch for Django 2.0+ with non-ANDedQ()
'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
forcollections.abc
(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
andsix
.
- 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 functionsget_perf_path()
andget_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 torecord
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 torecord
which allows specifying a relative directory or filename to use. This deprecates thefile_name
argument, which will be removed in a future major release. For more info see the README.
- Work with
sqlparse
0.2.2
- Stopped
setup.py
installingtests
module.
- Confirmed Django 1.8 and 1.10 support.
- Fix
install_requires
insetup.py
.
- Initial version with
record()
that can record database queries and cache operations and error if they change between test runs.