-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
128 lines (112 loc) · 3.92 KB
/
pyproject.toml
File metadata and controls
128 lines (112 loc) · 3.92 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
# This enables: `pip install -e .`
[tool.setuptools]
# map the “root” package directory to src/
package-dir = { "" = "src" }
# turn on automatic package discovery
packages = { find = { where = ["src"], include = ["*"] } }
[build-system]
# NOTE: We should *not* add "wheel" here!
# See: https://www.reddit.com/r/Python/comments/1jwbymm/psa_you_should_remove_wheel_from_your/
requires = ["setuptools ~=77.0"]
build-backend = "setuptools.build_meta"
[project]
name = "dank"
version = "0.1.0"
description = "Dense Analysis Network Knowledge"
authors = [{ name = "Andrew Wray", email = "andrew@denseanalysis.org" }]
readme = "README.md"
requires-python = ">=3.13"
# Core dependencies
dependencies = [
"yt-dlp==2026.2.4",
"zendriver==0.13.0",
"aiohttp==3.12.15",
"bleach==6.2.0",
"inotify-simple==1.3.5",
"clickhouse-connect==0.8.15",
"sentence-transformers==5.2.2",
"torch==2.10.0+cpu",
"jinja2==3.1.6",
]
[project.scripts]
scrape = "dank.scrape.__main__:main"
process = "dank.process.__main__:main"
web = "dank.web.__main__:main"
clickhouse-query = "dank.tools.clickhouse_query:main"
embed-text = "dank.tools.embed_text:main"
download-embedding-model = "dank.tools.download_embedding_model:main"
[dependency-groups]
dev = [
# NOTE: pyright 1.1.408 broke match ... case type narrowing
"pyright==1.1.402",
"pytest==9.0.2",
"pytest-asyncio==1.3.0",
"ruff==0.15.1",
]
[tool.pyright]
venvPath = "./"
venv = ".venv"
pythonVersion = "3.13"
extraPaths = ["src"]
reportMissingImports = true
reportMissingModuleSource = "error"
typeCheckingMode = "strict"
# Settings for ruff
[tool.ruff]
line-length = 79
target-version = "py313"
# Include all default rules from the ruff "all" baseline, but we'll fine-tune.
lint.select = [
"E", # PEP8 errors (confirms with PEP8)
"W", # PEP8 warnings (confirms with PEP8)
"I", # isort (sorts imports)
"B", # flake8-bugbear rules (catches mulable by mistake and more)
"A", # flake8-builtins (stop accidental shadowing)
"COM", # flake8-commas (no accidental tuples and more)
"ASYNC", # flake8-async rules (fixes async issues)
"FBT", # flake8-boolean-trap rules (stops the Boolean Trap)
"F", # Pyflakes (fixes common mistakes)
"FAST", # FastAPI rules (fixes FastAPI misusage)
"RUF", # ruff-specific rules (fixes common bugs)
"UP", # pyupgrade (modernises code)
"C90", # mccabe (no overly-complex code)
]
lint.ignore = [
# batched-without-explicit-strict is insane! Shut up!
# You almost never want strict=True on itertools.batched.
"B911",
]
[tool.ruff.lint.mccabe]
# Flag errors (`C901`) whenever the complexity level exceeds 10
# This is 10 possible branches through code in a single function.
# See also: https://ntrs.nasa.gov/api/citations/20205011566/downloads/20205011566.pdf
max-complexity = 10
# ruff isort settings
[tool.ruff.lint.isort]
# Black-compatible isort settings for ruff
combine-as-imports = true
force-wrap-aliases = true
split-on-trailing-comma = true
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
# You can keep third party libraries grouped together by adding them here.
# known-third-party = []
# pytest configuration
[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-q --strict-markers --tb=short -m \"not embeddings\""
asyncio_mode = "auto"
testpaths = ["tests"]
python_files = ["test_*.py"]
markers = [
"slow: mark slow tests",
"integration: mark integration tests",
"allow_network: allow network connections for this test",
"unit: mark unit tests",
"embeddings: mark real-model embedding similarity checks",
]
[tool.uv.sources]
torch = { index = "pytorch-cpu" }
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true