-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
130 lines (121 loc) · 4.57 KB
/
pyproject.toml
File metadata and controls
130 lines (121 loc) · 4.57 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
# Python project configuration.
# File format is STANDARDIZED in the PEP 518:
# https://www.python.org/dev/peps/pep-0518/
# --------------------------------------------------------- BUILD-SYSTEM
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
# --------------------------------------------------------------- POETRY
# Python packaging and dependency management.
# Docs: https://python-poetry.org/docs/
[tool.poetry]
name = "PythonProjectTemplate"
version = "0.1.0"
description = "Python project template by Prokher."
authors = ["Alexander A. Prokhorov <prokher@gmail.com>"]
license = "MIT"
[tool.poetry.dependencies]
# Version syntax: https://python-poetry.org/docs/versions/
python = ">=3.6.1, <4"
[tool.poetry.group.dev.dependencies]
# Development dependencies. Python packages needed for development.
# Installed when you run `poetry install`.
# Version syntax: https://python-poetry.org/docs/versions/
black = { version = ">=19.10b0", allow-prereleases = true }
cookiecutter = ">=1.7.0"
coverage = ">=5.0.4"
ipython = "*"
isort = {version = ">=4.3.21", extras = ["pyproject"]}
mypy = ">=0.770"
pre-commit = ">=2.2.0"
pydocstyle = ">=5.0.2"
pylint = ">=2.5.0"
pylint-quotes = ">=0.2.1"
pytest = ">=5.4.1"
pytest-asyncio = ">=0.10.0"
pytest-cookies = ">=0.5.1"
pytest-cov = ">=2.8.1"
pytest-pythonpath = ">=0.7.3"
tox = ">=3.14.6"
# ---------------------------------------------------------------- BLACK
# Black - the uncompromising code formatter.
# https://black.readthedocs.io/en/stable/index.html
[tool.black]
target-version = ['py37', 'py38', 'py39', 'py310']
# ---------------------------------------------------------------- ISORT
# Isort configuration.
# Docs: https://github.com/timothycrosley/isort/wiki/isort-Settings
[tool.isort]
profile="black"
# --------------------------------------------------------------- PYLINT
# Pylint code checker configuration.
# - Pylint docs:
# https://pylint.readthedocs.io/en/latest/
# - Configuration reference:
# http://pylint.pycqa.org/en/latest/technical_reference/features.html
[tool.pylint.MASTER]
# Work in parallel.
jobs = "0"
load-plugins = "pylint_quotes"
# Do not store results of previous runs.
persistent = "no"
# Allow to load C extension modules.
unsafe-load-any-extension = "yes"
[tool.pylint."MESSAGES CONTROL"]
# design: Do not count lines, members, ..., no use.
# similarities: Duplication does not mean bad design by itself.
disable = "design,similarities"
enable = "c-extension-no-member"
[tool.pylint.BASIC]
# It is OK to have 2-letters identifiers, e.g. 'id' or 'ok'. Also allow
# long identifiers, cause there is a strong line length limitation which
# will force engineers to thing twice before giving too long names.
argument-rgx = "[a-z_][a-z0-9_]{1,64}$"
attr-rgx = "[a-z_][a-z0-9_]{1,64}$"
bad-names = "foo,bar,baz,toto,tutu,tata,responce,pathes"
class-attribute-rgx = "([A-Za-z_][A-Za-z0-9_]{1,64}|(__.*__))$"
function-rgx = "[a-z_][a-z0-9_]{1,64}$"
good-names = "i,j,k,ex,Run,_"
method-rgx = "[a-z_][a-z0-9_]{1,64}$"
# Docstrings are needed everywhere.
no-docstring-rgx = "^$"
variable-rgx = "[a-z_][a-z0-9_]{1,64}$"
[tool.pylint.FORMAT]
max-line-length="88"
max-module-lines="9000" # Right, over nine thousand!
[tool.pylint.STRING_QUOTES]
docstring-quote = "double"
string-quote = "double-avoid-escape"
triple-quote = "double"
[tool.pylint.REFACTORING]
# We have line length 88, no need to check.
max-nested-blocks = "9000"
[tool.pylint.REPORTS]
reports = "no"
score = "no"
# ----------------------------------------------------------------- MYPY
# MyPy configuration.
# Docs: https://mypy.readthedocs.io/en/latest/config_file.html
[tool.mypy]
check_untyped_defs = true
ignore_missing_imports = true
warn_return_any = true
warn_unused_configs = true
# ----------------------------------------------------------- PYDOCSTYLE
# Pydocstyle configuration reference:
# http://www.pydocstyle.org/en/latest/usage.html#available-options
[tool.pydocstyle]
# Redefine match rules, cause by default it skips `test_*` files.
match=".*\\.py"
# Disable some checks:
# - D202: No blank lines allowed after function docstring. We cannot
# follow this, cause Black inject blank line before function
# declaration and if it is a nested function when this violates this
# rule.
# - D401: First line should be in imperative mood; try rephrasing. Often
# it is not possible. Especially for callback functions such as "A new
# message handler."
# - D403: First word of the first line should be properly capitalized.
# There is nothing bad in using words like "WebSocket" or
# "MessagePack" even in the beginning of the docstring.
add_ignore="D202,D401,D403"