# ---------------------------------------------------------------------------
# Tom's Obvious Minimal Language - https://toml.io/en/
# Allows to:
# - create a distribution with: python -m build
# - install required dependencies with: python -m pip install .
# ---------------------------------------------------------------------------
# Guide (user-friendly):
# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
#
# Specification (technical, formal):
# https://packaging.python.org/en/latest/specifications/pyproject-toml/
#
# Choosing a build backend:
# https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-a-build-backend
# ---------------------------------------------------------------------------
[project]
# Project name: https://packaging.python.org/en/latest/specifications/name-normalization/#name-format
name = "Whakerkit"
# The version must be PEP 440 compliant
version = "1.2"
authors = [
{name="Brigitte Bigi", email="contact@sppas.org"},
]
maintainers = [
{name="Brigitte Bigi", email="contact@sppas.org"},
]
# This is a one-line description or tagline of what SPPAS does.
description = "The implementation of a WhakerKit project website."
readme = "README.md"
requires-python = ">=3.9"
license = {file = "LICENSE"}
keywords = ["python", "toolkit", "web", "html", "documents", "files", "filters"]
classifiers = [
"Programming Language :: Python",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable"
]
dependencies = [
"WhakerPy >= 1.3"
]
[project.optional-dependencies]
authentication = [
"ldap3",
"PyJWT"]
docs = [
"pygments",
"markdown2",
"ClammingPy >= 1.8"]
tests = [
"coverage ~=7.3.0",
"python-dotenv ~=1.0.0"]
[project.urls]
"Documentation" = "https://whakerkit.sourceforge.io/"
"Homepage" = "https://sourceforge.net/projects/whakerkit/"
"Repository" = "https://git.code.sf.net/p/whakerkit/code"
# --------------------------------
# Building package & deps with setuptools
# --------------------------------
[build-system]
requires = ["setuptools", "WhakerPy"]
build-backend = "setuptools.build_meta"
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html
[tool.setuptools.packages.find]
where = ["."]
include = ["whakerkit", "whakerkit.*"]
[tool.setuptools.package-data]
whakerkit = [
"statics/*",
"statics/*/*",
"statics/locale/*/*/*.mo"
]
# -------------------
# Code tests
# -------------------
# Can check this config file with:
# import coverage
# x = coverage.config.HandyConfigParser(False)
# x.read("pyproject.toml")
[tool.coverage.report]
fail_under = 5
exclude_also = [
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"@(abc\\.)?abstractmethod"]
[tool.coverage.run]
source_pkgs = ["src"]
command_line = "-m unittest"
omit = [
"*/test*",
"**/__init__.py"]
[tool.coverage.xml]
output = "tests/coverage.xml"
# -------------------
# Static code analyser
# --------------------
[tool.pylint]
# See documentation here: https://pylint.pycqa.org/en/latest/user_guide/messages/index.html
# Nomenclature: F=Fatal, E=Error, W=Warning, C=Convention, R=Refacto, I=Information
disable = [
"C0114", # (missing-module-docstring)
"C0115", # (missing-class-docstring)
"C0116", # (missing-function-docstring)
"C0209", #
"R0903", # (too-few-public-methods)
"R0904", # (too-many-public-methods)
"R0913", # (too-many-arguments)
"R1716", # (chained-comparison)
"R1734", # (use-list-literal)
"R1735", # (use-dict-literal)
"W0107", # (unnecessary-pass)
"W0105", # (pointless-string-statement)
"W0702", # (bare-except)
"W0718", # (broad-exception-caught)
"W0719", # (broad-exception-raised)
"W1401"] # (anomalous-backslash-in-string)
[tool.pylint.basic]
# Allow shorter and longer variable names than the default.
argument-rgx = "[a-z_][a-z0-9_]*$"
attr-rgx = "[a-z_][a-z0-9_]*$"
variable-rgx = "[a-z_][a-z0-9_]*$"
[tool.pylint.logging]
# The type of string formatting that logging methods do. `old` means using %
# formatting, `new` is for `{}` formatting.
logging-format-style = "new"
logging-modules = ["logging"]
[tool.pylint.format]
# Maximum number of characters on a single line.
max-line-length = 120 # default is 80!
max-module-lines = 1500 # default is 1000
[tool.pylint.main]
# Naming style matching correct class names.
class-naming-style = "PascalCase"
# Regular expression matching correct class names. Overrides class-naming-style.
# If left empty, class names will be checked with the set naming style.
class-rgx = "[a-zA-Z][a-zA-Z]+" # default is "[A-Z][a-z]+"
[tool.pylint.design]
# Maximum number of arguments for function / method.
max-args = 8 # default is 5