-
-
Notifications
You must be signed in to change notification settings - Fork 72
/
pyproject.toml
212 lines (190 loc) · 10.3 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
[project]
name = "tauon-music-box"
version = "7.9.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",
# "PySDL2",
# "requests",
# "Send2Trash",
# "unidecode",
# "dbus-python; sys_platform == 'linux'",
# "pysdl2-dll; sys_platform == 'darwin'", # Don't rely on system https://github.com/py-sdl/py-sdl2#requirements
# "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; sys_platform != 'darwin'", # macOS hates it - fails to find jxl/types.h - https://github.com/olokelo/jxlpy/issues/25#issuecomment-2547928563
# #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"
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 - ^
'D401', # non-imperative-mood - Wants docstrings in imperative language but it's really not foolproof, disable
'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 - ^
'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 - ^
'TD003', # missing-todo-link - We're fine not linking existing issues in TODOs, it's fine to have them noted in code only
]