-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
182 lines (164 loc) · 4.75 KB
/
pyproject.toml
File metadata and controls
182 lines (164 loc) · 4.75 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "selectron"
dynamic = ["version"]
description = 'AI web parsing library & CLI'
readme = "README.md"
requires-python = ">=3.12"
license = "MIT"
keywords = []
authors = [{ name = "Substrate Labs Inc.", email = "ben@substrate.run" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"beautifulsoup4>=4.13.4",
"bs4>=0.0.2",
"duckdb>=1.2.2",
"httpx>=0.28.1",
"lxml>=5.4.0",
"markdownify>=1.1.0",
"pillow>=10.4.0",
"polars>=1.29.0",
"psutil>=7.0.0",
"pyarrow>=20.0.0",
"pydantic-ai>=0.1.9",
"pydantic>=2.11.4",
"python-dateutil>=2.9.0.post0",
"rich>=14.0.0",
"textual-dev>=1.7.0",
"textual>=3.2.0",
"websockets>=15.0.1",
]
[project.scripts]
selectron = "selectron.entry_points:start"
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-cov>=4.0",
"pytest-xdist>=3.0",
"pytest-mock>=3.10.0",
"pytest-asyncio>=0.21.0",
"pytest-httpx>=0.24.0",
"ruff>=0.3.0",
"pyright>=1.1.350",
"term-image>=0.7.2"
]
[project.urls]
Documentation = "https://github.com/SubstrateLabs/selectron"
Issues = "https://github.com/SubstrateLabs/selectron/issues"
Source = "https://github.com/SubstrateLabs/selectron"
[tool.hatch.version]
path = "src/selectron/__about__.py"
[tool.hatch.build]
include = [
"src/**/*.py",
"src/selectron/dom/buildDomTree.js",
"src/selectron/parsers/**/*.json"
]
exclude = [
"tests/**"
]
[tool.hatch.build.targets.wheel]
packages = ["src/selectron"]
[tool.hatch.envs.types]
extra-dependencies = ["mypy>=1.0.0"]
[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:src/selectron tests}"
[tool.coverage.run]
source_pkgs = ["selectron", "tests"]
branch = true
parallel = true
omit = ["src/selectron/__about__.py"]
[tool.coverage.paths]
selectron = ["src/selectron", "*/cli/src/selectron"]
tests = ["tests", "*/cli/tests"]
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
[tool.pytest.ini_options]
pythonpath = ["src"]
asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "function"
# Logging Configuration
log_cli = true
log_cli_level = "DEBUG"
log_cli_format = "%(asctime)s [%(levelname)s] [%(name)s] %(message)s" # Use standard level names
log_cli_date_format = "%H:%M:%S"
log_file = ".pytest_logs/test_session.log" # Log file path
log_file_level = "DEBUG" # Log everything to the file
log_file_format = "%(asctime)s [%(levelname)-8s] [%(name)s:%(lineno)d] %(message)s" # More detail in file
log_file_date_format = "%Y-%m-%d %H:%M:%S"
log_file_mode = "w" # Overwrite log file each run
[tool.pyright]
include = ["src", "tests"]
exclude = ["**/__pycache__", "build", "dist"]
reportMissingImports = true
reportMissingTypeStubs = false
pythonVersion = "3.11"
typeCheckingMode = "basic"
reportUnknownMemberType = false
reportUnknownArgumentType = false
reportUnknownVariableType = false
reportUnknownLambdaType = false
reportPrivateUsage = false
reportUnnecessaryIsInstance = false # trips up on bs4 tags
reportOptionalMemberAccess = true
reportOptionalCall = true
reportOptionalOperand = true
reportUnnecessaryCast = true
reportAssertAlwaysTrue = true
reportIncompatibleMethodOverride = true
reportUninitializedInstanceVariable = true
reportConstantRedefinition = true
reportCallInDefaultInitializer = true
reportUnusedClass = true
reportDuplicateImport = true
reportInvalidStringEscapeSequence = true
reportMissingTypeArgument = false # too many errors
reportMissingSuperCall = false # not needed if not inheriting
reportImplicitStringConcatenation = false # this is fine
reportUnnecessaryTypeIgnoreComment = false # doesn't work well with other rules
reportUnusedVariable = true
reportPropertyTypeMismatch = true
reportUnusedCoroutine = true
reportUnusedImport = true
reportIncompatibleVariableOverride = true
reportFunctionMemberAccess = true
reportInvalidTypeForm = true
reportUnnecessaryComparison = false # annoying
[tool.ruff]
line-length = 100
target-version = "py311"
# Add these common directories to exclude
extend-exclude = [
".git",
".venv",
"__pycache__",
"build",
"dist",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
]
extend-select = [
"B", # flake8-bugbear (optional)
"C4", # flake8-comprehensions (optional)
]
ignore = [
"E501", # Line too long
]
[tool.ruff.lint.isort]
known-first-party = ["selectron"]
[tool.ruff.format]
quote-style = "double"
line-ending = "auto"
indent-style = "space"