[go: up one dir, main page]

Menu

[172b15]: / pyproject.toml  Maximize  Restore  History

Download this file

162 lines (141 with data), 5.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# ---------------------------------------------------------------------------
# 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