forked from Natooz/MidiTok
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
228 lines (205 loc) · 5.77 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "miditok"
version = "3.0.4"
description = "MIDI / symbolic music tokenizers for Deep Learning models."
readme = {file = "README.md", content-type = "text/markdown"}
license = {file = "LICENSE"}
requires-python = ">=3.8.0"
authors = [
{ name = "Nathan Fradet" },
]
keywords = [
"artificial intelligence",
"deep learning",
"transformer",
"midi",
"tokenization",
"music",
"mir",
]
classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Multimedia :: Sound/Audio :: MIDI",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
]
dependencies = [
"numpy>=1.19",
"symusic>=0.5.0",
"tqdm",
"tokenizers>=0.13.0",
"huggingface_hub>=0.16.4",
]
[project.optional-dependencies]
tests = [
"pytest-cov",
"pytest-xdist[psutil]",
"torch",
"tensorflow",
"miditoolkit",
]
docs = [
"furo", # theme
"sphinx-copybutton",
"torch", # for pytorch_data module
# "sphinxcontrib-tikz",
]
[project.urls]
Homepage = "https://github.com/Natooz/MidiTok"
Repository = "https://github.com/Natooz/MidiTok.git"
Documentation = "https://miditok.readthedocs.io"
Issues = "https://github.com/Natooz/MidiTok/issues"
[tool.hatch.version]
path = "miditok/__init__.py"
[tool.hatch.build.targets.sdist]
include = [
"/miditok",
]
[mypy]
warn_return_any = "True"
warn_unused_configs = "True"
plugins = "numpy.typing.mypy_plugin"
exclude = [
"venv",
".venv",
]
[tool.pytest.ini_options]
testpaths = [
"tests",
]
[tool.coverage.report]
exclude_also = [
"def __repr__",
]
omit = [
# files to omit to check
"benchmarks/*"
]
[tool.ruff]
target-version = "py312"
[tool.ruff.lint]
extend-select = [
"ARG",
"A",
"ANN",
"B",
"BLE",
"C4",
"COM",
"D",
"E",
"EM",
"EXE",
"F",
"FA",
"FBT",
"G",
"I",
"ICN",
"INP",
"INT",
"ISC",
"N",
"NPY",
"PERF",
"PGH",
"PTH",
"PIE",
# "PL",
"PT",
"Q",
"RET",
"RSE",
"RUF",
"S",
# "SLF",
"SIM",
"T",
"TCH",
"TID",
"UP",
"W",
]
# Each rule exclusion should be explained here.
# By default, we think it is better to select groups of rules (above), and exclude
# specific problematic rules, instead of selecting specific rules. By doing so, in case
# the ruff rules groups change, this requires us to check and handle the new rules or
# changes, making sure we stay up to date and keep the best practices.
# ANN003:
# Would mostly apply to args/kwargs that are passed to methods from dependencies, for
# which the signature can change depending on the version. This would either be too
# difficult to comply and/or would add a lot of noqa exceptions. ANN002 is used as it
# adds very few "noqa" exceptions, but ANN003 would add too much complexity.
# ANN101 and ANN102:
# Yields errors for `self` in methods from classes, which is unecessary.
# The existence of these rules is currently questioned, they are likely to be removed.
# https://github.com/astral-sh/ruff/issues/4396
# B905
# The `strict` keyword argument for the `zip` built-in method appeared with Python
# 3.10. As we support previous versions, we cannot comply (yet) with this rule. The
# exclusion should be removed when MidiTok drop support for Python 3.9.
# D107
# We document classes at the class level (D101). This documentation should cover the
# way classes are initialized. So we do not document `__init__` methods.
# D203
# "one-blank-line-before-class", incompatible with D211 (blank-line-before-class).
# We follow PEP 257 and other conventions by preferring D211 over D203.
# D212
# "multi-line-summary-first-line", incompatible with D213
# (multi-line-summary-second-line).
# We follow PEP 257, which recommend to set put the summary line on the second line
# after the blank line of the opening quotes.
# FBT001 and FBT002
# Refactoring all the methods to make boolean arguments keyword only would add
# complexity and could break code of users. It's ok to have booleans as positional
# arguments with default values. For code redability though, we enable FB003.
# COM812:
# Yields errors for one-line portions without comma. Trailing commas are automatically
# set with ruff format anyway. This exclusion could be removed when this behavior is
# fixed in ruff.
# UP038
# Recommends to | type union with `isinstance`, which is only supported since Python
# 3.10. The exclusion should be removed when MidiTok drop support for Python 3.9.
# (ISC001)
# May cause conflicts when used with the ruff formatter. They recommend to disable it.
# We leave it enabled but keep this in mind.
ignore = [
"ANN003",
"ANN101",
"ANN102",
"B905",
"COM812",
"D107",
"D203",
"D212",
"FBT001",
"FBT002",
"UP038",
]
[tool.ruff.lint.per-file-ignores]
# S105:
# we don't use passwords in MidiTok, only HF token for the interactions with the hub.
# However we have a lot of variables with "token"(s) in their name, which would yield a
# lot of lint errors or require a lot of noqa exceptions.
"miditok/**" = [
"S105",
]
"tests/**" = [
"ANN201", # allow no return type hint for pytest methods
"D103", # no need to document pytest methods
"S101", # allow assertions in tests
"T201", # print allowed
]
"docs/conf.py" = ["INP001"] # not a package