[tool.poetry]
name = "django-fmd"
version = "0.3.0"
description = "Server for 'Find My Device' android app, implemented in Django/Python"
authors = ["JensDiemer <git@jensdiemer.de>"]
homepage = "https://gitlab.com/jedie/django-find-my-device"
packages = [
    { include = "findmydevice" },
    { include = "findmydevice_project" },
    { include = "fmd_client" },
]
keywords=['FindMyDevice','django', 'python', 'android', 'server']
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers = [
    'Development Status :: 4 - Beta',
    'Environment :: Web Environment',
    'Intended Audience :: End Users/Desktop',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
    'Programming Language :: Python :: 3.7',
    'Programming Language :: Python :: 3.8',
    'Programming Language :: Python :: 3.9',
    'Programming Language :: Python :: 3.10',
    'Programming Language :: Python :: 3 :: Only',
    'Framework :: Django',
    'Topic :: Database :: Front-Ends',
    'Topic :: Documentation',
    'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
    'Topic :: Internet :: WWW/HTTP :: Site Management',
    'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
    'Operating System :: OS Independent',
]
include = ['AUTHORS', 'LICENSE', 'README.md']
readme='README.md'

[tool.poetry.urls]
"Bug Tracker" = "https://gitlab.com/jedie/django-find-my-device/-/issues"


[tool.poetry.dependencies]
# Keep Python 3.7 until Yunohost contains a newer Python Version ;)
python = ">=3.7,<4.0.0"
django = "*"
requests = "*"  # https://requests.readthedocs.io
colorlog = "*"  # https://github.com/borntyping/python-colorlog
django-debug-toolbar = "*"  # http://django-debug-toolbar.readthedocs.io/en/stable/changes.html
django-tools = "*"  # https://github.com/jedie/django-tools/
bx_py_utils = "*"  # https://github.com/boxine/bx_py_utils
bx_django_utils = "*"  # https://github.com/boxine/bx_django_utils
pycryptodomex = "*"  # https://github.com/Legrandin/pycryptodome


[tool.poetry.dev-dependencies]
dev_shell = "*"  # https://github.com/jedie/dev-shell
poetry-publish = "*"  # https://github.com/jedie/poetry-publish
cmd2_ext_test = "*"
tox = "*"
pytest = "*"
pytest-randomly = "*"
pytest-cov = "*"
pytest-django = "*"
pytest-darker = "*"  # https://github.com/akaihola/pytest-darker
pytest-flake8 = "*"
pytest-isort = "*"
# TODO: pytest-mypy = "*"
requests-mock = "*"
coveralls = "*"
isort = "*"
flake8 = "*"
flynt = "*"
darker = "*"  # https://github.com/akaihola/darker
pyupgrade = "*"
model_bakery = "*"  # https://github.com/model-bakers/model_bakery
beautifulsoup4 = "*"
lxml = "*"


[tool.poetry.scripts]
devshell = 'findmydevice_project.dev_shell:devshell_cmdloop'
run_testserver = 'findmydevice_project.manage:start_test_server'


[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"


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


[tool.flynt]
line_length = 100


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


[tool.coverage.run]
omit = [".*"]


[tool.pytest.ini_options]
# https://docs.pytest.org/en/latest/customize.html#pyproject-toml
minversion = "6.0"
DJANGO_SETTINGS_MODULE="findmydevice_project.settings.tests"

# Don't overwrite settings.DEBUG:
django_debug_mode="keep"

norecursedirs = ".* .git __pycache__ coverage* dist htmlcov migrations"
# sometimes helpfull "addopts" arguments:
#    -vv
#    --verbose
#    --capture=no
#    --trace-config
#    --full-trace
#    -p no:warnings
addopts = """
    --import-mode=importlib
    --reuse-db
    --nomigrations
    --cov=.
    --cov-report term-missing
    --cov-report html
    --cov-report xml
    --no-cov-on-fail
    --showlocals
    --darker
    --doctest-modules
    --failed-first
    --last-failed-no-failures all
    --new-first
    -p no:randomly
"""
# TODO: --mypy


[tool.tox]
# https://tox.readthedocs.io/en/latest/example/basic.html#pyproject-toml-tox-legacy-ini
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py{37,38,39,310}
skip_missing_interpreters = True

[testenv]
passenv = *
whitelist_externals =
    poetry
commands =
    python --version
    poetry run django-admin --version
    python devshell.py pytest
"""
