forked from Taiko2k/Tauon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
251 lines (229 loc) · 13.3 KB
/
pyproject.toml
File metadata and controls
251 lines (229 loc) · 13.3 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
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
[project]
name = "tauon-music-box"
# Should also be bumped in:
# * __main__.py
# * extra/com.github.taiko2k.tauonmb.appdata.xml for Flatpak
version = "8.2.0"
description = "Tauon Music Box is a music player"
readme = "README.md"
license = { text = "GPL-3.0-or-later" }
# Change the version for the tools below too when bumping up
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"Typing :: Typed",
]
dynamic = ["dependencies"]
# dependencies = [
# "beautifulsoup4",
# "musicbrainzngs",
# "mutagen",
# "PlexAPI", # OPTDEP
# "PyGObject",
# "pylast>=3.1.0",
# "PySDL3",
# "requests",
# "Send2Trash",
# "unidecode",
# "dbus-python; sys_platform == 'linux'",
# "comtypes; sys_platform == 'win32'",
# "lynxtray; sys_platform == 'win32'",
# "keyboard; sys_platform == 'win32'",
# "Pillow; sys_platform != 'win32'",
# "opencc; sys_platform != 'win32'", # OPTDEP
# "opencc-python-reimplemented; sys_platform == 'win32'", # OPTDEP
# "pyinstaller; sys_platform != 'linux'", # for macOS at least
# "pypresence", # optdep
# "tekore", # optdep,
# "natsort", # optdep
# "jxlpy", # optdep
# #librespot - https://github.com/kokarare1212/librespot-python/pull/286
# #picard - picard 2.12.3 requires charset-normalizer~=3.3.2, but you have charset-normalizer 3.4.0 which is incompatible.
# "PyChromecast", # OPTDEP
# "setproctitle", # OPTDEP
# "tidalapi", # OPTDEP
# "colored_traceback", # very opt
# ]
#[project.optional-dependencies]
# dev = [
# "pygobject-stubs", # needs PYGOBJECT_STUB_CONFIG=Gtk3,Gdk3 env var when being installed
# ]
# all = [
# "opencc; sys_platform != 'win32'", # OPTDEP
# ]
[project.gui-scripts]
tauonmb = "tauon.__main__:main"
[project.entry-points."distutils.commands"]
compile_translations = "compile_translations:main"
#hard_fix = "hard_fix:main"
## Note that if above goes to main, it should get done before phazor compiler.
[project.urls]
homepage = "https://tauonmusicbox.rocks/"
[build-system]
requires = ["setuptools>=75.3", "setuptools_scm"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
# https://setuptools.pypa.io/en/latest/userguide/ext_modules.html
# This is terribly formatted as in TOML 1.0 it all has to be inline, can only be changed when TOML 1.1 ships
# Windows (MSVC) - does not work as PyGobject, GTK, Cairo and et al won't build under MVSC
# One option would be to test https://github.com/wingtk/gvsbuild + https://stackoverflow.com/a/72737752
# ./vcpkg.exe install libsndfile:x64-windows # TODO download the necessities instead of this bundle, libflac at minimum
# ./vcpkg.exe install mpg123:x64-windows
# ./vcpkg.exe install libsamplerate:x64-windows
# ./vcpkg.exe install libopenmpt:x64-windows
# ./vcpkg.exe install wavpack:x64-windows
# ./vcpkg.exe install libgme:x64-windows
# ./vcpkg.exe install pthreads:x64-windows
# wavpack.lib is trying to be found but it is wavpackdll.lib
# opusfile includes opus libraries without opus/ wtf copy them over
# ext-modules = [
# {name = "phazor", sources = ["src/phazor/kissfft/kiss_fftr.c", "src/phazor/kissfft/kiss_fft.c", "src/phazor/phazor.c"], include-dirs = ["src/phazor/miniaudio", "C:/Users/Yeet/Tauon/src/phazor/miniaudio", "C:/Users/Yeet/Tauon/vcpkg/installed/x64-windows/include", "C:/Users/Yeet/Tauon/src/phazor/kissfft", "C:/Users/Yeet/Tauon/src/phazor/miniaudio"], libraries=["samplerate", "wavpackdll", "opusfile", "ogg", "opus", "vorbisfile", "mpg123", "FLAC", "openmpt", "pthreadVC3", "gme"], library-dirs = ["vcpkg/installed/x64-windows/lib"] },]
# Linux + macOS + Windows (MINGW64)
ext-modules = [
{name = "phazor", sources = ["src/phazor/kissfft/kiss_fftr.c", "src/phazor/kissfft/kiss_fft.c", "src/phazor/phazor.c"], include-dirs = ["/usr/include/opus", "/opt/homebrew/include/opus", "/opt/homebrew/include", "C:/msys64/mingw64/include/opus"], libraries = ["samplerate", "wavpack", "opusfile", "vorbisfile", "mpg123", "FLAC", "openmpt", "gme"], library-dirs = ["/opt/homebrew/lib"] },
# Set as optional to allow soft-failure, it's expected not to build on Windows/macOS, but we don't want to fail the entire build on it
# I have not found a better way to solve this, ideally we would somehow tag this as Linux-exclusive
{name = "phazor-pw", sources = ["src/phazor/kissfft/kiss_fftr.c", "src/phazor/kissfft/kiss_fft.c", "src/phazor/phazor.c"], include-dirs = ["/usr/include/opus"], libraries = ["samplerate", "wavpack", "opusfile", "vorbisfile", "mpg123", "FLAC", "openmpt", "gme", "pipewire-0.3"], optional = true },
]
package-dir = {"" = "src"}
# Should we care about these options or is it fine to omit them here?
# -shared -o libphazor.so -fPIC -Wall -O3 -g #-Wextra
# -shared -o libphazor-pipe.so -fPIC -Wall -O3 -g -DPIPE #-Wextra
packages = [
"tauon",
"tauon.t_modules"
]
[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}
[tool.setuptools.package-data]
"tauon" = ["assets/*", "assets/svg/*", "locale/*/*/*.mo", "templates/*", "theme/*"]
# https://github.com/microsoft/pyright/blob/main/docs/configuration.md#pyright-configuration
[tool.pyright]
#defineConstant = { DEBUG = true }
pythonVersion = "3.10"
# Pyright does not support this, needs to be defined via `__builtins__.pyi`, see https://github.com/microsoft/pyright/issues/9471
# Translations
#builtins = ["_"]
# Defaults: https://github.com/microsoft/pyright/blob/main/docs/configuration.md#diagnostic-settings-defaults
#enableExperimentalFeatures = false
strictListInference = true
strictDictionaryInference = true
strictSetInference = true
deprecateTypingAliases = true
reportMissingTypeStubs = "error"
reportConstantRedefinition = "error"
reportDeprecated = "error"
reportDuplicateImport = "error"
reportIncompleteStub = "error"
reportInconsistentConstructor = "error"
reportInvalidStubStatement = "error"
reportMatchNotExhaustive = "error"
reportMissingParameterType = "error"
reportMissingTypeArgument = "warning"
reportPrivateUsage = "error"
reportTypeCommentUsage = "error"
reportUnknownArgumentType = "warning"
reportUnknownLambdaType = "error"
reportUnknownMemberType = "warning"
reportUnknownParameterType = "warning"
reportUnknownVariableType = "warning"
reportUnnecessaryCast = "error"
reportUnnecessaryComparison = "error"
reportUnnecessaryContains = "error"
reportUnnecessaryIsInstance = "error"
reportUninitializedInstanceVariable = "warning"
reportUnnecessaryTypeIgnoreComment = "warning"
# reportUnusedCallResult = "warning"
reportUnusedClass = "error"
reportUnusedImport = "error"
reportUnusedFunction = "error"
reportUnusedVariable = "warning"
reportUntypedBaseClass = "error"
reportUntypedClassDecorator = "error"
reportUntypedFunctionDecorator = "error"
reportUntypedNamedTuple = "error"
reportCallInDefaultInitializer = "warning"
reportImplicitOverride = "warning"
reportImplicitStringConcatenation = "warning"
reportImportCycles = "warning"
# reportMissingSuperCall = "warning" # Leave this one disabled by default, it's more useful for Python 2 compat
reportPropertyTypeMismatch = "warning"
reportShadowedImports = "warning"
# https://docs.astral.sh/ruff/configuration/
[tool.ruff]
# Target non-EOL releases at minimum - https://devguide.python.org/versions/
target-version = "py310"
# Soft 80 and hard break at 120
line-length = 120
# Translations
builtins = ["_"]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "double"
docstring-quotes = "double"
[tool.ruff.format]
quote-style = "double"
indent-style = "tab"
# https://docs.astral.sh/ruff/rules/
[tool.ruff.lint]
select = ['ALL']
ignore = [
'Q003', # avoidable-escaped-quote - It's not that important, we just use escapes, keeping the quotes consistent
'W191', # tab-indentation - We use tabs for indents, disabling this PEP 8 recommendation
'D206', # indent-with-spaces - ^
'D100', # undocumented-public-module - TODO(Martin): We currently don't even have typing fully implemented, let's maybe care about undocumented functions/classes later
'D101', # undocumented-public-class - ^
'D102', # public-method - ^
'D103', # undocumented-public-function - ^
'D104', # undocumented-public-package - ^
#'D105', # undocumented-magic-method - ^ < This one is a bit more severe though
'D106', # undocumented-public-nested-class - ^
'D107', # undocumented-public-init - ^
'D400', # ends-in-period - We do not care if docstrings end with a period
'D415', # ends-in-punctuation - ^
'D203', # incorrect-blank-line-before-class - Clashes with D211
#'D211', # no-blank-line-before-class - Clashes with D203
#'D212', # multi-line-summary-first-line - Clashes with D213
'D213', # multi-line-summary-second-line - Clashes with D212
'D401', # non-imperative-mood - Wants docstrings in imperative language but it's really not foolproof, disable
'E501', # line-too-long - TODO(Martin) - We want this enabled, but only after the rest of issues is gone
'EM101', # raw-string-in-exception - We do not care about .format in exceptions, readability is not *our* problem, traceback should be colorized to avoid this instead
'EM102', # f-string-in-exception - ^
'EM103', # dot-format-in-exception - ^
'S311', # suspicious-non-cryptographic-random-usage - We aren't using random for anything important
'ERA001', # commented-out-code - Tests for commented out code, but it has way too many false positives, so disable
'FBT001', # boolean-type-hint-positional-argument - Allow positional booleans in functions, it's not really that much of an issue
'FBT002', # boolean-default-value-positional-argument - ^
'FBT003', # boolean-positional-value-in-call - ^
'G004', # logging-f-string - Ignore this, we lose some efficiency but I suppose nobody wants to do a total overhaul of the logging system for next to no gains
'LOG015', # root-logger-call - We are not a library and have customized the logger
'TD003', # missing-todo-link - We're fine not linking existing issues in TODOs, it's fine to have them noted in code only
'C901', # complex-structure - We'll ignore functions being too complex for now
'PLR0911', # too-many-return-statements - We'll ignore functions having too many return statements
'PLR0912', # too-many-branches - We'll ignore functions having too many branches for now
'PLR0913', # too-many-arguments - We'll ignore functions taking too many arguments
'PLR0915', # too-many-statements - We'll ignore functions having too many statements
# TODO(Martin): We mostly want these, but currently there's so many issues it's making the check useless
# Throw these out one by one when the time allows and fix the issues
'A001', # builtin-variable-shadowing - TODO fix
'S101', # assert - TODO fix
'S603', # subprocess-without-shell-equals-true - TODO fix
'S607', # start-process-with-partial-path - TODO fix
'PLR2004', # magic-value-comparison - TODO fix
'FIX002', # line-contains-todo - TODO fix
'PTH103', # os-makedirs - TODO fix
'PTH107', # os-remove - TODO fix
'PTH110', # os-path-exists - TODO fix
'PTH111', # os-path-expanduser - TODO fix
'PTH112', # os-path-isdir - TODO fix
'PTH113', # os-path-isfile - TODO fix
'PTH114', # os-path-islink - TODO fix
'PTH115', # os-readlink - TODO fix
'PTH118', # os-path-join - TODO fix
'PTH119', # os-path-basename - TODO fix
'PTH120', # os-path-dirname - TODO fix
'PTH122', # os-path-splittext - TODO fix
'PTH123', # builtin-open - TODO fix
'PTH202', # os-path-getsize - TODO fix
'PTH208', # os-listdir - TODO fix
'PLW2901', # os-path-getsize - TODO fix
]