-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
110 lines (100 loc) · 3.51 KB
/
Copy pathpyproject.toml
File metadata and controls
110 lines (100 loc) · 3.51 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
[project]
name = "kalshi-sdk"
version = "7.0.0"
description = "A professional Python SDK for the Kalshi prediction markets and Perps (margin) APIs"
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.12"
authors = [{ name = "Texas Coding" }]
keywords = ["kalshi", "prediction-markets", "trading", "api", "sdk"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Office/Business :: Financial :: Investment",
"Typing :: Typed",
]
dependencies = [
"httpx>=0.27,<1",
"pydantic>=2.4,<3",
"cryptography>=43,<50",
"websockets>=14,<17",
"typing-extensions>=4.5",
]
[project.optional-dependencies]
pandas = ["pandas>=2,<4"]
polars = ["polars>=1,<2"]
http2 = ["h2>=4,<5"]
all = ["pandas>=2,<4", "polars>=1,<2", "h2>=4,<5"]
[project.urls]
Homepage = "https://github.com/TexasCoding/kalshi-python-sdk"
Documentation = "https://github.com/TexasCoding/kalshi-python-sdk#readme"
Repository = "https://github.com/TexasCoding/kalshi-python-sdk"
Issues = "https://github.com/TexasCoding/kalshi-python-sdk/issues"
Changelog = "https://github.com/TexasCoding/kalshi-python-sdk/blob/main/CHANGELOG.md"
PyPI = "https://pypi.org/project/kalshi-sdk/"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["kalshi"]
[tool.ruff]
target-version = "py312"
line-length = 100
[tool.ruff.lint]
select = ["E", "F", "W", "I", "N", "UP", "B", "A", "SIM", "RUF"]
ignore = [
"A002", # allow shadowing builtins like 'type' (Kalshi API uses this field name)
"UP046", # Pydantic v2 requires Generic[T] subclass syntax for generic models
]
[tool.mypy]
python_version = "3.12"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
[[tool.mypy.overrides]]
# Optional DataFrame extras — stubs intentionally not added to project deps.
module = ["pandas", "polars"]
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
markers = [
"integration: tests that hit the real Kalshi demo API (require credentials)",
"integration_real_api_only: endpoints the demo server cannot service (auth-gated roles, demo-broken). Skipped under the default integration run; enable explicitly with -m integration_real_api_only against a prod-like account.",
]
filterwarnings = [
# `kalshi.resources.multivariate.{lookup_tickers,lookup_history,create_market}`
# are flagged `@deprecated` per spec (the endpoints predate RFQs). Tests
# that exercise them on purpose would drown CI in noise; user callers
# still see the warning in their own code.
"ignore:This endpoint predates RFQs.*:DeprecationWarning",
]
[dependency-groups]
dev = [
"pytest>=9,<10",
"pytest-asyncio>=0.24,<2",
"respx>=0.21,<1",
"ruff>=0.8,<1",
"mypy>=1.13,<3",
# Transitive of mypy 2.1.x. Pin <0.5 because 0.5.0 only ships cp314
# wheels (cp39-abi3 dropped), breaking CI on Python 3.12 + 3.13 runners.
# Drop once upstream republishes broader wheels.
"ast-serialize<0.7",
"datamodel-code-generator>=0.26",
"pyyaml>=6",
"python-dotenv>=1",
"pandas>=2,<4",
"polars>=1,<2",
]
docs = [
"mkdocs>=1.6,<2",
"mkdocs-material>=9.5,<10",
"mkdocstrings[python]>=0.27,<2",
]