-
Notifications
You must be signed in to change notification settings - Fork 7
/
pyproject.toml
216 lines (201 loc) · 6.15 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# License: MIT
# Copyright © 2023 Frequenz Energy-as-a-Service GmbH
[build-system]
requires = ["setuptools == 75.6.0", "setuptools_scm[toml] == 8.1.0"]
build-backend = "setuptools.build_meta"
[project]
name = "frequenz-repo-config"
description = "Frequenz repository setup tools and common configuration"
readme = "README.md"
license = { text = "MIT" }
keywords = [
"config",
"frequenz",
"grpc",
"lib",
"library",
"mkdocs",
"nox",
"project",
"protobuf",
"python",
"repo-config",
"repository",
"setuptools",
"tool",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
]
requires-python = ">= 3.11, < 4"
dependencies = [
"nox >= 2022.11.21",
"mkdocs-gen-files >= 0.4.0, < 0.6.0",
"semver >= 3.0.1, < 4",
"github-action-utils >= 1.1.0, < 2",
]
dynamic = ["version"]
[[project.authors]]
name = "Frequenz Energy-as-a-Service GmbH"
email = "floss@frequenz.com"
[project.entry-points."distutils.commands"]
compile_proto = "frequenz.repo.config.setuptools.grpc_tools:CompileProto"
[project.optional-dependencies]
actor = []
api = [
"grpcio-tools >= 1.47.0, < 2",
"mypy-protobuf >= 3.0.0, < 4",
"setuptools >= 67.6.0, < 76",
]
app = []
lib = []
model = []
extra-lint-examples = [
"pylint >= 2.17.3, < 4",
"pytest >= 7.3.0, < 9",
"sybil >= 6.1.1, < 10",
]
dev-flake8 = [
"flake8 == 7.1.1",
"flake8-docstrings == 1.7.0",
"flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml
"pydoclint == 0.5.9",
"pydocstyle == 6.3.0",
]
dev-formatting = ["black == 24.10.0", "isort == 5.13.2"]
dev-mkdocs = [
"black == 24.10.0",
"Markdown == 3.7",
"mike == 2.1.3",
"mkdocs-gen-files == 0.5.0",
"mkdocs-literate-nav == 0.6.1",
"mkdocs-macros-plugin == 1.3.7",
"mkdocs-material == 9.5.46",
"mkdocstrings[python] == 0.27.0",
"mkdocstrings-python == 1.12.2",
]
dev-mypy = [
"mypy == 1.13.0",
"types-setuptools >= 67.6.0, < 76", # Should match the build dependency
"types-Markdown == 3.7.0.20240822",
"types-PyYAML == 6.0.12.20240917",
"types-babel == 2.11.0.15",
"types-colorama == 0.4.15.20240311",
# For checking the noxfile, docs/ script, and tests
"frequenz-repo-config[dev-mkdocs,dev-noxfile,dev-pytest]",
]
dev-noxfile = ["nox == 2024.10.9"]
dev-pylint = [
# dev-pytest already defines a dependency to pylint because of the examples
# For checking the noxfile, docs/ script, and tests
"frequenz-repo-config[dev-mkdocs,dev-noxfile,dev-pytest]",
"setuptools >= 67.6.0, < 76", # Should match the build dependency
]
dev-pytest = [
"pytest == 8.3.3",
"pylint == 3.3.1", # We need this to check for the examples
"cookiecutter == 2.6.0", # For checking the cookiecutter scripts
"jinja2 == 3.1.4", # For checking the cookiecutter scripts
"sybil >= 6.1.1, < 10", # Should be consistent with the extra-lint-examples dependency
]
dev = [
"frequenz-repo-config[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
]
[project.urls]
Documentation = "https://frequenz-floss.github.io/frequenz-repo-config-python/"
Changelog = "https://github.com/frequenz-floss/frequenz-repo-config-python/releases"
Issues = "https://github.com/frequenz-floss/frequenz-repo-config-python/issues"
Repository = "https://github.com/frequenz-floss/frequenz-repo-config-python"
Support = "https://github.com/frequenz-floss/frequenz-repo-config-python/discussions/categories/support"
[tool.black]
line-length = 88
target-version = ['py311']
include = '\.pyi?$'
[tool.isort]
profile = "black"
line_length = 88
src_paths = [
"benchmarks",
"examples",
"src",
"tests",
"cookiecutter/migrate.py",
]
[tool.flake8]
# We give some flexibility to go over 88, there are cases like long URLs or
# code in documenation that have extra indentation. Black will still take care
# of making everything that can be 88 wide, 88 wide.
max-line-length = 100
extend-ignore = [
"E203", # Whitespace before ':' (conflicts with black)
"W503", # Line break before binary operator (conflicts with black)
]
# pydoclint options
style = "google"
check-return-types = false
check-yield-types = false
arg-type-hints-in-docstring = false
arg-type-hints-in-signature = true
allow-init-docstring = true
check-class-attributes = false
[tool.pylint.similarities]
ignore-comments = ['yes']
ignore-docstrings = ['yes']
ignore-imports = ['no']
min-similarity-lines = 40
[tool.pylint.messages_control]
disable = [
"too-few-public-methods",
"too-many-return-statements",
# disabled because it conflicts with isort
"wrong-import-order",
"ungrouped-imports",
# Checked by mypy (and pylint is very flaky checking these)
"unsubscriptable-object",
"no-member",
"no-name-in-module",
"possibly-used-before-assignment",
# Checked by flake8
"f-string-without-interpolation",
"line-too-long",
"missing-function-docstring",
"redefined-outer-name",
"unnecessary-lambda-assignment",
"unused-import",
"unused-variable",
]
[tool.mypy]
explicit_package_bases = true
namespace_packages = true
# This option disables mypy cache, and it is sometimes useful to enable it if
# you are getting weird intermittent error, or error in the CI but not locally
# (or vice versa). In particular errors saying that type: ignore is not
# used but getting the original ignored error when removing the type: ignore.
# See for example: https://github.com/python/mypy/issues/2960
#no_incremental = true
packages = ["frequenz.repo.config"]
strict = true
[[tool.mypy.overrides]]
module = [
"cookiecutter",
"cookiecutter.*",
"github_action_utils",
"mkdocs_macros.*",
"semver.version",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
addopts = "-W=all -Werror -Wdefault::DeprecationWarning -Wdefault::PendingDeprecationWarning -vv"
testpaths = ["src", "tests"]
markers = [
"integration: integration tests (deselect with '-m \"not integration\"')",
"cookiecutter: integration tests (deselect with '-m \"not cookiecutter\"')",
]
[tool.setuptools_scm]
version_scheme = "post-release"