-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCargo.toml
More file actions
107 lines (94 loc) · 4.92 KB
/
Cargo.toml
File metadata and controls
107 lines (94 loc) · 4.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
[package]
name = "thetadatadx-py"
version = "10.0.0"
edition = "2021"
rust-version = "1.88"
description = "Python bindings for thetadatadx — native ThetaData SDK powered by Rust"
license = "Apache-2.0"
homepage = "https://github.com/userFRM/ThetaDataDx"
repository = "https://github.com/userFRM/ThetaDataDx"
documentation = "https://github.com/userFRM/ThetaDataDx/blob/main/docs/api-reference.md"
readme = "README.md"
# PyPI package only; never publish this PyO3 shim to crates.io.
publish = false
[lib]
name = "thetadatadx"
crate-type = ["cdylib"]
doc = false
[dependencies]
# The Rust SDK we're wrapping
thetadatadx = { path = "../../crates/thetadatadx", features = ["arrow"] }
tdbe = { version = "0.13.1", path = "../../crates/tdbe" }
# Direct prost dep for decoding `thetadatadx::proto::ResponseData` bytes in
# the `decode_response_bytes` hook. The main crate no longer re-exports
# `prost`; we pull it in here at the same version pin.
prost = "=0.14.3"
# PyO3 bindings. We target the stable ABI so one wheel per platform supports
# every Python version from 3.9 upward.
pyo3 = { version = "=0.28.2", features = ["abi3-py39", "multiple-pymethods"] }
# Bridge between pyo3 and tokio so generated `*_async` methods return real
# awaitables backed by the shared runtime singleton (no second runtime is
# spun up per call). Pin to the matching release for pyo3 0.28.
pyo3-async-runtimes = { version = "=0.28.0", features = ["attributes", "tokio-runtime"] }
# Apache Arrow columnar pipeline for the DataFrame adapter. We pick the
# upstream `arrow` crate with the `pyarrow` feature over the third-party
# `pyo3-arrow` because:
# 1. Arrow Apache owns the pyo3 compat matrix — version bumps ship
# together (arrow 58 <-> pyo3 0.28), so we stay on the canonical
# upgrade path.
# 2. Single dep, fewer surfaces to audit. `arrow_pyarrow::{IntoPyArrow,
# PyArrowType, Table}` is all we need.
# 3. Zero-copy to pyarrow via the Arrow C Data Interface, identical
# semantics to pyo3-arrow.
#
# `arrow-array` + `arrow-schema` give us the typed builders
# (Int32Array / Float64Array / Int64Array / StringArray) and `Schema` /
# `DataType` needed to construct RecordBatch from Vec<TickType> in one
# allocation per column.
arrow = { version = "58.1.0", features = ["pyarrow"] }
arrow-array = "58.1.0"
arrow-schema = "58.1.0"
# Async bridge: run tokio futures from sync Python
tokio = { version = "1.52.1", features = ["rt-multi-thread"] }
# Error derivation for the 365-day auto-chunk date-math module. Matches
# the workspace crate's pin so we never drift on the trait surface.
thiserror = "2.0.18"
# Reason: the auto-chunk helper splits multi-year date ranges into
# ≤365-day chunks before dispatch. The hand-rolled YYYYMMDD parser in
# `chunking.rs` previously range-checked month 1..=12 and day 1..=31
# independently, so Gregorian-impossible inputs like "20230229" (Feb 29
# in a non-leap year) and "20240231" (Feb 31) parsed to a `Ymd` whose
# `to_ord` silently normalized to a neighbouring valid day — wrong
# chunk boundaries on impossible ranges. Swap the hand-rolled validator
# for `chrono::NaiveDate::parse_from_str(_, "%Y%m%d")` which enforces
# real Gregorian validity. chrono is already a transitive dep via the
# tzdb chain pulled in by the main crate, so adoption adds zero new
# crates to the build tree (verified in `sdks/python/Cargo.lock`).
# `default-features = false` with `alloc` keeps the compile profile
# minimal — we only need the calendar math.
chrono = { version = "=0.4.44", default-features = false, features = ["alloc"] }
# Structured diagnostics for generator-emitted streaming helpers. Trace-level
# emission only — shutdown-time `tx.send` failures (Python rx dropped before
# tx side) are normal and must not spam default logs.
tracing = "0.1.44"
# `tracing_subscriber::Layer` trait + registry for the Python-logging
# bridge (see `logging_bridge.rs`). The `registry` feature pulls in
# `tracing_subscriber::registry::LookupSpan` which the `Layer` impl
# requires. No `fmt` subscriber — we forward to Python's stdlib
# logging, not to stderr.
tracing-subscriber = { version = "0.3.20", default-features = false, features = ["registry"] }
# Match the main workspace's strict bar. This crate is `[workspace.exclude]`d
# in the root `Cargo.toml` (it has its own toolchain / feature footprint), so
# it can't inherit via `[lints] workspace = true` — mirror the rules locally.
[lints.rust]
warnings = "deny"
unsafe_op_in_unsafe_fn = "deny"
[lints.clippy]
all = { level = "deny", priority = -1 }
# PyO3 `#[pymethods]` become flat free-function signatures, one param per
# optional kwarg. Generated endpoints expose every query parameter from
# `endpoint_surface.toml` as a separate `Option<T>` arg, routinely hitting
# 10-27 params. The "too many arguments" heuristic is a style lint built
# for hand-written Rust APIs; it doesn't apply to generator-emitted binding
# crates where the argument list is the language's public contract.
too_many_arguments = "allow"