django_example_ynh/pyproject.toml

221 lines
6.8 KiB
TOML
Raw Normal View History

2023-11-26 13:38:27 +01:00
[project]
name = "django_example_ynh"
2023-11-26 13:38:27 +01:00
dynamic = ["version"]
description = "Demo YunoHost Application to demonstrate the integration of a Django project under YunoHost."
2023-11-26 13:38:27 +01:00
license = {text = "GPL-3.0-or-later"}
readme = "README.md"
authors = [
{name = 'Jens Diemer', email = 'django_example_ynh@jensdiemer.de'}
]
requires-python = ">=3.9" # Stay with 3.9 until YunoHost used >=Debian 11 (Bullseye)
dependencies = [
"django_example>=0.1.0rc0", # https://github.com/jedie/django_example
#
# extras "ynh" will install: gunicorn, psycopg2, django-redis and django-axes
# see: https://github.com/YunoHost-Apps/django_yunohost_integration/blob/main/pyproject.toml
"django_yunohost_integration[ynh]>=0.6.0", # https://github.com/YunoHost-Apps/django_yunohost_integration
#
"cli-base-utilities>=0.4.4", # https://github.com/jedie/cli-base-utilities
#
# indirect depencies, added because we didn't create the requirements.txt with Python <3.11
# See: https://github.com/jazzband/pip-tools/issues/1326
"async-timeout", # needed by redis for python<=3.11.2
]
[project.optional-dependencies]
dev = [
"bx_django_utils", # https://github.com/boxine/bx_django_utils
"beautifulsoup4", # https://pypi.org/project/beautifulsoup4/
#
# TODO: Remove "pytest" and use normal unittests ;)
"pytest",
"pytest-cov",
"pytest-django",
#
"manageprojects>=0.15.0", # https://github.com/jedie/manageprojects
"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
"pyflakes", # https://github.com/PyCQA/pyflakes
"codespell", # https://github.com/codespell-project/codespell
"EditorConfig", # https://github.com/editorconfig/editorconfig-core-py
"safety", # https://github.com/pyupio/safety
"mypy", # https://github.com/python/mypy
"twine", # https://github.com/pypa/twine
# https://github.com/akaihola/darker
# https://github.com/ikamensh/flynt
# https://github.com/pycqa/isort
# https://github.com/pygments/pygments
"darker[flynt, isort, color]",
# indirect depencies added because of bug:
# https://github.com/pypa/pip/issues/9644 / https://github.com/jazzband/pip-tools/issues/1866
# to avoid errors like:
# In --require-hashes mode, all requirements must have their versions pinned with ==. These do not: ...
"tomli", # Only needed for Python <3.11
"exceptiongroup", # needed by pytest
]
[project.urls]
Documentation = "https://github.com/YunoHost-Apps/django_example_ynh"
Source = "https://github.com/YunoHost-Apps/django_example_ynh"
[project.scripts]
django_example_ynh_app = "django_example_ynh.__main__:main"
django_example_ynh_dev = "django_example_ynh.cli.dev:main"
2020-12-23 19:53:13 +01:00
[build-system]
2023-11-26 13:38:27 +01:00
requires = ["setuptools>=61.0", "setuptools_scm>=7.1"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["."]
include = ["django_example_ynh*"]
[tool.setuptools.dynamic]
version = {attr = "django_example_ynh.__version__"}
2020-12-23 19:53:13 +01:00
2022-08-12 17:56:02 +02:00
2022-04-02 20:07:31 +02:00
[tool.darker]
src = ['.']
2023-11-26 13:38:27 +01:00
# YunoHost apps still use "master" istead of "main", isn't it?
2022-04-02 20:07:31 +02:00
revision = "origin/master..."
2023-08-22 19:29:53 +02:00
line_length = 119
2022-04-02 20:07:31 +02:00
verbose = true
2023-08-22 19:29:53 +02:00
color = true
2022-04-02 20:07:31 +02:00
skip_string_normalization = true
diff = false
check = false
stdout = false
isort = true
2023-08-22 19:29:53 +02:00
flynt = true
2022-04-02 20:07:31 +02:00
lint = [
"flake8",
]
log_level = "INFO"
2022-08-12 17:55:49 +02:00
2020-12-23 19:53:13 +01:00
[tool.isort]
# https://pycqa.github.io/isort/docs/configuration/config_files/#pyprojecttoml-preferred-format
atomic=true
2022-04-02 20:07:31 +02:00
profile='black'
2022-12-21 19:19:37 +01:00
skip_glob=[".*", "*/htmlcov/*","*/migrations/*","*/local_test/*"]
2023-11-26 13:38:27 +01:00
known_first_party=['django_example', 'django_example_ynh']
2023-08-22 19:29:53 +02:00
line_length=119
2020-12-23 19:53:13 +01:00
lines_after_imports=2
[tool.pytest.ini_options]
# https://docs.pytest.org/en/latest/customize.html#pyproject-toml
minversion = "6.0"
norecursedirs = ".* .git __pycache__ conf local_test coverage* dist htmlcov"
2020-12-23 19:53:13 +01:00
# sometimes helpfull "addopts" arguments:
# -vv
# --verbose
# --capture=no
# --trace-config
# --full-trace
# -p no:warnings
addopts = """
--reuse-db
--nomigrations
--cov=.
2023-08-22 19:29:53 +02:00
--cov-config=pyproject.toml
2020-12-23 19:53:13 +01:00
--cov-report term-missing
--cov-report html
--cov-report xml
--no-cov-on-fail
--showlocals
--doctest-modules
--failed-first
--new-first
"""
2022-08-12 17:56:02 +02:00
[tool.coverage.run]
2023-08-22 19:29:53 +02:00
branch = true
parallel = true
concurrency = ["multiprocessing"]
source = ['.']
2023-11-26 13:38:27 +01:00
# TODO: pytest -> Django unitests:
#command_line = '-m unittest --verbose --locals --buffer'
command_line = '-m pytest'
disable_warnings = ["couldnt-parse"]
2023-08-22 19:29:53 +02:00
[tool.coverage.report]
2022-12-21 19:19:37 +01:00
omit = ['.*', '*/tests/*']
2023-08-22 19:29:53 +02:00
skip_empty = true
fail_under = 30
show_missing = true
exclude_lines = [
'if self.debug:',
'pragma: no cover',
'raise NotImplementedError',
'if __name__ == .__main__.:',
]
2022-08-12 17:56:02 +02:00
2023-08-22 19:29:53 +02:00
[tool.tox] # https://tox.wiki/en/latest/config.html#pyproject-toml
2020-12-23 19:53:13 +01:00
legacy_tox_ini = """
[tox]
isolated_build = True
2023-11-26 13:38:27 +01:00
envlist = py{312,311,310,39}
2020-12-23 19:53:13 +01:00
skip_missing_interpreters = True
[testenv]
passenv = *
2023-08-22 19:29:53 +02:00
skip_install = true
2023-11-26 13:38:27 +01:00
commands_pre =
pip install -U pip-tools
pip-sync requirements.dev.txt
2020-12-23 19:53:13 +01:00
commands =
2023-11-26 13:38:27 +01:00
{envpython} -m coverage run --context='{envname}'
{envpython} -m coverage combine --append
{envpython} -m coverage xml
{envpython} -m coverage report
2020-12-23 19:53:13 +01:00
"""
2022-11-06 17:33:20 +01:00
2023-11-26 13:38:27 +01:00
[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']
2022-11-06 17:33:20 +01:00
[manageprojects] # https://github.com/jedie/manageprojects
initial_revision = "da47a1e"
initial_date = 2022-11-06T17:25:53+01:00
cookiecutter_template = "https://github.com/jedie/cookiecutter_templates/"
cookiecutter_directory = "yunohost_django_package"
applied_migrations = [
"4dbd146", # 2022-11-06T17:59:58+01:00
2022-12-21 19:19:37 +01:00
"baf1ebc", # 2022-11-30T21:19:10+01:00
2022-12-21 20:02:02 +01:00
"44aa620", # 2022-12-21T19:59:39+01:00
2022-12-21 20:26:18 +01:00
"b204761", # 2022-12-21T20:25:20+01:00
2023-08-22 19:29:53 +02:00
"fad909d", # 2023-08-22T19:20:34+02:00
2023-11-26 13:38:27 +01:00
"4abd4c0", # 2023-11-25T15:59:31+01:00
]
2022-11-06 17:33:20 +01:00
[manageprojects.cookiecutter_context.cookiecutter]
project_name = "Django Example"
full_name = "Jens Diemer"
github_username = "jedie"
author_email = "django_example_ynh@jensdiemer.de"
upstream_pkg_name = "django_example"
upstream_url = "https://github.com/jedie/django-example"
ynh_app_pkg_name = "django_example_ynh"
ynh_app_url = "https://github.com/YunoHost-Apps/django_example_ynh"
bug_tracker_url = "https://github.com/jedie/django-example/issues"
upstream_version = "0.1.0rc0"
ynh_version = "1"
2022-12-21 19:19:37 +01:00
package_description = "Demo YunoHost Application to demonstrate the integration of a Django project under YunoHost."
2022-12-21 20:26:18 +01:00
license = "GPL-3.0-or-later"
2022-11-06 17:33:20 +01:00
_template = "https://github.com/jedie/cookiecutter_templates/"
_output_dir = "~/repos_ynh/django_example_ynh"