-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
126 lines (108 loc) · 3.48 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
[tool.poetry]
name = "pr-workflow-example"
version = "1.0.1"
description = "A stupid calculator (to use as an example repo for github PRs)"
authors = [
"Jan Katins <[email protected]>",
]
license = "MIT"
readme = "README.md"
documentation = "https://jankatins.github.io/pr-workflow-example"
homepage = "https://jankatins.github.io/pr-workflow-example"
repository = "https://github.com/jankatins/pr-workflow-example"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
packages = [
{ include = "calculator", from = "src" }
]
[tool.poetry.dependencies]
python = ">=3.10, <4.0"
[tool.poetry.group.dev.dependencies]
pre-commit = "*"
ruff = "*"
black = "*"
mypy = "*"
pipdeptree = "*"
pytest = "*"
pytest-github-actions-annotate-failures = "*"
pytest-cov = "*"
python-kacl = "*"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.black]
target-version = ["py310", "py311", "py312"]
include = '\.pyi?$'
[tool.pytest.ini_options]
addopts = """\
--cov calculator \
--cov tests \
--cov-report term-missing \
--no-cov-on-fail \
"""
[tool.coverage.report]
fail_under = 100
exclude_lines = [
'if TYPE_CHECKING:',
'pragma: no cover'
]
[tool.mypy]
disallow_any_unimported = true
disallow_untyped_defs = true
no_implicit_optional = true
strict_equality = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_return_any = true
check_untyped_defs = true
show_error_codes = true
[tool.ruff]
line-length = 120
target-version = "py310"
[tool.lint.ruff]
# ALL = ALL tests unless explicitly disabled!
select = ["ALL"]
ignore = [
"FLY002", # Consider <long string> instead of string join
"ISC003", # Explicitly concatenated string should be implicitly concatenated
"COM812", # Trailing comma missing
"PT003", # `scope='function'` is implied in `@pytest.fixture()`
"ANN101", # Missing type annotation for `self` in method
"ERA001", # Found commented-out code -> maybe put only into unfixable and make it mandatory to ignore it?
"EM101", "EM102", # Exception must not use a string literal/f-string, assign to variable first
"TRY003", # Avoid specifying messages outside exception class
"RET504", # Unnecessary variable assignment before `return` statement
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"PTH123", # open() should be replaced by Path.open()
"TD", # Do not check TODO marker at all, for now
]
unfixable = [
]
exclude = [
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # asserts allowed in tests...
"FBT", # Don't care bout booleans as positional arguments
"ARG", # Unused function args -> fixtures nevertheless are functionally relevant...
"PLR2004", # Magic value used in comparison, ...
"PLC1901", # `val == ""` can be simplified to `not val` as an empty string is falsey
]
[tool.ruff.lint.isort]
# Naming a local folder after a package is trouble
combine-as-imports = true
[tool.ruff.lint.mccabe]
# Flag errors (`C901`) whenever the complexity level exceeds 15 (default: 10).
max-complexity = 15
[tool.ruff.lint.pydocstyle]
# Use Google-style docstrings.
convention = "google"