-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
144 lines (117 loc) · 4.73 KB
/
pyproject.toml
File metadata and controls
144 lines (117 loc) · 4.73 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
[tool.poetry]
name = "annoworkapi"
version = "0.0.0" # `poetry-dynamic-versioning`を使ってGitHubのバージョンタグを取得している。変更不要
description = "Python Clinet Library of Annowork WebAPI"
authors = ["Kurusugawa Computer Inc."]
license = "MIT"
keywords=["annowork", "api"]
readme="README.md"
repository="https://github.com/kurusugawa-computer/annowork-api-python-client"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Utilities",
"Operating System :: OS Independent",
]
[tool.poetry.dependencies]
python = "^3.9"
requests = "*"
backoff="*"
[tool.poetry.group.test.dependencies]
# test library
pytest = "^8"
pytest-xdist = "*"
pytest-cov = "*"
more-itertools = "*"
[tool.poetry.group.linter.dependencies]
# lint library
# pythonバージョンを指定している理由:lintは開発環境と同じPythonバージョンで実行するため。また古いPythonバージョンにサポートしていないライブラリのバージョンがあるため
ruff = {version=">=0.8,<0.12", python = ">=3.11"}
mypy = {version="^1", python = ">=3.11"}
pylint = {version="^3", python = ">=3.11"}
# type stub package
types-requests = "*"
[tool.poetry.group.documentation.dependencies]
sphinx = {version="^8", python = ">=3.11"}
pydata-sphinx-theme = {version="^0.15", python = ">=3.11"}
[tool.poetry.group.dev]
# 開発するときのみ必要なライブラリ。インストールしなくても開発はできるので、オプショナルにする
optional = true
[tool.poetry.group.dev.dependencies]
ipython = "*"
[tool.mypy]
ignore_missing_imports = true
check_untyped_defs = true
[tool.ruff]
target-version = "py39"
line-length = 150
[tool.ruff.lint]
ignore = [
"G004", # `logging-f-string` : loggingでf-stringを使いたいので無視する
"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", # : 役立つこともあるが、コメントアウトしていないコードも警告されるので無視する
"PERF203", # try-except-in-loop: ループ内でtry-exceptを使うこともあるため無視する。またPython3.11以降は無視できる
"FIX", # TODOやFIXMEを使うため無視する
"TD", # TODOコメントの書き方に気にしていないので無視する
# いずれ無視しないようにする
"ANN201", # missing-return-type-public-function:
"ANN202", # missing-return-type-private-function:
"PLR", # pylint Refactor
# 以下のルールはannofabcliのコードに合っていないので無効化した
"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
"SIM",#flake8-simplify
"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, メソッド名に日本語を利用するため
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pyupgrade]
# 以下のエラーが発生しないようにする。
# FA100 Add `from __future__ import annotations` to simplify `typing.Optional`
# https://beta.ruff.rs/docs/settings/#keep-runtime-typing
# Python 3.9をサポートしなくなったら、この設定は不要になる
keep-runtime-typing = true
[tool.ruff.lint.pylint]
max-args = 10
[tool.poetry-dynamic-versioning]
enable = true
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"