-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
192 lines (172 loc) · 5.97 KB
/
Copy pathpyproject.toml
File metadata and controls
192 lines (172 loc) · 5.97 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
[project]
name = "rhoknp"
version = "1.8.0"
description = "Yet another Python binding for Juman++/KNP/KWJA"
license = "MIT"
authors = [
{ name = "Hirokazu Kiyomaru", email = "h.kiyomaru@gmail.com"},
{ name = "Nobuhiro Ueda", email = "ueda@nlp.i.kyoto-u.ac.jp"},
]
maintainers = [
{ name = "Hirokazu Kiyomaru", email = "h.kiyomaru@gmail.com"},
{ name = "Nobuhiro Ueda", email = "ueda@nlp.i.kyoto-u.ac.jp"},
]
readme = "README.md"
keywords = ["NLP", "Japanese", "Juman++", "KNP", "KWJA"]
classifiers = [
"License :: OSI Approved :: MIT License",
"Natural Language :: Japanese",
"Operating System :: MacOS",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"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",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing",
"Topic :: Text Processing :: Linguistic",
]
requires-python = ">=3.10"
dependencies = [
"typing-extensions>=4.4; python_version < '3.12'"
]
[project.optional-dependencies]
cli = [
"typer-slim>=0.18.0",
"PyYAML>=6.0",
"rich>=12.6",
"uvicorn>=0.30.0",
"fastapi>=0.111.0",
"jinja2>=3.1.4",
"pygments>=2.18.0",
]
[project.urls]
Homepage = "https://github.com/ku-nlp/rhoknp"
Documentation = "https://rhoknp.readthedocs.io/en/latest"
Repository = "https://github.com/ku-nlp/rhoknp"
Issues = "https://github.com/ku-nlp/rhoknp/issues"
[project.scripts]
rhoknp = "rhoknp.cli.cli:app"
[dependency-groups]
dev = [
"ipdb>=0.13.13",
]
test = [
"pytest>=8.0",
"coverage[toml]>=7.3",
"pytest-cov>=6.0",
"httpx>=0.25",
]
docs = [
"Sphinx>=8.0",
"sphinx-prompt>=1.9",
"sphinx-copybutton>=0.5.0",
"myst-parser>=4.0",
"markdown-it-py>=3.0",
"furo>=2024.4",
"typing-extensions>=4.4",
]
[build-system]
requires = ["uv_build"]
build-backend = "uv_build"
[tool.hatch.build.targets.sdist]
only-include = ["/src/rhoknp"]
[tool.uv]
package = true
default-groups = ["dev", "test"]
[tool.ruff]
line-length = 120
indent-width = 4
src = ["src"]
target-version = "py310" # The minimum Python version to target
[tool.ruff.lint]
select = ["F", "E", "W", "I", "B", "PL", "PD", "NPY", "RUF", "UP", "TID", "COM", "PT", "D", "ARG", "PYI", "ANN", "G", "FBT", "EM", "TRY", "PTH", "T", "INP", "C"]
#select = ["ALL"]
ignore = [
"E501", # Line too long
"RUF001", # String contains ambiguous `ノ` (KATAKANA LETTER NO). Did you mean `/` (SOLIDUS)?
"RUF002", # Docstring contains ambiguous `,` (FULLWIDTH COMMA). Did you mean `,` (COMMA)?
"RUF003", # Comment contains ambiguous `(` (FULLWIDTH LEFT PARENTHESIS). Did you mean `(` (LEFT PARENTHESIS)?
"UP037", # Remove quotes from type annotation
"COM812", # Trailing comma missing
"PLR2004", # Magic value used in comparison
"D100", # Missing docstring in public module
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"D301", # Use `r"""` if any backslashes in a docstring
"D403", # First word of the first line should be properly capitalized
"D415", # First line should end with a period, question mark, or exclamation point
"ANN002", # Missing type annotation for `*args`
"ANN003", # Missing type annotation for `**kwargs`
"FA100", # Missing `from __future__ import annotations`, but uses `...`
"S101", # Use of `assert` detected
"G004", # Logging statement uses f-string
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"FBT003", # Boolean positional value in function call
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"TRY003", # Avoid specifying long messages outside the exception class
"C408", # Unnecessary `dict()` call (rewrite as a literal)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"D104", # Missing docstring in public package
]
"tests/*" = [
"D", # pydocstyle
"S101", # Use of `assert` detected
"INP001", # File `...` is part of an implicit namespace package. Add an `__init__.py`
"PLR0915", # Too many statements
]
"src/rhoknp/cli/*" = [
"T201", # `print` found
]
"examples/*" = [
"T201", # `print` found
"INP001", # File `...` is part of an implicit namespace package. Add an `__init__.py`
"PTH123", # `open()` should be replaced by `Path.open()`
]
"docs/conf.py" = [
"INP001", # File `...` is part of an implicit namespace package. Add an `__init__.py`
]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["typer.Argument"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-branches = 25
max-statements = 60
max-returns = 10
max-args = 15
[tool.ruff.lint.mccabe]
max-complexity = 20 # default: 10
[tool.mypy]
python_version = "3.10"
[tool.ty.environment]
python-version = "3.10"
[tool.coverage.run]
omit = ["tests/*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__", # Do not complain about missing debug-only code
"except ImportError", # Do not complain about packages we have installed
# Do not complain if tests do not hit defensive assertion code
"raise AssertionError",
"raise NotImplementedError",
"raise ImportError",
# Do not complain if non-runnable code is not run
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"@(abc\\.)?abstractmethod", # Do not complain about abstract methods
"@overload", # Do not complain about overloads
]