-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
233 lines (201 loc) · 6.97 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
229
230
231
232
233
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "musicbrainz2notion"
dynamic = ["version", "authors", "urls"]
description = "A tool to sync artist and music data from MusicBrainz to Notion"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.12"
keywords = ["python", "notion", "musicbrainz", "api", "music", "database"]
classifiers = [ # https://pypi.org/classifiers/
"Development Status :: 2 - Pre-Alpha",
"Environment :: Console",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = [
"bs4>=0.0.2",
"cyclopts>=2.9.9",
"frosch<=0.1.5", # 0.1.6
"loguru>=0.7.2",
"musicbrainzngs>=0.7.1",
"notion-client>=2.2.1",
"pandas>=2.2.3",
"python-dateutil>=2.9.0.post0",
"python-dotenv>=1.0.1",
"rich>=13.9.3",
"toolz>=1.0.0",
"tqdm>=4.66.6",
"typed-settings[attrs,cattrs]>=24.5.0",
"yarl>=1.17",
"zstandard>=0.23.0",
]
[tool.uv]
default-groups = ["dev", "lint", "type-check"]
[dependency-groups]
dev = [
"hatchling>=1.25.0",
"icecream>=2.1.3",
"ipdb>=0.13.13",
"ipykernel>=6.29.5",
"jupyter>=1.1.1",
"matplotlib>=3.9.2",
"pandas-stubs>=2.2.3.241009",
"pyinstaller>=6.11.0",
]
lint = ["ruff>=0.7.1"]
type-check = ["basedpyright>=1.19.1"]
# override-dependencies = ["yapf>=0.40", "frosch<=0.1.6"]
[tool.hatch.metadata.hooks.custom] # Enables custom hooks for dyamic metadata
[tool.hatch.version]
path = "src/musicbrainz2notion/__about__.py"
[tool.hatch.build.targets.wheel]
packages = ["src/musicbrainz2notion"]
# === Type Checking === #
[tool.basedpyright] # https://github.com/microsoft/pyright/blob/main/docs/configuration.md or https://docs.basedpyright.com/v1.19.1/configuration/config-files/
typeCheckingMode = "recommended" # standard recommended
pythonVersion = "3.13"
pythonPlatform = "All"
strictListInference = true
strictDictionaryInference = true
strictSetInference = true
analyzeUnannotatedFunctions = true
strictParameterNoneValue = true
deprecateTypingAliases = true
# enableTypeIgnoreComments = false
# enableReachabilityAnalysis = true
# === Type Check Rule Overrides === #
reportImplicitStringConcatenation = false # Ruff handles this
# TODO: Comment out for production
reportUnusedCallResult = "none"
reportUnknownMemberType = "none"
reportUnknownVariableType = "none"
reportUnknownArgumentType = "none"
reportAny = "none"
# === Lint + Formatting === #
[tool.ruff] # https://docs.astral.sh/ruff/settings
target-version = "py313"
line-length = 100
src = ["src"]
# In addition to the standard set, include `.ipynb` files.
extend-include = ["*.ipynb"]
exclude = []
[tool.ruff.lint]
preview = true
fixable = ["ALL"]
select = [
"RUF", # Ruff specific rules
"PL", # Pylint
"B", # Bugbear
"D", # Docstring
"D213", # Multi-line docstring summary should start at the second line
"D401", # First line should be in imperative mood
"D404", # First line should not start with this
"I", # Isort
"C90", # Mccabe complexity
"UP", # PyUpgrade
"ANN", # Type annotations
"S", # Bandit
"A", # flake8-builtins
"C4", # flake8-comprehensions
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"LOG", # flake8-logging
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"RET", # flake8-return
"SLF", # flake8-self
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"TD", # flake8-todos
"ERA", # flake8-eradicate
"TRY", # tryceratops
"NPY", # numpy specefic rules
"PERF", # Perflint
"FURB", # refurb
# "WPS", # wemake-python-styleguide -> Not yet supported
]
ignore = [
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"D212", # Multi-line docstring summary should start at the first line
"TD002", # Missing author in TODO; try: `TODO(<author_name>): ...` or `TODO @<author_name>: ...`
"TD003", # Missing issue link on the line following this TODO
"TD004", # Missing colon after TODO
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in
"RET504", # Unnecessary assignment to `...` before `return` statement
# TODO: Comment out for produciton release
"ERA001", # Found commented-out code
"S101", # Use of `assert` detected
"G004", # Logging statement uses f-string
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"SLF001", # Private member accessed: `self._foo`
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"ANN",
]
"*.ipynb" = [
"D101", # Missing docstring in public class
]
"dev/_*" = [
"D103", # Missing docstring in public function
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-args = 6
[tool.ruff.format]
preview = true
docstring-code-format = true
# == Pytest == #
[tool.pytest] # https://docs.pytest.org/en/stable/customize.html
[tool.pytest.ini_options]
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]
# testpaths = ["tests"]
pythonpath = ["src"]
# == Coverage == #
[tool.coverage]
[tool.coverage.run]
source_pkgs = ["musicbrainz2notion", "tests"]
branch = true
parallel = true
omit = ["src/musicbrainz2notion/__about__.py"]
[tool.coverage.paths]
PackageName = [
"src/musicbrainz2notion",
"*/musicbrainz2notion/src/musicbrainz2notion",
]
tests = ["tests", "*/musicbrainz2notion/tests"]
[tool.coverage.report]
exclude_also = [
"def __repr__",
"def __str__",
"if TYPE_CHECKING:",
# "if __name__ == '__main__':",
# Don't complain about missing debug-only code:
# "if self\\.debug",
# "if settings.DEBUG",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]