-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathpyproject.toml
More file actions
283 lines (265 loc) · 8.32 KB
/
pyproject.toml
File metadata and controls
283 lines (265 loc) · 8.32 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
[project]
name = "birdnet"
version = "0.2.12"
description = "A Python library for identifying bird species by their sounds."
readme = "README.md"
requires-python = ">=3.11, <3.14"
license = { text = "MIT" }
authors = [{ name = "Stefan Taubert" }]
maintainers = [{ name = "Stefan Taubert" }]
keywords = [
"birds",
"deep-learning",
"birdsong",
"acoustic-monitoring",
"bioacoustics",
]
classifiers = [
"Development Status :: 4 - Beta",
"Operating System :: OS Independent",
"Operating System :: MacOS",
"Operating System :: POSIX",
"Operating System :: POSIX :: BSD",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
]
dependencies = [
"soundfile >= 0.11.0", # 2022/09/27
"scipy >= 1.8.0", # 2022/02/05
"ordered-set >= 4.1.0", # 2022/01/26
"tqdm >= 4.64.0", # 2022/04/04
"numpy >= 1.22.0", # 2021/12/31
"pandas >= 1.4.0", # 2022/02/22
"psutil >= 5.9.0", # 2021/12/29
"pyarrow >= 7.0.0", # 2022/02/03
"kagglehub >= 0.3.13", # 2025/08/26; needed for downloading PERCH models
"tensorflow >= 2.8.0 ; sys_platform != 'darwin' or platform_machine != 'x86_64'", # 2022/02/02
"tensorflow >= 2.8.0, <2.17 ; sys_platform == 'darwin' and platform_machine == 'x86_64'",
"ai-edge-litert >= 2.0.2 ; python_version < '3.13' and sys_platform == 'linux'", # 2025/09/17
]
[project.optional-dependencies]
and-cuda = [
"tensorflow[and-cuda] >= 2.8.0 ; sys_platform == 'linux'", # 2022/02/02
]
repro = [
# Reproducible results only with Python 3.12 and on CPU and not on macOS Intel
# Direct dependencies
"soundfile == 0.12.1",
"scipy == 1.16.3",
"ordered-set == 4.1.0",
"tqdm == 4.67.1",
"numpy == 2.1.0",
"pandas == 2.3.3",
"psutil == 7.1.3",
"pyarrow == 22.0.0",
"kagglehub == 0.3.13",
"tensorflow == 2.20.0 ; sys_platform == 'linux' or (sys_platform == 'darwin' and platform_machine == 'arm64') or (sys_platform == 'windows' and platform_machine == 'amd64')",
"ai-edge-litert == 2.0.3 ; python_version < '3.13' and sys_platform == 'linux'",
# Indirect dependencies
"absl-py == 2.3.1",
"astunparse == 1.6.3",
"backports.strenum == 1.2.8",
"certifi == 2025.11.12",
"cffi == 2.0.0",
"charset-normalizer == 3.4.4",
"flatbuffers == 25.9.23",
"gast == 0.6.0",
"google-pasta == 0.2.0",
"grpcio == 1.76.0",
"h5py == 3.15.1",
"idna == 3.11",
"keras == 3.12.0",
"libclang == 18.1.1",
"Markdown == 3.10",
"markdown-it-py == 4.0.0",
"MarkupSafe == 3.0.3",
"mdurl == 0.1.2",
"ml_dtypes == 0.5.4",
"namex == 0.1.0",
"opt_einsum == 3.4.0",
"optree == 0.18.0",
"packaging == 25.0",
"pillow == 12.0.0",
"protobuf == 6.33.1",
"pycparser == 2.23",
"Pygments == 2.19.2",
"python-dateutil == 2.9.0.post0",
"pytz == 2025.2",
"pyyaml == 6.0.3",
"requests == 2.32.5",
"rich == 14.2.0",
"setuptools == 80.9.0",
"six == 1.17.0",
"tensorboard == 2.20.0",
"tensorboard-data-server == 0.7.2",
"termcolor == 3.2.0",
"typing_extensions == 4.15.0",
"tzdata == 2025.2",
"urllib3 == 2.5.0",
"Werkzeug == 3.1.3",
"wheel == 0.45.1",
"wrapt == 2.0.1",
]
tests = [
"tox >= 4.32.0",
"uv >= 0.9.7",
"pytest >= 8.4.2",
"pytest-cov >= 7.0.0",
"pytest-xdist >= 3.8.0",
"pytest-timeout >= 2.4.0",
"mypy >= 1.18.2",
"ruff >= 0.14.4",
"build >= 1.3.0",
"twine >= 6.2.0",
]
dev = [
"jupyter",
"uv",
"ruff",
"mypy",
"rope",
"build",
"twine",
"scipy-stubs",
"tuna",
"pyarrow-stubs",
"pygount",
"types-tqdm",
"types-requests",
"pandas-stubs",
"types-tensorflow",
]
docs = [
"sphinx == 8.2.3",
"sphinx-autodoc-typehints == 3.5.2",
"sphinx-autobuild == 2025.8.25",
"numpydoc == 1.10.0",
"myst-parser == 4.0.1",
]
[project.urls]
Homepage = "https://github.com/birdnet-team/birdnet"
Issues = "https://github.com/birdnet-team/birdnet/issues"
Documentation = "https://birdnet-team.github.io/birdnet"
Repository = "https://github.com/birdnet-team/birdnet.git"
Changelog = "https://github.com/birdnet-team/birdnet/blob/master/CHANGELOG.md"
[project.scripts]
birdnet-benchmark = "birdnet_benchmark.cli:run_benchmark"
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
show_error_codes = true
pretty = true
packages = ["birdnet"]
[tool.setuptools.packages.find]
where = ["src"]
include = ["birdnet", "birdnet.*", "birdnet_benchmark", "birdnet_benchmark.*"]
exclude = ["birdnet_tests", "birdnet_tests.*"]
namespaces = true
[tool.pytest.ini_options]
log_cli = true
log_level = "DEBUG"
timeout = 300
addopts = ["--max-worker-restart=0"]
testpaths = ["src/birdnet_tests"]
norecursedirs = ["src/birdnet_v1_tests"]
markers = [
"load_model: tests that download all models, should be run before other tests",
"litert: tests requiring ai_edge_litert backend which can not be loaded after tf is imported (raises ImportError) which happens on parallel test runs",
"gpu: tests requiring a GPU to run and to be run sequentially",
"repro: tests requiring exact package versions to reproduce results",
]
[tool.ruff]
src = ["src/birdnet"]
line-length = 88
indent-width = 2
[tool.ruff.format]
indent-style = "space"
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # Pyflakes
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"I", # isort
"C4",
"T20",
"PERF",
"ANN",
"TID",
"EXE",
"W",
# "D",
]
[tool.ruff.lint.isort]
known-first-party = ["birdnet*"]
[tool.coverage.run]
branch = true
source = ["src/birdnet"]
parallel = true
[tool.coverage.report]
show_missing = true
exclude_lines = ["if __name__ == .__main__.:"]
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{311,312,313}, py312-repro
isolated_build = True
[testenv]
package = wheel
allowlist_externals = uv, pyproject-build
install_command = uv pip install {opts} {packages}
skip_missing_interpreters = true
deps =
.[tests,and-cuda]
commands =
# ruff check src/birdnet
# ruff check src/birdnet_tests
# mypy src/birdnet
pytest -m "not repro and load_model" -n auto
pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto
pytest -m "not repro and not load_model and litert" -n auto
pytest -m "not repro and not load_model and gpu" -n 1
# build and check package
# note `python -m build` uses the isolated build folder which results in import error:
# 'No module named build.__main__; 'build' is a package and cannot be directly executed'
pyproject-build -o dist/
python -m twine check dist/*
[testenv:py312-repro]
deps =
.[tests,repro]
commands =
pytest -m "load_model" -n auto
# run normal tests including repro tests
pytest -m "not load_model and (not litert and not gpu)" -n auto
# run litert tests including repro tests
pytest -m "not load_model and litert" -n auto
# gpu tests are not supported to be run with repro environment
pyproject-build -o dist/
python -m twine check dist/*
[testenv:py312-coverage]
deps =
.[tests]
commands =
coverage erase
pytest -m "not repro and load_model" -n auto --cov=src/birdnet --cov-append --cov-report=
pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto --cov=src/birdnet --cov-append --cov-report=
pytest -m "not repro and not load_model and litert" -n auto --cov=src/birdnet --cov-append --cov-report=
pytest -m "not repro and not load_model and gpu" -n 1 --cov=src/birdnet --cov-append --cov-report=
coverage report
"""
[build-system]
requires = [
"setuptools >= 80.9.0", # 2025/05/27
"wheel >= 0.45.1", # 2024/11/23
]
build-backend = "setuptools.build_meta"