[project]
name = "django-reversion-compare"
dynamic = ["version"]
description = "Add compare view to django-reversion for comparing two versions of a reversion model."
license = {text = "GPL-3.0-or-later"}
readme = "README.md"
authors = [
    {name = 'Jens Diemer', email = 'django-reversion-compare@jensdiemer.de'}
]
requires-python = ">=3.11"
dependencies = [
    "django",  # https://docs.djangoproject.com
    "django-reversion",  # https://github.com/etianen/django-reversion
    "diff-match-patch",  # https://github.com/diff-match-patch-python/diff-match-patch
]
[project.optional-dependencies]
dev = [
    "bx_django_utils",   # https://github.com/boxine/bx_django_utils
    "django-debug-toolbar",  # https://github.com/jazzband/django-debug-toolbar/
    "django-countries",  # https://github.com/SmileyChris/django-countries

    "model_bakery",  # https://github.com/model-bakers/model_bakery
    "requests-mock",  # https://github.com/jamielennox/requests-mock/
    "django-override-storage",  # https://github.com/danifus/django-override-storage
    "beautifulsoup4",   # https://pypi.org/project/beautifulsoup4/
    "freezegun",  # https://github.com/spulec/freezegun

    "rich",  # https://github.com/Textualize/rich
    "colorlog",  # https://github.com/borntyping/python-colorlog
    "gunicorn",  # https://github.com/benoimyproject.wsgitc/gunicorn

    "manage_django_project>=0.6.4",  # https://github.com/jedie/manage_django_project
    "tblib",   # https://github.com/ionelmc/python-tblib
    "pip-tools",  # https://github.com/jazzband/pip-tools/
    "tox",  # https://github.com/tox-dev/tox
    "coverage",  # https://github.com/nedbat/coveragepy
    "autopep8",  # https://github.com/hhatto/autopep8
    "pyupgrade",  # https://github.com/asottile/pyupgrade
    "flake8",  # https://github.com/pycqa/flake8
    "flake8-bugbear",  # https://github.com/PyCQA/flake8-bugbear
    "pyflakes",  # https://github.com/PyCQA/pyflakes
    "codespell",  # https://github.com/codespell-project/codespell
    "EditorConfig",  # https://github.com/editorconfig/editorconfig-core-py
    "pip-audit",  # https://github.com/pypa/pip-audit
    "mypy",  # https://github.com/python/mypy
    "twine",  # https://github.com/pypa/twine
    "typeguard",  # https://github.com/agronholm/typeguard/
    "pre-commit",  # https://github.com/pre-commit/pre-commit

    # https://github.com/akaihola/darker
    # https://github.com/ikamensh/flynt
    # https://github.com/pycqa/isort
    # https://github.com/pygments/pygments
    "darker[flynt, isort, color]",

    # Work-a-round for: https://github.com/jazzband/pip-tools/issues/1866
    # see also: https://github.com/jazzband/pip-tools/issues/994#issuecomment-1321226661
    # backports.tarfile is needed for python <3.12
    'backports.tarfile', # via jaraco-context -> keyring -> twine
]
django42=["django>=4.2,<4.3"]
django50=["django>=5.0,<5.1"]
django51=["django>=5.1,<5.2"]

[project.urls]
Documentation = "https://github.com/jedie/django-reversion-compare"
Source = "https://github.com/jedie/django-reversion-compare"


[project.scripts]
# Must be set in ./manage.py and PROJECT_SHELL_SCRIPT:
reversion_compare_project = "reversion_compare_project.__main__:main"

[manage_django_project]
module_name="reversion_compare_project"

# Django settings used for all commands except test/coverage/tox:
local_settings='reversion_compare_project.settings.local'

# Django settings used for test/coverage/tox commands:
test_settings='reversion_compare_project.settings.tests'


[tool.cli_base]
version_module_name = "reversion_compare"  # Used by update_readme_history()


[tool.cli_base.pip_audit]
requirements=["requirements.dev.txt"]
strict=true
require_hashes=true
ignore-vuln=[
#    "CVE-2019-8341", # Jinja2: Side Template Injection (SSTI)
]



[build-system]
requires = ["setuptools>=61.0", "setuptools_scm>=7.1"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["."]
include = ["reversion_compare*", "reversion_compare_project*"]

[tool.setuptools.dynamic]
version = {attr = "reversion_compare.__version__"}


[tool.darker]
src = ['.']
revision = "origin/main..."
line_length = 119
color = true
skip_string_normalization = true
diff = false
check = false
stdout = false
isort = true
lint = [
    "flake8",
]
log_level = "INFO"


[tool.isort]
# https://pycqa.github.io/isort/docs/configuration/config_files/#pyprojecttoml-preferred-format
atomic=true
profile='black'
skip_glob=['.*', '*/htmlcov/*','*/migrations/*']
known_first_party=['reversion_compare']
line_length=119
lines_after_imports=2


[tool.coverage.run]  # https://coverage.readthedocs.io/en/latest/config.html#run
branch = true
parallel = true
concurrency = ["multiprocessing"]
source = ['.']
command_line = '-m reversion_compare_project test --shuffle --parallel --buffer'

[tool.coverage.report]
omit = ['.*', '*/tests/*', '*/migrations/*']
skip_empty = true
fail_under = 30
show_missing = true
exclude_lines = [
    'if self.debug:',
    'pragma: no cover',
    'raise NotImplementedError',
    'if __name__ == .__main__.:',
]


[tool.tox]  # https://tox.wiki/en/latest/config.html#pyproject-toml
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py{312,311}-django{52,51,42}
skip_missing_interpreters = True

[testenv]
passenv = *
skip_install = true
commands_pre =
    pip install -U pip
    pip install -U pip-tools
    django42: pip-sync requirements.django42.txt
    django50: pip-sync requirements.django50.txt
    django51: pip-sync requirements.django51.txt
commands =
    django42: {envpython} -m coverage run --context='{envname}'
    django50: {envpython} -m coverage run --context='{envname}'
    django51: {envpython} -m coverage run --context='{envname}'
"""


[tool.mypy]
warn_unused_configs = true
ignore_missing_imports = true
allow_redefinition = true  # https://github.com/python/mypy/issues/7165
show_error_codes = true
plugins = []
exclude = ['.venv', 'tests', 'migrations']


[manageprojects] # https://github.com/jedie/manageprojects
initial_revision = "02d64b0"
initial_date = 2023-04-06T11:01:20+02:00
cookiecutter_template = "https://github.com/jedie/cookiecutter_templates/"
cookiecutter_directory = "managed-django-project"
applied_migrations = [
    "00fbc5d", # 2023-04-07T12:35:09+02:00
    "c1a9d97", # 2023-11-01T19:59:17+01:00
    "363c360", # 2023-12-16T19:37:39+01:00
    "a66e5ae", # 2024-01-16T19:13:13+01:00
    "1f3a70e", # 2024-05-21T21:22:39+02:00
    "935485b", # 2024-09-09T10:39:39+02:00
]

[manageprojects.cookiecutter_context.cookiecutter]
full_name = "Jens Diemer"
github_username = "jedie"
author_email = "django-reversion-compare@jensdiemer.de"
package_name = "reversion_compare"
package_version = "0.15.0"
package_description = "Add compare view to django-reversion for comparing two versions of a reversion model."
package_url = "https://github.com/jedie/django-reversion-compare"
license = "GPL-3.0-or-later"
_template = "https://github.com/jedie/cookiecutter_templates/"

