-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
112 lines (95 loc) · 3.46 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
[project]
requires-python = ">=3.10,<=3.13"
[tool.poetry]
name = "operationbot"
version = "0.48.0"
description = "Operations bot for the Zeusops discord"
authors = ["Sami Laine <[email protected]>"]
readme = "README.md"
license = "GPL-3.0-or-later"
[tool.poetry.scripts]
operationbot = "operationbot.cli:cli"
[tool.poetry.dependencies]
python = ">=3.10"
# Discord bot lib
"discord.py" = ">=1.3.4,<2.0.0"
# Yaml parser
pyyaml = "*"
# Note: Linters not defined in this file but .pre-commit-config.yaml, which
# installs/manages each tool in its own isolated virtualenv
[tool.poetry.group.test.dependencies]
pytest = "7.*"
# Test coverage
pytest-cov = "4.*"
# Clearer assertion failures (colorful diff)
pytest-clarity = "1.*"
# For testing async functions
pytest-asyncio = "*"
[tool.poetry.group.docs.dependencies]
# Main documentation-as-code (HTML/PDF generator)
Sphinx = "*"
# Read the docs (pretty) theme for sphinx
sphinx-rtd-theme = "1.*"
# Markdown parser for sphinx: Sphinx uses "RST" files, this adds markdown
myst-parser = "*"
# Automatic Python module docs (javadoc-style)
sphinx-autodoc2 = "*"
# Generate Dash/Zeal "docsets" (offline dev-docs package) from HTML docs
doc2dash = "*"
# Astroid v3.0.0 breaks autodoc dependencies ==> pinning to <3.0.0
# See https://github.com/sphinx-extensions2/sphinx-autodoc2/issues/31
astroid = "<3.0.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
# Make isort work with Black
# Avoids conflicting imports
# As per https://pycqa.github.io/isort/docs/configuration/black_compatibility/#using-a-config-file-such-as-isortcfg
[tool.isort]
profile = "black"
multi_line_output = 3
# Avoid pointless warning about performance hit of f-string in loggers
[tool.pylint.message_control]
disable = ["logging-fstring-interpolation"]
[tool.pytest.ini_options]
addopts = """-vv \
--doctest-modules \
--cov=operationbot \
--cov-report=xml:test_results/coverage.xml \
--cov-report=html:test_results/coverage.html \
--cov-report=term \
--junit-xml=test_results/results.xml"""
[tool.ruff]
# Always fix what you can, without needing CLI flags
fix = true
unfixable = [
"ERA", # do not autoremove commented out code
]
# Black compat:
line-length = 88
extend-exclude = ["docs/*"]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
# Add I = isort (import sorter), to remove need for isort itself
# And D = pydocstyle for docstrings
select = ["E", "F", "I", "D"]
extend-ignore = [
# D400/D415 = First line (of dosctrings) should end with [.?!]
"D400",
"D415",
# Disable most docstring checks for now
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
# "D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in __init__
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
# Use Google-style docstrings
pydocstyle = {convention = "google"}
[tool.mypy]
python_version = "3.11"
check_untyped_defs = true