[project]
name = "PyInventory"
dynamic = ["version"]
description = "Web based management to catalog things including state and location etc. using Python/Django."
license = {text = "GPL-3.0-or-later"}
readme = "README.md"
authors = [
    {name = 'Jens Diemer', email = 'PyInventory@jensdiemer.de'}
]
keywords=['inventory','django']
requires-python = ">=3.11"
dependencies = [
    # Stay with Django v5.1.x until https://github.com/radiac/django-tagulous/issues/187 is fixed
    "django!=5.2.0",  # https://docs.djangoproject.com

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


    "django-import-export",  # https://github.com/django-import-export/django-import-export
    "django-dbbackup",  # https://github.com/django-dbbackup/django-dbbackup
    "django-tools",  # https://github.com/jedie/django-tools/
    "django-reversion-compare",  # https://github.com/jedie/django-reversion-compare/
    "django-tinymce",  # https://github.com/jazzband/django-tinymce/
    "django-tagulous",  # https://github.com/radiac/django-tagulous
    "django-admin-sortable2",  # https://github.com/jrief/django-admin-sortable2
    "pillow",  # https://github.com/jrief/django-admin-sortable2

    "requests",  # https://github.com/psf/requests

    "django-debug-toolbar",  # http://django-debug-toolbar.readthedocs.io/en/stable/changes.html
    "bx_py_utils",  # https://github.com/boxine/bx_py_utils
    "bx_django_utils",  # https://github.com/boxine/bx_django_utils
    "django-axes",  # https://github.com/jazzband/django-axes
]
[dependency-groups]
dev = [
    "django-debug-toolbar",  # http://django-debug-toolbar.readthedocs.io/en/stable/changes.html
    "manage_django_project",  # https://github.com/jedie/manage_django_project
    # TODO: "autocron",  # https://github.com/kbr/autocron

    "cmd2_ext_test",  # https://github.com/python-cmd2/cmd2/tree/master/plugins/ext_test
    "beautifulsoup4",  # https://www.crummy.com/software/BeautifulSoup/
    'lxml',  # https://github.com/lxml/lxml

    "uv",  # https://github.com/astral-sh/uv
    "hatchling",  # https://github.com/pypa/hatch/tree/master/backend
    "playwright",  # https://github.com/microsoft/playwright-python
    "tblib",   # https://github.com/ionelmc/python-tblib
    "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
    "pre-commit",  # https://github.com/pre-commit/pre-commit
    "typeguard",  # https://github.com/agronholm/typeguard/

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

    "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
]

[project.urls]
Documentation = "https://github.com/jedie/PyInventory"
Source = "https://github.com/jedie/PyInventory"


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

[manage_django_project]
module_name="inventory_project"

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

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


[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["inventory", "inventory_project"]

[tool.hatch.version]
path = "inventory/__init__.py"


[tool.cli_base]
version_module_name = "inventory" # Used by "update-readme-history" pre-commit hook


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





[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=['inventory']
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 unittest --verbose --locals --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.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 = "7cece02"
initial_date = 2023-07-15T16:37:28+02:00
cookiecutter_template = "https://github.com/jedie/cookiecutter_templates/"
cookiecutter_directory = "managed-django-project"
applied_migrations = [
    "141b3e4", # 2024-09-05T17:53:31+02:00
    "a36dd75", # 2025-03-23T11:39:23+01:00
    "b3e0624", # 2025-05-01T00:07:45+02:00
]

[manageprojects.cookiecutter_context.cookiecutter]
full_name = "Jens Diemer"
github_username = "jedie"
author_email = "PyInventory@jensdiemer.de"
package_name = "inventory"
package_version = "0.21.0"
package_description = "Web based management to catalog things including state and location etc. using Python/Django."
package_url = "https://github.com/jedie/PyInventory"
issues_url = "https://github.com/jedie/PyInventory/issues"
license = "GPL-3.0-or-later"
_template = "https://github.com/jedie/cookiecutter_templates/"
applied_migrations = [
    "8d0ebe1", # 2023-08-17T18:15:10+02:00
]
