-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
188 lines (159 loc) · 6.02 KB
/
pyproject.toml
File metadata and controls
188 lines (159 loc) · 6.02 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
[project]
name = "annofabcli"
dynamic = ["version"]
description = "Utility Command Line Interface for AnnoFab"
authors = [{ name = "Kurusugawa Computer Inc." }]
license = { text = "MIT" }
keywords = ["annofab", "cli"]
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Environment :: Console",
"Topic :: Utilities",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"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",
"pyyaml",
"dictdiffer",
"more-itertools",
"pyquery",
"isodate",
"annofabapi>=1.5.3",
"python-datauri",
"numpy",
"pandas>=2",
"bokeh>=3.8",
"Pillow",
"shapely",
"ulid-py>=1.1.0",
"annofabapi-3dpc-extensions",
# Python 3.14サポートのためpydantic 2.12以上が必要
"pydantic>=2.12; python_version>='3.14'",
]
[project.urls]
Homepage = "https://github.com/kurusugawa-computer/annofab-cli"
Repository = "https://github.com/kurusugawa-computer/annofab-cli"
"Bug Tracker" = "https://github.com/kurusugawa-computer/annofab-cli/issues"
[dependency-groups]
dev = [
"ipython",
# pandas3以上はPython3.12以上で動かす。pandas 3.0特有の問題に気づけるようにするため
"pandas>=3; python_version>='3.12'",
# numpy2.1以上はPython3.12以上
"numpy>=2.1; python_version>='3.12'",
]
test = [
"pytest>=9",
"pytest-xdist",
]
linter = [
"ruff>=0.15; python_version>='3.12'",
"mypy>=1; python_version>='3.12'",
"types-requests; python_version>='3.12'",
"types-python-dateutil; python_version>='3.12'",
"types-PyYAML; python_version>='3.12'",
]
docs = [
"sphinx>=9.1; python_version>='3.12'",
"pydata-sphinx-theme>=0.13; python_version>='3.12'",
"sphinx-last-updated-by-git; python_version>='3.12'",
"sphinx-argparse; python_version>='3.12'",
]
[tool.uv]
default-groups = ["dev", "test", "linter", "docs"]
package = true
[project.scripts]
annofabcli = "annofabcli.__main__:main"
[tool.mypy]
disallow_incomplete_defs = true
disallow_untyped_calls = true
strict_equality = true
strict_bytes = true
ignore_missing_imports = true
check_untyped_defs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
show_column_numbers = true
warn_unused_configs = true
[tool.ruff]
target-version = "py310"
line-length = 200
[tool.ruff.lint]
ignore = [
"A005", # stdlib-module-shadowing: 標準ライブラリと同じ名前のモジュールはあるが、基本的には混乱しないはずなので無視する。
"G004", # `logging-f-string` : loggingでf-stringを使いたいので無視する
"PD002", #すでにpandasで`inplace=True`はいろんなところで使っているため
"RUF001", # 全角記号など`ambiguous unicode character`も使いたいため
"RUF002",# 全角記号など`ambiguous unicode character`も使いたいため
"RUF003",# 全角記号など`ambiguous unicode character`も使いたいため
"PLR2004", # magic-value-comparison: listのサイズで判定するときがよくあるため
"ISC001", # single-line-implicit-string-concatenation: formatterと競合するので無視する https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"ERA", # : 役立つこともあるが、コメントアウトしていないコードも警告されるので無視する
"PERF203", # try-except-in-loop: ループ内でtry-exceptを使うこともあるため無視する。
"COM812", # missing-trailing-comma: 末尾のカンマを考慮しないため無視する
"TRY003", # raise-vanilla-args: `ValueError`にf-stringで長いメッセージを渡すことが多いので無視する
"FIX", # TODOやFIXMEを使うため無視する
"TD", # TODOコメントの書き方に気にしていないので無視する
"SIM108", # if-else-block-instead-of-if-exp : if-elseブロックを使うこともあるため無視する
# 以下のルールはannofabcliのコードに合っていないので無効化した
"RSE", # flake8-raise
"D", # pydocstyle, Docstringを中途半端にしか書いていないので、除外する
"C90", # mccabe
"BLE", # flake8-blind-except
"S", # flake8-bandit
"EM",#flake8-errmsg
"EXE", # flake8-executable
"ICN", # flake8-import-conventions
"RET",#flake8-return
"TCH", # flake8-type-checking
"PT", # flake8-pytest-style
]
# preview段階のルールを個別に指定できるようにするための設定
preview = true
explicit-preview-rules = true
select = [
"ALL",
# 以降のルールはpreview版のルールのみを指定する
"FURB132", # check-and-remove-from-set
"FURB142", # for-loop-set-mutations
"FURB113", # repeated-append
"B909", # loop-iterator-mutation
"PLW1514", # unspecified-encoding: Windows環境で実行する際にencoding="utf-8"を指定しないとエラーになるため、チェックする
]
[tool.ruff.lint.per-file-ignores]
# テストコードはチェックを緩和する
"tests/**.py" = [
"PGH", # pygrep-hooks
"DTZ", # flake8-datetimez
"ANN", # flake8-annotations
"E501", # line-too-long
"RUF100", # unused-noqa
"SIM", # flake8-simplify
"N", # pep8-naming
"PTH", # flake8-use-pathlib
"SLF", # flake8-self
"PLC2401", # non-ascii-name: メソッド名に日本語を使うため
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pyupgrade]
# `typing.Optional`を使っているため、UP007のルールを無視する
# https://beta.ruff.rs/docs/settings/#keep-runtime-typing
keep-runtime-typing = true
[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"