-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
203 lines (180 loc) · 5.51 KB
/
pyproject.toml
File metadata and controls
203 lines (180 loc) · 5.51 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
[project]
name = "annofabapi"
dynamic = ["version"]
description = "Python Client Library of Annofab WebAPI (https://annofab.com/docs/api/)"
authors = [{ name = "Kurusugawa Computer Inc." }]
requires-python = ">=3.10"
readme = "README.md"
license = "MIT"
keywords = [
"annofab",
"api",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Utilities",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14"
]
dependencies = [
"requests",
"isodate",
"python-dateutil",
"backoff",
"dataclasses-json",
"more-itertools",
"pydantic>=2,<3",
]
[project.optional-dependencies]
segmentation = [
"numpy",
"pillow",
]
[project.urls]
Repository = "https://github.com/kurusugawa-computer/annofab-api-python-client"
[dependency-groups]
test = [
"pytest>=8,<10",
"pytest-xdist",
"pytest-cov",
]
linter = [
"ruff>=0.15 ; python_version >= '3.13'",
"mypy>=1,<2 ; python_version >= '3.13'",
"types-requests",
"types-python-dateutil",
"types-dataclasses",
]
documentation = [
"sphinx>=9 ; python_version >= '3.13'",
"pydata-sphinx-theme ; python_version >= '3.13'",
]
dev = [
"ipython",
"numpy>=2.1 ; python_version >= '3.13'",
]
[tool.uv]
default-groups = [
"test",
"linter",
"documentation",
"dev",
]
[tool.mypy]
# スタブが無いパッケージのエラーは無視させる.サードパーティのライブラリに型情報がないケースもあるため
ignore_missing_imports = true
# 型ヒントが付いていない関数もチェックする
check_untyped_defs = true
warn_unused_configs = true
warn_unreachable = true
exclude = [
'annofabapi/pydantic_models/.*\.py',
]
show_column_numbers = true
[tool.ruff]
target-version = "py310"
line-length = 150
exclude = [
"annofabapi/__init__.py",
]
[tool.ruff.lint]
exclude = [
'annofabapi/pydantic_models/.*\.py',
]
ignore = [
"PD002", #すでにpandasで`inplace=True`はいろんなところで使っているため
"RUF001", # 全角記号など`ambiguous unicode character`も使いたいため
"RUF002",# 全角記号など`ambiguous unicode character`も使いたいため
"RUF003",# 全角記号など`ambiguous unicode character`も使いたいため
"PLC1901", # compare-to-empty-string : `if a == "`のように空文字列で直接比較したいときがあるため
"PLR2004", # magic-value-comparison: listのサイズで判定するときがよくあるため
"ANN002", # missing-type-args
"ANN003", # missing-type-kwargs
"ERA", # : 役立つこともあるが、コメントアウトしていないコードも警告されるので無視する
"TD", # flake8-todos
"FIX", # flake8-fixme
"SIM108", # if-else-block-instead-of-if-exp, 三項演算子が読みにくい場合もあるので無視する
# 以下のルールはコードに合っていないので無効化した
"RSE", # flake8-raise
"D", # pydocstyle, Docstringを中途半端にしか書いていないので、除外する
"C90", # mccabe
"T20", # flake8-print
"SLF", # flake8-self
"BLE", # flake8-blind-except
"FBT", # flake8-boolean-trap
"TRY", # tryceratops
"COM", # flake8-commas
"S", # flake8-bandit
"EM",#flake8-errmsg
"EXE", # flake8-executable
"ICN", # flake8-import-conventions
"RET", #flake8-return
"TCH", # flake8-type-checking
"PTH", #pathlibを使わないコードが多いので、除外する
"ISC", #flake8-implicit-str-concat
"N", # pep8-naming
"PT", # flake8-pytest-style
]
select = [
"ALL"
]
[tool.ruff.lint.per-file-ignores]
# テストコードはチェックを緩和する
"tests/**.py" = [
"PGH", # pygrep-hooks
"DTZ", # flake8-datetimez
"ANN", # flake8-annotations
"E501", # line-too-long
"RUF100", # unused-noqa
"G004", # logging-f-string
"SIM", #flake8-simplify
"PLC2401", # non-ascii-name, メソッド名に日本語を利用するため
"RUF059", # unused-unpacked-variable
]
# 以下のファイルは自動生成されるので、いくかのルールを無視する
"annofabapi/generated*.py" = [
"A002", # builtin-argument-shadowing
"ANN401", # any-type
"E501", # line-too-long
"W293", # blank-line-with-whitespace
"W291", # trailing-whitespace
]
"annofabapi/models.py" = [
"A002", # builtin-argument-shadowing
"ANN401", # any-type
"E501", # line-too-long
"W293", # blank-line-with-whitespace
"W291", # trailing-whitespace
]
# "annofabapi/pydantic_models/*.py" = ["ALL"]
"annofabapi/pydantic_models/*.py" = [
"A", # flake8-builtins
"E501", # line-too-long
# "W293", # blank-line-with-whitespace
# "W291", # trailing-whitespace
"UP007", # non-pep604-annotation-union
"UP006", # non-pep585-annotation
"UP035", # deprecated-import
"E402", # module-level-imports
"C4", # nnecessary-literal-set
"F841",
"ANN", # flake8-annotations
"PLR", # Pylint Refactor
"PERF", # Perflint
"F811", # redefined-while-unused
"FURB171", # single-item-membership-test
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-args = 10
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"