forked from hikari-py/hikari
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
167 lines (152 loc) · 5.02 KB
/
pyproject.toml
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
162
163
164
165
166
167
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
[build-system]
requires = ["wheel", "setuptools"]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 120
include = ".*pyi?$"
skip-magic-trailing-comma = true
target-version = ["py38"]
[tool.coverage.run]
relative_files = true
parallel = true
branch = true
timid = false
source = ["hikari"]
omit = [
"hikari/__main__.py",
"hikari/cli.py",
]
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
sort = "cover"
exclude_lines = [
"\\#\\s*pragma: no cover$",
"^\\s*raise AssertionError$",
"^\\s*raise NotImplementedError$",
"^\\s*return NotImplemented$",
"^\\s*raise$",
"^\\s*pass$",
"^if __name__ == ['\"]__main__['\"]:$",
"^\\s*\\.\\.\\.$",
"^\\s*@abc.abstractmethod$",
"^\\s*if typing.TYPE_CHECKING:$",
# Whatever is in inside `if not typing.TYPE_CHECKING:` is expected to be tested, but the branch will always run, making
# coverage think that its only partial
"^\\s*if not typing.TYPE_CHECKING:$",
]
[tool.pyright]
include = ["hikari", "examples"]
exclude = ["examples/simple_dashboard.py", "**/__init__.py", "hikari/internal/enums.py", "hikari/internal/fast_protocol.py"]
pythonVersion = "3.8"
typeCheckingMode = "strict"
reportUnnecessaryTypeIgnoreComment = "error"
reportMissingTypeStubs = "none"
reportImportCycles = "none" # Doesn't account for TYPE_CHECKING
reportIncompatibleMethodOverride = "none" # This relies on ordering for keyword-only arguments
reportOverlappingOverload = "none" # Type-Vars in last overloads may interfere
reportIncompatibleVariableOverride = "none" # Cannot overwrite abstract properties using attrs
# Attrs validators will always be unknown
# https://github.com/python-attrs/attrs/issues/795
reportUnknownMemberType = "warning"
reportUntypedFunctionDecorator = "warning"
reportOptionalMemberAccess = "warning"
[tool.pytest.ini_options]
asyncio_mode = "strict"
xfail_strict = true
norecursedirs = [
"docs",
"*.egg-info",
".git",
"tasks",
".nox",
".pytest_cache",
".venv",
"venv",
"public",
"ci",
]
filterwarnings = [
"error", # Treat warnings as errors
"ignore:.*assertions not in test modules or plugins will be ignored .*:pytest.PytestConfigWarning",
]
required_plugins = ["pytest-asyncio"]
[tool.towncrier]
package = "hikari"
package_dir = "hikari"
directory = "changes"
template = "changes/.template.rst"
filename = "CHANGELOG.md"
issue_format = "[#{issue}](https://github.com/hikari-py/hikari/issues/{issue})"
# We use this differently in the template
underlines = [2, 3]
type = [
{ name = "Breaking Changes", directory = "breaking", showcontent = true },
{ name = "Deprecation", directory = "deprecation", showcontent = true },
{ name = "Features", directory = "feature", showcontent = true },
{ name = "Bugfixes", directory = "bugfix", showcontent = true },
{ name = "Documentation Improvements", directory = "documentation", showcontent = true },
]
[tool.isort]
profile = "black"
force_single_line = true
skip_glob = "**/__init__.pyi"
[tool.mypy]
# general settings
strict = true
check_untyped_defs = true
incremental = true
namespace_packages = true
no_implicit_optional = true
pretty = true
python_version = 3.8
show_column_numbers = true
show_error_codes = true
show_error_context = true
# stuff to allow
allow_untyped_globals = false
allow_redefinition = true
# stuff to disallow
disallow_untyped_decorators = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
# warnings
warn_no_return = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
module = 'rillrate.*'
ignore_missing_imports = true
[tool.slotscheck]
strict-imports = true
require-superclass = true
require-subclass = true
exclude-classes = """
(
^hikari\\.internal\\.enums:(Enum|Flag|_EnumMeta|_FlagMeta)$
)
"""