-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathpyproject.toml
200 lines (178 loc) · 4.65 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
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"
[project]
name = "yandexcloud"
version = "0.330.0"
authors = [{name = "Yandex LLC", email = "[email protected]"}]
license = {text = "MIT"}
description = "The Yandex Cloud official SDK"
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"cryptography>=43.0.1",
"grpcio>=1.64.0,<2",
"protobuf>=5.0.0,<6",
"googleapis-common-protos>=1.63.0,<2",
"pyjwt>=2.8.0,<3",
"requests>=2.32.3,<3",
"six>=1.16.0,<2",
"grpcio-tools>=1.59.3",
]
[project.readme]
file = "README.md"
content-type = "text/markdown"
[project.urls]
Homepage = "https://github.com/yandex-cloud/python-sdk"
[dependency-groups]
dev = [
"pre-commit>=4.0.1",
"python-semantic-release>=v9.8.8",
"tox-gh>=1.3.1",
"tox>=4.14.2",
"yandexcloud",
]
format = [
"black>=24.4.2",
"isort>=5.13.2",
]
genproto = [
"grpcio-tools>=1.59.3",
"mypy-protobuf>=3.6.0",
]
type = [
"mypy>=1.10",
"grpc-stubs>=1.53.0.5",
"types-requests>=2.32.0.20241016",
"types-six>=1.17.0.20241205",
]
style = [
"flake8>=7.0.0",
"flake8-pyproject>=1.2.3",
"pylint>=3.1.0",
]
test = [
"pytest>=8.1.1",
]
[tool.setuptools]
zip-safe = false
include-package-data = true
[tool.setuptools.packages.find]
# include = ["yandexcloud*"] # yandex*
include = ["yandexcloud*", "yandex*"]
namespaces = false
[tool.semantic_release]
version_variables = ["yandexcloud/__init__.py:__version__"]
version_toml = ["pyproject.toml:project.version"]
# https://python-semantic-release.readthedocs.io/en/latest/configuration.html#major-on-zero
major_on_zero = false
commit_parser = "angular"
[tool.black]
line-length = 120
[tool.isort]
profile = "black"
[tool.pylint.FORMAT]
max-line-length=120
[tool.pylint.MASTER]
disable= [
"C0114", # Missing module docstring (missing-module-docstring)
"C0115", # Missing class docstring (missing-class-docstring)
"C0116", # Missing function or method docstring (missing-function-docstring)
"E0611", # No name 'Empty' in module 'google.protobuf.empty_pb2' (no-name-in-module) — proto code creates attributes in runtime and linter goes crazy
"R0903", # Too few public methods (1/2) (too-few-public-methods)
"R0913", # Too many arguments (6/5) (too-many-arguments)
"R0917", # Too many positional arguments (6/5) (too-many-positional-arguments)
]
[tool.flake8]
max-line-length = 120
max-complexity = 15
# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#slices
ignore = ['E203',]
[tool.mypy]
disallow_untyped_defs = true
disallow_any_unimported = true
check_untyped_defs = true
no_implicit_reexport = true
warn_unreachable = true
warn_unused_configs = true
warn_redundant_casts = true
# mypy per-module options:
[[tool.mypy.overrides]]
module = [
"yandex.cloud.*",
]
disallow_untyped_defs = false
check_untyped_defs = false
disallow_any_unimported = false
[[tool.mypy.overrides]]
module = [
"google.rpc.status_pb2.*",
"google.rpc.*",
]
ignore_missing_imports = true
[tool.tox]
env_list = [
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"type",
"format",
"style",
]
skip_missing_interpreters = true
[tool.tox.env_run_base]
description = "Run tests under {base_python}"
dependency_groups = [
"test",
]
commands = [["pytest"]]
[tool.tox.env.type]
description = "Check types with mypy"
skip_install = true
dependency_groups = [
"type",
"genproto",
"dev" # without it cannot import jwt and cryptography dependencies and E0401 is raised
]
commands = [["mypy", "yandexcloud"]] # TODO: add `tests` directory
[tool.tox.env.format]
description = "Format code with black and isort"
skip_install = true
dependency_groups = [
"format",
]
commands = [
["black", "--check", "--diff", "yandexcloud"],
["isort", "--check", "--diff", "yandexcloud"],
]
[tool.tox.env.style]
description = "Check style with flake8 and pylint"
skip_install = true
dependency_groups = [
"style",
"dev" # without it cannot import yandexcloud dependencies and E0401 is raised
]
commands = [
["flake8", "yandexcloud"],
["pylint", "yandexcloud"],
]
[tool.tox.gh.python]
# uncomment when upgrade grpcio-tools, current version does not work with 3.13
"3.13" = ["3.13"]
"3.12" = ["3.12"]
"3.11" = ["3.11"]
"3.10" = ["3.10"]
"3.9" = ["3.9"]
"type" = ["type"]
"format" = ["format"]
"style" = ["style"]