-
Notifications
You must be signed in to change notification settings - Fork 12
/
pyproject.toml
163 lines (148 loc) · 5.16 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
# License: MIT
# Copyright © 2023 Frequenz Energy-as-a-Service GmbH
[build-system]
requires = [
"setuptools == 68.1.0",
"setuptools_scm[toml] == 7.1.0",
"frequenz-repo-config[api] == 0.10.0",
# We need to pin the protobuf, grpcio and grpcio-tools dependencies to make
# sure the code is generated using the minimum supported versions, as older
# versions can't work with code that was generated with newer versions.
# https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards
"protobuf == 5.28.0",
"grpcio-tools == 1.66.1",
"grpcio == 1.66.1",
]
build-backend = "setuptools.build_meta"
[project]
name = "frequenz-api-common"
description = "Frequenz common gRPC API and bindings"
readme = "README.md"
license = { text = "MIT" }
keywords = ["frequenz", "python", "api", "grpc", "protobuf", "rpc", "common"]
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 = [
# We can't widen beyond the current value unless we bump the minimum
# requirements too because of protobuf cross-version runtime guarantees:
# https://protobuf.dev/support/cross-version-runtime-guarantee/#major
"protobuf >= 5.28.0, < 7", # Do not widen beyond 7!
# We couldn't find any document with a spec about the cross-version runtime
# guarantee for grpcio, so unless we find one in the future, we'll assume
# major version jumps are not compatible
"grpcio >= 1.66.1, < 2", # Do not widen beyond 2!
]
dynamic = ["version"]
[[project.authors]]
name = "Frequenz Energy-as-a-Service GmbH"
email = "floss@frequenz.com"
[project.optional-dependencies]
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 = [
"mike == 1.1.2",
"mkdocs-gen-files == 0.5.0",
"mkdocs-literate-nav == 0.6.1",
"mkdocs-material == 9.5.43",
"mkdocstrings[python] == 0.26.2",
"frequenz-repo-config[api] == 0.10.0",
]
dev-mypy = [
"mypy == 1.13.0",
"grpc-stubs == 1.53.0.5",
# For checking the noxfile, docs/ script, and tests
"frequenz-api-common[dev-mkdocs,dev-noxfile,dev-pytest]",
]
dev-noxfile = ["nox == 2024.10.9", "frequenz-repo-config[api] == 0.10.0"]
dev-pylint = [
"pylint == 3.3.1",
# For checking the noxfile, docs/ script, and tests
"frequenz-api-common[dev-mkdocs,dev-noxfile,dev-pytest]",
]
dev-pytest = [
"pytest == 8.3.3",
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
]
dev = [
"frequenz-api-common[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
]
[project.urls]
Changelog = "https://github.com/frequenz-floss/frequenz-api-common/releases"
Issues = "https://github.com/frequenz-floss/frequenz-api-common/issues"
Repository = "https://github.com/frequenz-floss/frequenz-api-common"
Support = "https://github.com/frequenz-floss/frequenz-api-common/discussions/categories/support"
[tool.black]
line-length = 88
target-version = ['py311']
[tool.isort]
profile = "black"
line_length = 88
src_paths = ["benchmarks", "examples", "src", "tests"]
[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
[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",
# disabled because it conflicts with isort
"wrong-import-order",
"ungrouped-imports",
# pylint's unsubscriptable check is buggy and is not needed because
# it is a type-check, for which we already have mypy.
"unsubscriptable-object",
# Checked by flake8
"line-too-long",
"unused-variable",
"unnecessary-lambda-assignment",
]
[tool.pytest.ini_options]
testpaths = ["pytests"]
[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.api.common"]
strict = true
[tool.setuptools.package-dir]
"" = "py"
[tool.setuptools.package-data]
"*" = ["*.pyi"]
[tool.setuptools_scm]
version_scheme = "post-release"