-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
252 lines (231 loc) · 6.79 KB
/
pyproject.toml
File metadata and controls
252 lines (231 loc) · 6.79 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "bats-ai"
version = "0.0.0"
requires-python = ">=3.13"
license = "Apache-2.0"
license-files = ["LICENSE", "NOTICE"]
classifiers = ["Private :: Do Not Upload"]
dependencies = [
# Runtime dependendencies, always needed
"celery==5.6.3",
"django[argon2]==6.0.4",
"django-ninja==1.6.2",
"django-allauth==65.16.1",
"django-auth-style==0.15.0",
"django-cors-headers==4.9.0",
"django-environ==0.13.0",
"django-extensions==4.1",
"django-oauth-toolkit==3.2.0",
"django-resonant-settings[allauth,celery]==0.48.1",
"django-resonant-utils[allauth,s3_storage]==0.19.0",
"django-s3-file-field[s3]==1.1.0",
"django-storages[s3]==1.14.6",
"django-stubs-ext==6.0.3",
"psycopg[binary]==3.3.3",
"pydantic==2.13.2",
"requests==2.33.1",
"rich==14.3.4",
"whitenoise[brotli]==6.12.0",
"tqdm==4.67.3",
# guano metadata
"gdal==3.12.3.1",
"geopandas==1.1.3",
"guano==1.0.16",
"django-celery-results==2.6.0",
# Production-only
"sentry-sdk[celery,django,pure_eval]==2.58.0",
"gunicorn==25.3.0",
]
[project.optional-dependencies]
development = [
"django-browser-reload==1.21.0",
"django-click==2.5.0",
"django-debug-toolbar==6.3.0",
"django-minio-storage==0.5.9",
"django-resonant-utils[minio_storage]==0.19.0",
"django-s3-file-field[minio]==1.1.0",
"faker==40.15.0",
"ipython==9.12.0",
"watchdog==6.0.0",
"werkzeug==3.1.8",
]
tasks = [
# Heavy duty dependencies used for computationally
# intensive tasks, such as spectrogram generation
"batbot==0.1.3",
"Pillow==12.2.0",
"numpy==2.4.4",
"scipy==1.17.1",
"scikit-image==0.26.0",
"opencv-python-headless==4.13.0.92",
]
[dependency-groups]
dev = [
# Additional developer tools
# The "dev" dependency group is installed by default,
# so use this to install "development" and "tasks" extras by default too
"bats-ai[development,tasks]",
"tox==4.53.0",
"tox-uv==1.35.1",
]
lint = [
"ruff==0.15.11",
]
type = [
"mypy==1.20.1",
"celery-types==0.26.0",
"django-stubs[compatible-mypy]==6.0.3",
"types-requests==2.33.0.20260408",
]
test = [
"factory-boy==3.3.3",
"pytest==9.0.3",
"pytest-django==4.12.0",
"pytest-mock==3.15.1",
# Enable with "pytest --random-order ..."
"pytest-random-order==1.2.0",
# Enable with "pytest --count=... ..."
"pytest-repeat==0.9.4",
]
[tool.hatch.build]
only-include = [
"bats_ai",
]
[tool.uv]
constraint-dependencies = [
# Earlier versions of "numba" didn't specify an upper bound for
# its compatability with "numpy", which led to incorrect versions of "numpy".
"numba >= 0.61.0",
]
[[tool.uv.index]]
name = "large_image_wheels"
url = "https://girder.github.io/large_image_wheels/"
explicit = true
[tool.uv.sources]
gdal = { index = "large_image_wheels" }
[tool.ruff]
line-length = 100
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Incompatible with formatter
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"D206", # docstring-tab-indentation
"D300", # triple-single-quotes
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
"Q", # flake8-quotes
"W191", # tab-indentation
# Incompatible with Django
"A003", # builtin-attribute-shadowing
"ARG001", # unused-function-argument
"ARG002", # unused-method-argument
"RUF012", # mutable-class-default
# Overly burdensome
"ANN", # flake8-annotations
"D1", # undocumented-*
"EM", # flake8-errmsg
"ERA001", # commented-out-code
"FIX", # flake8-fixme
"PLR2004", # magic-value-comparison
"RET505", # superfluous-else-return
"RET506", # superfluous-else-raise
"RET507", # superfluous-else-continue
"RET508", # superfluous-else-break
"TD002", # missing-todo-author
"TD003", # missing-todo-link
"TRY003", # raise-vanilla-args
# Project-specific
"BLE001", # blind-except
"DJ001", # django-nullable-model-string-field
"N815", # mixed-case-variable-in-class-scope
"N999", # invalid-module-name
"PLC0415", # import-outside-top-level
"PLW2901", # redefined-loop-name
"PTH", # flake8-use-pathlib
"S110", # try-except-pass
"TRY300", # try-consider-else
"TRY301", # raise-within-try
]
[tool.ruff.lint.per-file-ignores]
"**/migrations/**" = [
"N806", # non-lowercase-variable-in-function
"RUF012", # mutable-class-default
]
"**/settings/**" = [
"F403", # undefined-local-with-import-star
"F405", # undefined-local-with-import-star-usage
]
"**/settings/{development,testing}.py" = [
"S105", # hardcoded-password-string
]
"**/tests/**" = [
"DJ007", # django-all-with-model-form
"DJ008", # django-model-without-dunder-str
"INP001", # implicit-namespace-package
"PLR0913", # too-many-arguments
"S", # flake8-bandit
"SLF001", # private-member-access
]
"scripts/**" = [
"INP001", # implicit-namespace-package
]
[tool.ruff.lint.flake8-boolean-trap]
extend-allowed-calls = ["pydantic.Field", "django.db.models.Value"]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["ninja.Query"]
[tool.ruff.lint.flake8-self]
extend-ignore-names = ["_base_manager", "_default_manager", "_meta"]
[tool.ruff.lint.isort]
# Sort by name, don't cluster "from" vs "import"
force-sort-within-sections = true
# Deferred annotations allows TC* rules to move more imports into TYPE_CHECKING blocks
required-imports = ["from __future__ import annotations"]
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder", "resonant-settings"]
sections = {"resonant-settings" = ["resonant_settings"] }
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.mypy]
files = [
"bats_ai",
]
check_untyped_defs = true
ignore_missing_imports = true
show_error_codes = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
plugins = [
"mypy_django_plugin.main",
]
[tool.django-stubs]
django_settings_module = "bats_ai.settings.testing"
[tool.pytest.ini_options]
addopts = [
# Test utilities should be imported absolutely from the pythonpath,
# so use the Pytest-recommended "importlib" mode
"--import-mode=importlib",
"--strict-config",
"--strict-markers",
"--showlocals",
"--verbose",
# Specifying as "--ds" will override any value in the environment
"--ds=bats_ai.settings.testing",
]
filterwarnings = [
"error",
# pytest often causes unclosed socket warnings
'ignore:unclosed <socket\.socket:ResourceWarning',
# https://github.com/vitalik/django-ninja/issues/1245
"ignore:Support for class-based `config` is deprecated:pydantic.warnings.PydanticDeprecatedSince20",
# https://github.com/celery/kombu/issues/1339
"ignore:SelectableGroups dict interface is deprecated:DeprecationWarning:kombu",
]