-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpyproject.toml
More file actions
237 lines (219 loc) · 7.62 KB
/
pyproject.toml
File metadata and controls
237 lines (219 loc) · 7.62 KB
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
[project]
name = "mergify_cli"
dynamic = ["version"]
description = "Mergify CLI is a tool that automates the creation and management of stacked pull requests on GitHub and handles CI results upload"
authors = [{ name = "Mergify Team", email = "hello@mergify.com" }]
requires-python = ">=3.13"
readme = "README.md"
license = "Apache-2.0"
keywords = ["git", "github", "pull-request", "stacked-pr", "ci", "merge"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Version Control :: Git",
"Typing :: Typed",
]
dependencies = [
"httpx==0.28.1",
"jsonschema==4.26.0",
"rich==15.0.0",
"aiofiles==25.1.0",
"click==8.3.2",
"opentelemetry-exporter-otlp-proto-http==1.41.0",
"opentelemetry-sdk==1.41.0",
"tenacity==9.1.4",
"pyyaml==6.0.3",
"pydantic==2.13.2",
"questionary>=2.0.0",
"tzlocal==5.3.1",
]
[project.scripts]
mergify = "mergify_cli.cli:main"
[project.urls]
Homepage = "https://mergify.com"
Documentation = "https://docs.mergify.com"
Repository = "https://github.com/Mergifyio/mergify-cli"
Issues = "https://github.com/Mergifyio/mergify-cli/issues"
Changelog = "https://github.com/Mergifyio/mergify-cli/releases"
[dependency-groups]
dev = [
"mypy==1.20.1",
"mypy-extensions==1.1.0",
"ruff==0.15.11",
"pytest==9.0.3",
"poethepoet==0.44.0",
"pytest-asyncio==1.3.0",
"respx==0.23.1",
"types-aiofiles==25.1.0.20260409",
"types-click==7.1.8",
"types-jsonschema==4.26.0.20260408",
"types-pyyaml==6.0.12.20260408",
"anys==0.3.1",
"responses==0.26.0",
]
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
fallback-version = "0"
[tool.pytest.ini_options]
asyncio_mode = "auto"
[tool.poe]
include = ["poe.toml"]
[tool.mypy]
strict = true
warn_unreachable = true
exclude = [".venv"]
files = ["mergify_cli"]
show_error_codes = true
[tool.ruff]
line-length = 88
indent-width = 4
target-version = "py313"
[tool.ruff.lint]
preview = true
select = [
"E", "W", "F", "I", "A", "B", "Q",
"C4", "T10", "ISC", "ICN", "BLE",
"G", "RSE", "TID", "TRY", "UP",
"RUF", "RET", "DTZ", "TC", "COM",
"PERF", "PT", "PGH", "SIM",
"PIE", "YTT", "T20", "ARG", "PTH",
"N", "PYI", "FURB", "FBT", "S",
"NPY", "FA", "LOG", "SLOT",
"PLC", "PLE", "PLR", "PLW",
"FAST",
# FIXME(sileht): doctring/rst-docstring like
# "D"
]
ignore = [
# NOTE: Parameter {arg_name} appears in route path, but not in {function_name} signature
"FAST003",
# NOTE: subclassing of collections.UserDict/List/String instead of dict/list/string
"FURB189",
# NOTE: we don't care that much about shadowing Python modules
"A004", "A005",
# NOTE(Greesb): subprocess module is possibly insecure
"S404",
# NOTE(Greesb): Starting a process with a partial executable path
"S607",
# NOTE(Greesb): itertools.starmap is less efficient than list comprehensions
"FURB140",
# NOTE(Greesb): Checks for union annotations that contain redundant numeric types (e.g., int | float).
# too confusing to only have `float` as typing when the function can also receive an `int`
"PYI041",
# NOTE(Greesb): Function name should be lowercase
# For a lot of usecases it makes sense to want to not use lowercase
"N802",
# NOTE(Greesb): variable in function should be lowercase
# For a lot of usecases it makes sense to want to not use lowercase variables
"N806",
# NOTE(Greesb): contextlib.suppress is slower than try-except-pass
"SIM105",
# NOTE(Greesb): Import should be at the top level of the file
# we already have isort for this, also when we do not have an import at top level
# it's because of circular imports
"PLC0415",
# NOTE(Greesb): Method could be a function, classmethod or static method
# rule useless since we have a lot of abstraction
"PLR6301",
# NOTE(Greesb): Magic value used in comparison
# Interesting but will require a refactor, and will need to be ignored
# in tests
"PLR2004",
# NOTE(Greesb): too many public methods
"PLR0904",
# NOTE(Greesb): Too many return, branches, arguments, local variables, statements, positional arguments.
# Interesting but will require a big refactor
"PLR0911", "PLR0912", "PLR0913", "PLR0914", "PLR0915", "PLR0917",
# NOTE(Greesb): Too many nested blocks
# interesting but require some refactor
"PLR1702",
# NOTE(Greesb): custom class with __eq__ but no __hash__
# We don't need it
"PLW1641",
# NOTE(Greesb): Checks for the use of global statements to update identifiers.
"PLW0603",
# NOTE(Greesb): subprocess.run without explicit check argument
"PLW1510",
# NOTE(Greesb): continue not supported inside finally clause
# only useful for python < 3.8
"PLE0116",
# NOTE(Greesb): we use mock.patch.object, which automatically pass
# the mock as an argument to the test if no `new` is specified, without
# needing the mock itself.
"PT019",
# NOTE(sileht): not compatible with ruff-format
"ISC001",
# NOTE(sileht): line-length is up to black
"E501",
# NOTE(sileht): we prefer using exc_info=True
"G201", "TRY400",
# NOTE(sileht): "Unnecessary parentheses on raised exception", this breaks
# isinstance on exception
"RSE102",
# NOTE(sileht): No exception with message set via __init__
"TRY003", "TRY301",
# NOTE(sileht): This enforce usage of raise ... from ...
"B904",
# FIXME(sileht): very interesting, ruff BLE is far better that flake8-blind-except
"BLE001",
# NOTE(Greesb): mypy doesn't support the `type myvar = [...]` syntax yet
"UP040",
]
[tool.ruff.lint.flake8-pytest-style]
parametrize-values-type = "list"
parametrize-values-row-type = "tuple"
[tool.ruff.lint.flake8-type-checking]
strict = true
quote-annotations = true
# https://docs.astral.sh/ruff/settings/#lint_flake8-type-checking_runtime-evaluated-base-classes
runtime-evaluated-base-classes = [
"typing.Annotated",
"pydantic.BaseModel",
"pydantic.TypeAdapter",
# typing.TypedDict is generally used by pydantic for validation,
# so we need the imports of the key of a typing.TypedDict class
# to be available at runtime.
"typing.TypedDict",
]
# https://docs.astral.sh/ruff/settings/#lint_flake8-type-checking_exempt-modules
# Modules that should not be moved to a type-checking block.
exempt-modules = [
"typing",
"annotated_types",
]
# https://docs.astral.sh/ruff/settings/#lint_flake8-type-checking_runtime-evaluated-decorators
# Exempt classes and functions decorated with any of the enumerated decorators
# from being moved into type-checking blocks.
runtime-evaluated-decorators = [
"pydantic.dataclasses.dataclass",
]
[tool.ruff.lint.per-file-ignores]
"mergify_cli/tests/**/*.py" = [
# Use of assert detected
"S101",
# hardcoded passwords
"S105", "S106",
# Standard pseudo-random generators are not suitable for cryptographic purposes
"S311",
# subprocess call: check for execution of untrusted input
"S603",
# Magic value used in comparison
"PLR2004",
# Function is declared async, but doesn't await or use async features.
"RUF029",
]
[tool.ruff.lint.isort]
force-single-line = true
force-sort-within-sections = true
lines-after-imports = 2
known-first-party = ["mergify_cli"]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"