forked from dgunning/edgartools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
224 lines (200 loc) · 5.95 KB
/
Copy pathpyproject.toml
File metadata and controls
224 lines (200 loc) · 5.95 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
[build-system]
requires = ["hatchling>=1.26.3"]
build-backend = "hatchling.build"
[project]
name = "edgartools"
description = 'Navigate Edgar filings with ease'
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
keywords = ["sec", "edgar", "filings", "company", "python", "finance", "financial", "reports"]
authors = [
{ name = "Dwight Gunning", email = "dgunning@gmail.com" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"License :: OSI Approved :: MIT License",
]
dependencies = [
"httpx>=0.25.0",
"pandas>=2.0.0",
"tabulate>=0.9.0",
"pyarrow>=17.0.0",
"beautifulsoup4>=4.10.0",
"lxml>=4.4",
"rich>=13.8.0",
"humanize>=4.0.0",
"stamina>=24.2.0",
"orjson>=3.6.0",
"textdistance>=4.5.0",
"rank_bm25>=0.2.1",
"rapidfuzz>=3.5.0",
"unidecode>=1.2.0",
"pydantic>=2.0.0",
"tqdm>=4.62.0",
"nest-asyncio>=1.5.1",
"jinja2>=3.1.0",
"httpxthrottlecache>=0.1.6",
]
dynamic = ["version"]
[project.optional-dependencies]
ai = [
"mcp==1.12.3; python_version>='3.10'", # Model Context Protocol (Python 3.10+ only)
"tiktoken>=0.10.0", # Token counting for OpenAI models
]
ai-dev = [
"pytest-mock>=3.12.0", # For mocking AI responses
"responses>=0.24.0", # HTTP response mocking
]
[project.urls]
Documentation = "https://dgunning.github.io/edgartools/"
Issues = "https://github.com/dgunning/edgartools/issues"
Source = "https://github.com/dgunning/edgartools"
[tool.hatch.version]
path = "edgar/__about__.py"
[tool.hatch.build]
include = [
"edgar/**/*.py",
"edgar/**/templates/*.html",
"edgar/**/docs/*.md",
"edgar/reference/data/*",
"edgar/entity/data/*",
"edgar/xbrl/standardization/*",
"LICENSE.txt"
]
artifacts = [
"LICENSE.txt" # And this line
]
[tool.hatch.envs.default]
dependencies = [
"pytest",
"pytest-cov",
"pytest-env",
"pytest-xdist",
"pytest-asyncio",
"pytest-retry",
"filelock",
"pyinstrument",
"pyright",
"ruff",
"tqdm",
"xlsxwriter",
"openpyxl",
"jupyter",
"freezegun==1.5.1",
"mkdocs",
"mkdocstrings[python]",
"mkdocs-material"
]
features = [
"ai",
"ai-dev"
]
[tool.hatch.envs.default.scripts]
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=edgar --cov=tests --ignore=tests/legacy {args}"
no-cov = "cov --no-cov {args}"
lint = "ruff check edgar"
smoke-filings = "python tests/batch/batch_filings.py {args}"
# Test categorization commands
test-fast = "pytest -m 'fast' {args}"
test-slow = "pytest -m 'slow' {args}"
test-network = "pytest -m 'network' {args}"
test-core = "pytest -m 'not (slow or network or performance or batch)' --ignore=tests/manual --ignore=tests/perf {args}"
# Parallel CI test strategy (skip regression tests for faster feedback)
#
# HYBRID EXCLUSION STRATEGY:
# 1. Marker-based: -m 'not regression' excludes tests marked as regression
# 2. Path-based: --ignore=tests/issues/regression excludes entire folder
# 3. Auto-marking: conftest.py automatically marks tests in regression folders
#
# This ensures regression tests are excluded even if developers/agents forget markers.
test-ci-fast = "pytest --cov --cov-report=xml -m 'fast and not regression' {args}"
test-ci-network = "pytest --cov --cov-report=xml -m 'network and not slow and not regression' {args}"
test-ci-slow = "pytest --cov --cov-report=xml -m 'slow and not regression' {args}"
test-ci-core = "pytest --cov --cov-report=xml -m 'not (fast or network or slow or regression or performance or batch)' --ignore=tests/manual --ignore=tests/perf --ignore=tests/issues/regression {args}"
test-ci-all = "pytest --cov --cov-report=xml -m 'not regression' --ignore=tests/manual --ignore=tests/perf --ignore=tests/issues/regression {args}"
# Regression tests (run separately/on-demand for comprehensive bug prevention)
test-regression = "pytest --cov --cov-report=xml -m regression {args}"
# Other test categories
test-batch = "pytest tests/batch/ -m 'batch' {args}"
test-reproduction = "pytest tests/issues/reproductions/ -m 'reproduction' {args}"
test-full = "pytest --ignore=tests/manual --ignore=tests/perf {args}"
[tool.hatch.envs.test]
dependencies = [
"pytest",
"pytest-cov",
"pytest-env",
"pytest-asyncio"
]
[[tool.hatch.envs.test.matrix]]
python = ["39", "310", "311", "312"]
[tool.coverage.run]
branch = true
parallel = true
omit = [
"edgar/__about__.py",
"tests/perf/*"
]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.ruff]
line-length = 150
exclude = [
".git",
"__pycache__",
"build",
"dist",
"docs/source/conf.py",
"tests",
]
extend-include = ["*.ipynb"]
[tool.ruff.lint]
select = ["F", "E", "W", "S", "B", "G", "N", "I001", "T", "PD", "C90"]
ignore = [
"W291",
"E501",
"S608",
"PD901",
"C901",
"S101"
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
[dependency-groups]
dev = [
"pre-commit>=4.3.0",
"pytest-retry>=1.7.0",
]
[tool.pytest.ini_options]
env = [
"EDGAR_IDENTITY=Dev Gunning developer-gunning@gmail.com",
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
retries = 2
retry_delay = 4
cumulative_timing = false
retry_outcome = "rerun"
# Pytest markers for test categorization
markers = [
"fast: Fast tests that run quickly (< 0.1s each)",
"slow: Slow tests that take significant time (> 1s each)",
"network: Tests that require internet connectivity",
"regression: Regression tests for specific GitHub issues",
"batch: Batch processing tests",
"performance: Performance and benchmarking tests",
"reproduction: Tests that reproduce specific issues",
"integration: Integration tests",
"data_quality: Data quality validation tests",
]