forked from r9y9/pyopenjtalk
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpyproject.toml
52 lines (47 loc) · 2.14 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
[build-system]
requires = [
"setuptools>=64",
"cython>=3.0",
"cmake",
# ビルド時は必ず numpy 2.x 系をインストールする
# ref: https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-0-specific-advice
"numpy>=2.0; python_version>='3.9'",
"oldest-supported-numpy; python_version<'3.9'",
]
build-backend = "setuptools.build_meta"
# Below are the development commands for Unix:
[tool.taskipy.tasks]
# .venv/bin/pip uninstall -y setuptools <- magic!
install = "if [ ! -d '.venv' ]; then python -m venv .venv; fi && .venv/bin/pip uninstall -y setuptools && .venv/bin/pip install -U -e '.[dev,test,marine]' && .venv/bin/pip install 'setuptools<60' pipx"
build = ".venv/bin/pipx run build"
build-dictionary = ".venv/bin/python -c 'import pyopenjtalk; pyopenjtalk.build_mecab_dictionary()'"
clean = "rm -rf build dist pyopenjtalk_plus.egg-info pyopenjtalk/htsengine.cpp pyopenjtalk/htsengine*.so pyopenjtalk/openjtalk.cpp pyopenjtalk/openjtalk*.so"
lint = ".venv/bin/ruff check --fix ."
format = ".venv/bin/ruff format ."
test = ".venv/bin/pytest"
[tool.ruff]
# 1行の長さを最大100文字に設定
line-length = 100
# インデントの幅を4スペースに設定
indent-width = 4
# Python 3.9 を利用する
target-version = "py39"
[tool.ruff.lint]
# flake8, pycodestyle, pyupgrade, isort, Ruff 固有のルールを使う
select = ["F", "E", "W", "UP", "I", "RUF"]
ignore = [
"E501", # 1行の長さを超えている場合の警告を抑制
"E731", # Do not assign a `lambda` expression, use a `def` を抑制
"UP007", # Python 3.9 では | 演算子は使えないため Union 型を使わざるを得ない
"RUF001", # 全角記号など `ambiguous unicode character` も使いたいため
"RUF002", # 全角記号など `ambiguous unicode character` も使いたいため
"RUF003", # 全角記号など `ambiguous unicode character` も使いたいため
]
[tool.ruff.lint.isort]
# インポートブロックの後に2行空ける
lines-after-imports = 2
[tool.ruff.format]
# ダブルクオートを使う
quote-style = "double"
# インデントにはスペースを使う
indent-style = "space"