Skip to content

Commit

Permalink
Enhance diff
Browse files Browse the repository at this point in the history
* Remove Django 4.1 tests and add 5.0
* Use `pretty_repr` from `rich` in `CompareObject`
* Modernize CSS styles and support dark theme
* Add `JSONField` to `VariantModel` test model
  • Loading branch information
jedie committed Feb 20, 2024
1 parent 99dd071 commit efe1c09
Show file tree
Hide file tree
Showing 17 changed files with 944 additions and 223 deletions.
13 changes: 8 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ readme = "README.md"
authors = [
{name = 'Jens Diemer', email = '[email protected]'}
]
requires-python = ">=3.9,<4" # Keep Python 3.9 until Yunohost contains a newer Python Version ;)
requires-python = ">=3.9" # Keep Python 3.9 until Yunohost contains a newer Python Version ;)
dependencies = [
"django",
"django-reversion", # https://github.com/etianen/django-reversion
"diff-match-patch", # https://github.com/diff-match-patch-python/diff-match-patch
"rich", # https://github.com/Textualize/rich
]
[project.optional-dependencies]
dev = [
Expand Down Expand Up @@ -56,10 +57,12 @@ dev = [
"model_bakery", # https://github.com/model-bakers/model_bakery
"requests-mock",
"django-override-storage", # https://github.com/danifus/django-override-storage
"beautifulsoup4", # https://pypi.org/project/beautifulsoup4/
"freezegun", # https://github.com/spulec/freezegun
]
django32=["django>=3.2,<3.3"]
django41=["django>=4.1,<4.2"]
django42=["django>=4.2,<4.3"]
django50=["django>=5.0,<5.1"]

[project.urls]
Documentation = "https://github.com/jedie/django-reversion-compare"
Expand Down Expand Up @@ -144,7 +147,7 @@ exclude_lines = [
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py{312,311,310,39}-django{42,41,32}
envlist = py{312,311,310,39}-django{50,42,32}
skip_missing_interpreters = True
[testenv]
Expand All @@ -153,12 +156,12 @@ skip_install = true
commands_pre =
pip install -U pip-tools
django32: pip-sync requirements.django32.txt
django41: pip-sync requirements.django41.txt
django42: pip-sync requirements.django42.txt
django50: pip-sync requirements.django50.txt
commands =
django32: {envpython} -m coverage run --context='{envname}' -m reversion_compare_project test --buffer
django41: {envpython} -m coverage run --context='{envname}' -m reversion_compare_project test --buffer --shuffle --parallel
django42: {envpython} -m coverage run --context='{envname}' -m reversion_compare_project test --buffer --shuffle --parallel
django50: {envpython} -m coverage run --context='{envname}' -m reversion_compare_project test --buffer --shuffle --parallel
"""


Expand Down
33 changes: 18 additions & 15 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# ./manage.py update_req
Expand Down Expand Up @@ -42,6 +42,10 @@ autopep8==2.0.4 \
# via
# django-reversion-compare (pyproject.toml)
# manageprojects
beautifulsoup4==4.12.3 \
--hash=sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051 \
--hash=sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed
# via django-reversion-compare (pyproject.toml)
binaryornot==0.4.4 \
--hash=sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061 \
--hash=sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4
Expand Down Expand Up @@ -380,7 +384,7 @@ cryptography==42.0.3 \
# via
# authlib
# secretstorage
darker[color,flynt,isort]==1.7.2 \
darker==1.7.2 \
--hash=sha256:ec5b7c382d9537611c164f3ecca2e1b8a7923bc5a02bf22f6e7f6c8bcbdf593a \
--hash=sha256:ec9d130ab2a0f7fa49ab68a08fd231a5bec66147ecbbf94c92a1f33d97b5ef6f
# via
Expand Down Expand Up @@ -468,6 +472,10 @@ flynt==0.77 \
--hash=sha256:2863ac8ec19d6ec8d29e760546e6ced644baf6dff3c7cdc77e03abbd29b80f14 \
--hash=sha256:2bd1b37043ad88a3f3c3c34a76fc0b64d24e5f03d36ea6b48cb69cc642bff17e
# via darker
freezegun==1.4.0 \
--hash=sha256:10939b0ba0ff5adaecf3b06a5c2f73071d9678e507c5eaedb23c761d56ac774b \
--hash=sha256:55e0fc3c84ebf0a96a5aa23ff8b53d70246479e9a68863f1fcac5a3e52f19dd6
# via django-reversion-compare (pyproject.toml)
gunicorn==21.2.0 \
--hash=sha256:3213aa5e8c24949e792bcacfc176fef362e7aac80b76c56f6b5122bf350722f0 \
--hash=sha256:88ec8bff1d634f98e61b9f65bc4bf3cd918a90806c6f5c48bc5603849ec81033
Expand Down Expand Up @@ -781,7 +789,9 @@ pyproject-hooks==1.0.0 \
python-dateutil==2.8.2 \
--hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
--hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9
# via arrow
# via
# arrow
# freezegun
python-slugify==8.0.4 \
--hash=sha256:276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8 \
--hash=sha256:59202371d1d05b54a9e7720c5e038f928f45daaffe41dd10822f3907b937c856
Expand Down Expand Up @@ -880,6 +890,7 @@ rich==13.7.0 \
# via
# cli-base-utilities
# cookiecutter
# django-reversion-compare (pyproject.toml)
# django-rich
# manageprojects
# rich-click
Expand Down Expand Up @@ -968,6 +979,10 @@ six==1.16.0 \
# bleach
# python-dateutil
# requests-mock
soupsieve==2.5 \
--hash=sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690 \
--hash=sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7
# via beautifulsoup4
sqlparse==0.4.4 \
--hash=sha256:5430a4fe2ac7d0f93e66f1efc6e1338a41884b7ddf2a350cedd20ccc4d9d28f3 \
--hash=sha256:d446183e84b8349fa3061f0fe7f06ca94ba65b426946ffebe6e3e8295332420c
Expand All @@ -994,19 +1009,9 @@ tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
# via
# autoflake
# autopep8
# black
# build
# cli-base-utilities
# django-reversion-compare (pyproject.toml)
# dparse
# flynt
# mypy
# pip-tools
# pyproject-api
# pyproject-hooks
# tox
tomlkit==0.12.3 \
--hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \
--hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba
Expand All @@ -1033,8 +1038,6 @@ typing-extensions==4.9.0 \
--hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \
--hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd
# via
# asgiref
# black
# django-countries
# django-reversion-compare (pyproject.toml)
# mypy
Expand Down
33 changes: 18 additions & 15 deletions requirements.django32.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# ./manage.py update_req
Expand Down Expand Up @@ -42,6 +42,10 @@ autopep8==2.0.4 \
# via
# django-reversion-compare (pyproject.toml)
# manageprojects
beautifulsoup4==4.12.3 \
--hash=sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051 \
--hash=sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed
# via django-reversion-compare (pyproject.toml)
binaryornot==0.4.4 \
--hash=sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061 \
--hash=sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4
Expand Down Expand Up @@ -380,7 +384,7 @@ cryptography==42.0.3 \
# via
# authlib
# secretstorage
darker[color,flynt,isort]==1.7.2 \
darker==1.7.2 \
--hash=sha256:ec5b7c382d9537611c164f3ecca2e1b8a7923bc5a02bf22f6e7f6c8bcbdf593a \
--hash=sha256:ec9d130ab2a0f7fa49ab68a08fd231a5bec66147ecbbf94c92a1f33d97b5ef6f
# via
Expand Down Expand Up @@ -468,6 +472,10 @@ flynt==0.77 \
--hash=sha256:2863ac8ec19d6ec8d29e760546e6ced644baf6dff3c7cdc77e03abbd29b80f14 \
--hash=sha256:2bd1b37043ad88a3f3c3c34a76fc0b64d24e5f03d36ea6b48cb69cc642bff17e
# via darker
freezegun==1.4.0 \
--hash=sha256:10939b0ba0ff5adaecf3b06a5c2f73071d9678e507c5eaedb23c761d56ac774b \
--hash=sha256:55e0fc3c84ebf0a96a5aa23ff8b53d70246479e9a68863f1fcac5a3e52f19dd6
# via django-reversion-compare (pyproject.toml)
gunicorn==21.2.0 \
--hash=sha256:3213aa5e8c24949e792bcacfc176fef362e7aac80b76c56f6b5122bf350722f0 \
--hash=sha256:88ec8bff1d634f98e61b9f65bc4bf3cd918a90806c6f5c48bc5603849ec81033
Expand Down Expand Up @@ -781,7 +789,9 @@ pyproject-hooks==1.0.0 \
python-dateutil==2.8.2 \
--hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
--hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9
# via arrow
# via
# arrow
# freezegun
python-slugify==8.0.4 \
--hash=sha256:276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8 \
--hash=sha256:59202371d1d05b54a9e7720c5e038f928f45daaffe41dd10822f3907b937c856
Expand Down Expand Up @@ -884,6 +894,7 @@ rich==13.7.0 \
# via
# cli-base-utilities
# cookiecutter
# django-reversion-compare (pyproject.toml)
# django-rich
# manageprojects
# rich-click
Expand Down Expand Up @@ -972,6 +983,10 @@ six==1.16.0 \
# bleach
# python-dateutil
# requests-mock
soupsieve==2.5 \
--hash=sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690 \
--hash=sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7
# via beautifulsoup4
sqlparse==0.4.4 \
--hash=sha256:5430a4fe2ac7d0f93e66f1efc6e1338a41884b7ddf2a350cedd20ccc4d9d28f3 \
--hash=sha256:d446183e84b8349fa3061f0fe7f06ca94ba65b426946ffebe6e3e8295332420c
Expand All @@ -998,19 +1013,9 @@ tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
# via
# autoflake
# autopep8
# black
# build
# cli-base-utilities
# django-reversion-compare (pyproject.toml)
# dparse
# flynt
# mypy
# pip-tools
# pyproject-api
# pyproject-hooks
# tox
tomlkit==0.12.3 \
--hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \
--hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba
Expand All @@ -1037,8 +1042,6 @@ typing-extensions==4.9.0 \
--hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \
--hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd
# via
# asgiref
# black
# django-countries
# django-reversion-compare (pyproject.toml)
# mypy
Expand Down
33 changes: 18 additions & 15 deletions requirements.django42.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# ./manage.py update_req
Expand Down Expand Up @@ -42,6 +42,10 @@ autopep8==2.0.4 \
# via
# django-reversion-compare (pyproject.toml)
# manageprojects
beautifulsoup4==4.12.3 \
--hash=sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051 \
--hash=sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed
# via django-reversion-compare (pyproject.toml)
binaryornot==0.4.4 \
--hash=sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061 \
--hash=sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4
Expand Down Expand Up @@ -380,7 +384,7 @@ cryptography==42.0.3 \
# via
# authlib
# secretstorage
darker[color,flynt,isort]==1.7.2 \
darker==1.7.2 \
--hash=sha256:ec5b7c382d9537611c164f3ecca2e1b8a7923bc5a02bf22f6e7f6c8bcbdf593a \
--hash=sha256:ec9d130ab2a0f7fa49ab68a08fd231a5bec66147ecbbf94c92a1f33d97b5ef6f
# via
Expand Down Expand Up @@ -468,6 +472,10 @@ flynt==0.77 \
--hash=sha256:2863ac8ec19d6ec8d29e760546e6ced644baf6dff3c7cdc77e03abbd29b80f14 \
--hash=sha256:2bd1b37043ad88a3f3c3c34a76fc0b64d24e5f03d36ea6b48cb69cc642bff17e
# via darker
freezegun==1.4.0 \
--hash=sha256:10939b0ba0ff5adaecf3b06a5c2f73071d9678e507c5eaedb23c761d56ac774b \
--hash=sha256:55e0fc3c84ebf0a96a5aa23ff8b53d70246479e9a68863f1fcac5a3e52f19dd6
# via django-reversion-compare (pyproject.toml)
gunicorn==21.2.0 \
--hash=sha256:3213aa5e8c24949e792bcacfc176fef362e7aac80b76c56f6b5122bf350722f0 \
--hash=sha256:88ec8bff1d634f98e61b9f65bc4bf3cd918a90806c6f5c48bc5603849ec81033
Expand Down Expand Up @@ -781,7 +789,9 @@ pyproject-hooks==1.0.0 \
python-dateutil==2.8.2 \
--hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
--hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9
# via arrow
# via
# arrow
# freezegun
python-slugify==8.0.4 \
--hash=sha256:276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8 \
--hash=sha256:59202371d1d05b54a9e7720c5e038f928f45daaffe41dd10822f3907b937c856
Expand Down Expand Up @@ -880,6 +890,7 @@ rich==13.7.0 \
# via
# cli-base-utilities
# cookiecutter
# django-reversion-compare (pyproject.toml)
# django-rich
# manageprojects
# rich-click
Expand Down Expand Up @@ -968,6 +979,10 @@ six==1.16.0 \
# bleach
# python-dateutil
# requests-mock
soupsieve==2.5 \
--hash=sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690 \
--hash=sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7
# via beautifulsoup4
sqlparse==0.4.4 \
--hash=sha256:5430a4fe2ac7d0f93e66f1efc6e1338a41884b7ddf2a350cedd20ccc4d9d28f3 \
--hash=sha256:d446183e84b8349fa3061f0fe7f06ca94ba65b426946ffebe6e3e8295332420c
Expand All @@ -994,19 +1009,9 @@ tomli==2.0.1 \
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
# via
# autoflake
# autopep8
# black
# build
# cli-base-utilities
# django-reversion-compare (pyproject.toml)
# dparse
# flynt
# mypy
# pip-tools
# pyproject-api
# pyproject-hooks
# tox
tomlkit==0.12.3 \
--hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \
--hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba
Expand All @@ -1033,8 +1038,6 @@ typing-extensions==4.9.0 \
--hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \
--hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd
# via
# asgiref
# black
# django-countries
# django-reversion-compare (pyproject.toml)
# mypy
Expand Down
Loading

0 comments on commit efe1c09

Please sign in to comment.