-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
258 lines (240 loc) · 6.39 KB
/
pyproject.toml
File metadata and controls
258 lines (240 loc) · 6.39 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
[project]
name = "py-alpaca-api"
version = "3.0.1"
description = "A modern Python wrapper for the Alpaca Trading API with 100% coverage of Trading and Market Data endpoints"
readme = "README.md"
license = { text = "MIT" }
authors = [
{ name = "TexasCoding", email = "jeff@texascoding.com" }
]
maintainers = [
{ name = "TexasCoding", email = "jeff@texascoding.com" }
]
keywords = [
"alpaca",
"trading",
"stocks",
"finance",
"api",
"market-data",
"algorithmic-trading",
"quantitative-finance",
"backtesting",
"paper-trading",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Financial and Insurance Industry",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business :: Financial",
"Topic :: Office/Business :: Financial :: Investment",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
requires-python = ">=3.10"
dependencies = [
"beautifulsoup4>=4.12.3",
"numpy>=2.1.1",
"pandas>=2.2.3",
"pendulum>=3.0.0",
"prophet>=1.1.5",
"redis>=6.4.0",
"requests>=2.32.3",
"requests-cache>=1.2.1",
"requests-ratelimiter>=0.7.0",
"yfinance>=0.2.43",
]
[project.urls]
Homepage = "https://github.com/TexasCoding/py-alpaca-api"
Documentation = "https://py-alpaca-api.readthedocs.io"
Repository = "https://github.com/TexasCoding/py-alpaca-api"
Issues = "https://github.com/TexasCoding/py-alpaca-api/issues"
Changelog = "https://github.com/TexasCoding/py-alpaca-api/blob/main/CHANGELOG.md"
[project.optional-dependencies]
dev = [
"hypothesis>=6.112.1",
"pre-commit>=3.8.0",
"pytest>=8.3.3",
"pytest-mock>=3.14.0",
"pytest-cov>=5.0.0",
"ruff>=0.6.8",
"mypy>=1.11.0",
"types-requests>=2.32.0",
"types-beautifulsoup4>=4.12.0",
]
docs = [
"sphinx>=8.1.3",
"sphinx-rtd-theme>=3.0.2",
"myst-parser>=4.0.1",
"sphinx-autoapi>=3.6.0",
"nbsphinx>=0.9.7",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.uv]
dev-dependencies = [
"hypothesis>=6.112.1",
"pre-commit>=3.8.0",
"pytest>=8.3.3",
"pytest-mock>=3.14.0",
"pytest-cov>=5.0.0",
"ruff>=0.6.8",
"mypy>=1.11.0",
"types-requests>=2.32.0",
"types-beautifulsoup4>=4.12.0",
"sphinx>=8.1.3",
"sphinx-rtd-theme>=3.0.2",
"myst-parser>=4.0.1",
"sphinx-autoapi>=3.6.0",
"nbsphinx>=0.9.7",
]
# Ruff configuration - Modern Python linter and formatter
[tool.ruff]
target-version = "py310"
line-length = 88
fix = true
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"PTH", # flake8-use-pathlib
"N", # pep8-naming
"D", # pydocstyle
"RUF", # Ruff-specific rules
"TRY", # tryceratops
"LOG", # flake8-logging
"RET", # flake8-return
"ERA", # eradicate
"PL", # Pylint
]
ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"PLR2004", # Magic value used in comparison
"E501", # Line too long
"D205",
"TRY003",
"TRY002",
"D415",
"D301",
"RET504",
"PTH100"
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D", "S101", "ARG", "PLR2004"]
"__init__.py" = ["F401", "D104"]
"src/py_alpaca_api/cache/cache_manager.py" = ["PLC0415"] # Allow local import for optional redis
[tool.ruff.lint.isort]
known-first-party = ["py_alpaca_api"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# MyPy configuration - Static type checker
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
disallow_any_unimported = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
check_untyped_defs = true
ignore_missing_imports = true
show_error_codes = true
show_column_numbers = true
pretty = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
check_untyped_defs = false
[[tool.mypy.overrides]]
module = "py_alpaca_api.*"
strict = false
warn_return_any = false
no_implicit_optional = false
[[tool.mypy.overrides]]
module = [
"prophet.*",
"yfinance.*",
"requests_cache.*",
"requests_ratelimiter.*",
"pendulum.*",
"redis.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "py_alpaca_api.cache.cache_manager"
warn_unused_ignores = false
warn_unreachable = false
# Pytest configuration
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-ra",
"--strict-markers",
"--cov=py_alpaca_api",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
"--tb=short", # Shorter traceback format
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
]
# Coverage configuration
[tool.coverage.run]
source = ["py_alpaca_api"]
branch = true
omit = [
"*/tests/*",
"*/__init__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if __name__ == .__main__.:",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]
precision = 2
show_missing = true
skip_covered = false