-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
201 lines (178 loc) · 5.57 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
[build-system]
requires = [
"setuptools >= 60.0.0",
"wheel",
"pip",
] # `pip` is required to install in editable mode
build-backend = "setuptools.build_meta"
[project]
name = "mode-ng"
version = "0.7.0.dev0"
description = "AsyncIO Service-based programming."
readme = "README.rst"
requires-python = ">=3.10"
license = { text = "BSD 3-Clause License" }
authors = [{ name = "Ask Solem", email = "[email protected]" }]
maintainers = [{ name = "Lanqing Huang", email = "[email protected]" }]
keywords = ["asyncio", "service", "bootsteps", "graph", "coroutine", "actor"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Unix",
"Environment :: No Input/Output (Daemon)",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
]
urls = { homepage = "https://github.com/lqhuang/mode-ng" }
dynamic = ["dependencies", "optional-dependencies"]
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["tests", "docs", "scripts", "examples"]
namespaces = false
[tool.setuptools.package-data]
mode = ["py.typed"]
# ========================
# MYPY
# ========================
[tool.mypy]
# doc: https://mypy.readthedocs.io/en/stable/config_file.html
# --strict but not --no-implicit-optional
# Import discovery
ignore_missing_imports = true
follow_imports = "normal"
# Platform configuration
# python_version = "3.10"
# Disallow dynamic typing
disallow_any_unimported = true
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_generics = false
disallow_subclassing_any = true
# Untyped definitions and calls
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
# None and Optional handling
no_implicit_optional = false
strict_optional = true
# Configuring warnings
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true
# Miscellaneous strictness flags
implicit_reexport = false
strict_equality = true
# Configuring error messages
show_column_numbers = true
show_error_context = true
show_error_codes = true
# pretty = true # disable for IDE parser; try add cli option in Makefile
# Incremental mode
cache_fine_grained = true
# Advanced options
warn_incomplete_stub = true
# Miscellaneous
warn_unused_configs = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = true
disallow_untyped_calls = false
# ========================
# Pyright (pylance)
# ========================
[tool.pyright]
# https://github.com/microsoft/pyright/blob/main/docs/configuration.md#main-pyright-config-options
typeCheckingMode = "basic"
reportGeneralTypeIssues = false
# reportPrivateUsage = false
# ========================
# black & isort
# ========================
# NOTE: you have to use single-quoted strings in TOML for regular expressions.
# It's the equivalent of r-strings in Python. Multiline strings are treated as
# verbose regular expressions by Black. Use [ ] to denote a significant space
# character.
[tool.black]
line-length = 88
include = '\.pyi?$'
# If `--exclude` is not set, Black will automatically ignore files and directories
# in `.gitignore` file(s), if present.
# If you want Black to continue using `.gitignore` while also configuring the
# exclusion rules, please use `--extend-exclude`.
extend-exclude = '''
(
# A regex preceded with ^/ will apply only to files and directories
# in the root of the project.
| \.eggs
| \.git
| \.tox
| \.venv
| \.env
| env
| _build
| build
| dist
)
'''
[tool.isort]
profile = "black"
# line_length = 79
known_typing = ["typing", "typing_extensions", "collections.abc"]
known_first_party = "mode"
sections = "FUTURE,TYPING,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
# ========================
# docformatter
# ========================
[tool.docformatter]
recursive = true
syntax = "google" # One of sphinx, numpy, or google
black = true # Formats docstrings to be compatible with black.
wrap-summaries = 72 # PEP8: comments and docstrings are still wrapped at 72 characters
wrap-descriptions = 72
# ========================
# Ruff
# ========================
[tool.ruff]
line-length = 88
# Enable rules:
# Pyflakes (F), pycodestyle (E, W), pydocstyle (D), pyupgrade (UP),
# flake8-bandit (S), flake8-bugbear (B), flake8-comprehensions (C4)
# Pylint (PLC, PLE, PLR, PLW), Ruff-specific rules (RUF)
select = ["F", "E", "W", "UP", "S", "B", "C4", "PLC", "PLE", "PLR", "PLW"]
extend-select = ["RUF"]
ignore = [
"E501", # Line too long (95 > 88 characters)
"S101", # Use of `assert` detected
"RUF100", # Unused `noqa` directive for: E305 (not implemented)
]
fix = false
# A list of check code prefixes to consider autofix-able.
fixable = ["F", "E711", "UP", "B"]
unfixable = ["I"]
ignore-init-module-imports = true
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"] # imported but unused
# [tool.bandit]
# # B101: assert_used
# # B104: hardcoded_bind_all_interfaces
# skips = ["B101", "B104"]
# ========================
# Pytest
# ========================
[tool.pytest.ini_options]
python_classes = "test_*"
testpaths = ["tests"]
asyncio_mode = "strict" # for `pytest-asyncio`