-
Notifications
You must be signed in to change notification settings - Fork 181
/
pyproject.toml
185 lines (168 loc) · 4.47 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
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
[tool.poetry]
name = "hazm"
version = "0.10.0"
description = "Persian NLP Toolkit"
authors = ["Roshan <[email protected]>"]
maintainers = ["Roshan <[email protected]>"]
license = "MIT"
readme = "README.md"
include = ["data/*"]
classifiers = [
"Intended Audience :: Developers",
"Topic :: Text Processing",
"Natural Language :: Persian",
]
homepage = "https://roshan-ai.ir/hazm/"
repository = "https://github.com/roshan-research/hazm/"
documentation = "https://roshan-ai.ir/hazm/docs/"
keywords = ["nlp", "persian nlp", "persian"]
[tool.poetry.urls]
"Demo" = "https://www.roshan-ai.ir/hazm/demo/"
"Changelog" = "https://github.com/roshan-research/hazm/releases/latest"
"Contribution" = "https://github.com/roshan-research/hazm/blob/master/CONTRIBUTION.md"
"Issues" = "https://github.com/roshan-research/hazm/issues"
"Join-us" = "https://www.roshan-ai.ir/join-us/"
[tool.poetry.dependencies]
python= ">=3.8, <3.12"
nltk="^3.8.1"
gensim="^4.3.1"
python-crfsuite="^0.9.9"
numpy = "~1.24"
scikit-learn = "^1.2.2"
fasttext-wheel = "^0.9.2"
flashtext = "^2.7"
[tool.poetry.group.docs.dependencies]
mkdocs="^1.4.3"
mkdocs-material="^9.1.11"
pymdown-extensions="^9.11"
mkdocs-glightbox="^0.3.4"
mkdocstrings = "^0.21.2"
mkdocstrings-python = "^1.0.0"
toml = "^0.10.2"
mkdocs-macros-plugin = "^1.0.4"
[tool.poetry.group.docs]
optional=true
[tool.poetry.group.dev.dependencies]
pandas= "^2.0.1"
pytest = "^7.3.1"
pytest-xdist = {extras = ["psutil"], version = "^3.3.1"}
poethepoet = "^0.20.0"
ruff = "^0.0.269"
pytest-cov = "^4.1.0"
pytest-sugar = "^0.9.7"
pytest-randomly = "^3.12.0"
pyinstrument = "^4.6.2"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
target-version = "py38"
#line-length = 120
extend-select = [
"F",
"E",
"W",
"C90",
"I",
"N",
"D",
"UP",
"YTT",
"ANN",
# "S",
# "BLE",
#"FBT",
"B",
"A",
"COM",
"C4",
"DTZ",
"EM",
"EXE",
"ISC",
"ICN",
"G",
"INP",
"PIE",
#"T20",
"PYI",
"PT",
"Q",
"RSE",
"RET",
"SLF",
"SIM",
"TID",
"TCH",
"INT",
"ARG",
"PTH",
"ERA",
"PD",
"PGH",
"PL",
"PLC",
"PLE",
"PLR",
"PLW",
"TRY",
"NPY",
"RUF",
]
ignore=[
"RUF001", # String contains ambiguous unicode character
"RUF002", # Docstring contains ambiguous unicode character
"RUF003", # Comment contains ambiguous unicode character
"D205", # 1 blank line required between summary line and description in docstring
"E501", # Line too long
"F401", # imported but unused; consider adding to `__all__` or using a redundant alias
"TID252", # Relative imports from parent modules are banned
"PLR0913", # Too many arguments to function call
"ANN001", # Missing type annotation for function argument
"ANN201", # Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"PLR0912", # Too many branches
"PLR0915", # Too many statements
"PLR0911", # Too many return statements
"C901", # Too complex
"PLR2004", # Magic value used in comparison, consider replacing 4 with a constant variable
"E722", # Do not use bare `except`
"PLW2901", # `for` loop variable `{variable name}` overwritten by assignment target
"TRY002", # Create your own exception
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in __init__
]
fix=true
ignore-init-module-imports = true
namespace-packages = ["hazm"]
show-fixes = true
[tool.ruff.per-file-ignores]
"data.py"=["ALL"] # temporary
"sample.py"=["ALL"] # always
"mkdocs_macros.py"=["ALL"] # always
"wiki_extractor.py"=["ALL"] # temporary
[tool.ruff.isort]
force-single-line = true
[tool.ruff.pydocstyle]
convention = "google"
[tool.black]
target-version = ['py38']
preview = true
filterwarnings = "ignore::DeprecationWarning"
disable_test_id_escaping_and_forfeit_all_rights_to_community_support = true
[tool.poe.tasks]
# poetry run poe test
# poetry run poe test hazm/normalizer.py
test = "pytest -n auto ${path}"
# poetry run poe lint
# poetry run poe lint -t hazm/normalizer.py
# poetry run poe lint -- --no-fix
[tool.poe.tasks.lint]
cmd = "ruff check ${target_dir}"
args = { target_dir = { options = ["--target", "-t"], default = "." }}