mt5-bridge-py 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mt5_bridge_py-0.6.0/.gitattributes +3 -0
- mt5_bridge_py-0.6.0/.github/workflows/ci.yml +209 -0
- mt5_bridge_py-0.6.0/.github/workflows/publish.yml +132 -0
- mt5_bridge_py-0.6.0/.gitignore +38 -0
- mt5_bridge_py-0.6.0/CHANGELOG.md +391 -0
- mt5_bridge_py-0.6.0/CONTRIBUTING.md +163 -0
- mt5_bridge_py-0.6.0/Cargo.lock +1261 -0
- mt5_bridge_py-0.6.0/Cargo.toml +93 -0
- mt5_bridge_py-0.6.0/LICENSE +21 -0
- mt5_bridge_py-0.6.0/PKG-INFO +628 -0
- mt5_bridge_py-0.6.0/README.md +138 -0
- mt5_bridge_py-0.6.0/benches/benchmarks.rs +394 -0
- mt5_bridge_py-0.6.0/benches/latency_harness.rs +186 -0
- mt5_bridge_py-0.6.0/benches/mt5_extensive_benchmark.rs +218 -0
- mt5_bridge_py-0.6.0/benches/pipe_benchmark.rs +596 -0
- mt5_bridge_py-0.6.0/benches/push_probe.rs +143 -0
- mt5_bridge_py-0.6.0/crates/mt5-bridge-py/Cargo.lock +670 -0
- mt5_bridge_py-0.6.0/crates/mt5-bridge-py/Cargo.toml +21 -0
- mt5_bridge_py-0.6.0/crates/mt5-bridge-py/README.md +596 -0
- mt5_bridge_py-0.6.0/crates/mt5-bridge-py/src/lib.rs +1994 -0
- mt5_bridge_py-0.6.0/crates/mt5-bridge-py/tests/test_all_features.py +545 -0
- mt5_bridge_py-0.6.0/crates/mt5-bridge-py/tests/test_async_only.py +362 -0
- mt5_bridge_py-0.6.0/crates/mt5-bridge-py/tests/test_import.py +46 -0
- mt5_bridge_py-0.6.0/deny.toml +50 -0
- mt5_bridge_py-0.6.0/docs/api-reference.md +419 -0
- mt5_bridge_py-0.6.0/docs/architecture.md +180 -0
- mt5_bridge_py-0.6.0/docs/benchmarks.md +156 -0
- mt5_bridge_py-0.6.0/docs/examples.md +679 -0
- mt5_bridge_py-0.6.0/docs/getting-started.md +142 -0
- mt5_bridge_py-0.6.0/docs/migration.md +49 -0
- mt5_bridge_py-0.6.0/docs/multi-instance.md +55 -0
- mt5_bridge_py-0.6.0/docs/protocol.md +341 -0
- mt5_bridge_py-0.6.0/docs/python-api.md +309 -0
- mt5_bridge_py-0.6.0/docs/streaming.md +160 -0
- mt5_bridge_py-0.6.0/docs/trading.md +285 -0
- mt5_bridge_py-0.6.0/docs/troubleshooting.md +64 -0
- mt5_bridge_py-0.6.0/examples/01_account_info.rs +37 -0
- mt5_bridge_py-0.6.0/examples/02_symbol_info.rs +59 -0
- mt5_bridge_py-0.6.0/examples/03_fetch_rates.rs +75 -0
- mt5_bridge_py-0.6.0/examples/04_stream_ticks.rs +91 -0
- mt5_bridge_py-0.6.0/examples/05_order_send.rs +113 -0
- mt5_bridge_py-0.6.0/examples/06_pending_order.rs +102 -0
- mt5_bridge_py-0.6.0/examples/07_stream_bars.rs +78 -0
- mt5_bridge_py-0.6.0/examples/08_chunked_history.rs +89 -0
- mt5_bridge_py-0.6.0/examples/09_stream_bars_push.rs +71 -0
- mt5_bridge_py-0.6.0/examples/10_wal_order_store.rs +94 -0
- mt5_bridge_py-0.6.0/examples/11_ping_stats.rs +52 -0
- mt5_bridge_py-0.6.0/examples/12_symbols.rs +64 -0
- mt5_bridge_py-0.6.0/examples/13_calendar.rs +65 -0
- mt5_bridge_py-0.6.0/examples/14_subscriptions.rs +45 -0
- mt5_bridge_py-0.6.0/examples/15_filtered_queries.rs +78 -0
- mt5_bridge_py-0.6.0/mql5/Experts/mt5_bridge.mq5 +383 -0
- mt5_bridge_py-0.6.0/mql5/Include/Mt5Bridge/Auth.mqh +72 -0
- mt5_bridge_py-0.6.0/mql5/Include/Mt5Bridge/MarketData.mqh +661 -0
- mt5_bridge_py-0.6.0/mql5/Include/Mt5Bridge/Orders.mqh +1026 -0
- mt5_bridge_py-0.6.0/mql5/Include/Mt5Bridge/Protocol.mqh +621 -0
- mt5_bridge_py-0.6.0/mql5/Include/Mt5Bridge/Queues.mqh +455 -0
- mt5_bridge_py-0.6.0/mql5/Include/Mt5Bridge/Takeover.mqh +137 -0
- mt5_bridge_py-0.6.0/mql5/autostart/README.md +161 -0
- mt5_bridge_py-0.6.0/mql5/autostart/env.sh +57 -0
- mt5_bridge_py-0.6.0/mql5/autostart/launch_mt5.bat +23 -0
- mt5_bridge_py-0.6.0/mql5/autostart/launch_mt5.sh +44 -0
- mt5_bridge_py-0.6.0/mql5/autostart/mt5_bridge.set.example +34 -0
- mt5_bridge_py-0.6.0/mql5/autostart/render_config.sh +121 -0
- mt5_bridge_py-0.6.0/mql5/autostart/terminal.ini.example +50 -0
- mt5_bridge_py-0.6.0/pyproject.toml +45 -0
- mt5_bridge_py-0.6.0/src/audit/mod.rs +540 -0
- mt5_bridge_py-0.6.0/src/backend.rs +1345 -0
- mt5_bridge_py-0.6.0/src/bin/mt5-bridge.rs +223 -0
- mt5_bridge_py-0.6.0/src/client/async_client.rs +106 -0
- mt5_bridge_py-0.6.0/src/client/client_impl/cache.rs +68 -0
- mt5_bridge_py-0.6.0/src/client/client_impl/client.rs +145 -0
- mt5_bridge_py-0.6.0/src/client/client_impl/connection.rs +163 -0
- mt5_bridge_py-0.6.0/src/client/client_impl/direct.rs +1716 -0
- mt5_bridge_py-0.6.0/src/client/client_impl/lifecycle.rs +43 -0
- mt5_bridge_py-0.6.0/src/client/client_impl/market.rs +288 -0
- mt5_bridge_py-0.6.0/src/client/client_impl/mod.rs +13 -0
- mt5_bridge_py-0.6.0/src/client/client_impl/queries.rs +135 -0
- mt5_bridge_py-0.6.0/src/client/client_impl/streaming.rs +177 -0
- mt5_bridge_py-0.6.0/src/client/client_impl/trading.rs +105 -0
- mt5_bridge_py-0.6.0/src/client/manager.rs +654 -0
- mt5_bridge_py-0.6.0/src/client/mod.rs +14 -0
- mt5_bridge_py-0.6.0/src/client/pipe.rs +34 -0
- mt5_bridge_py-0.6.0/src/client/tests.rs +50 -0
- mt5_bridge_py-0.6.0/src/constants.rs +65 -0
- mt5_bridge_py-0.6.0/src/error.rs +266 -0
- mt5_bridge_py-0.6.0/src/ffi.rs +543 -0
- mt5_bridge_py-0.6.0/src/gateway/actor.rs +1376 -0
- mt5_bridge_py-0.6.0/src/gateway/executor.rs +50 -0
- mt5_bridge_py-0.6.0/src/gateway/mod.rs +110 -0
- mt5_bridge_py-0.6.0/src/health.rs +415 -0
- mt5_bridge_py-0.6.0/src/journal.rs +284 -0
- mt5_bridge_py-0.6.0/src/lib.rs +158 -0
- mt5_bridge_py-0.6.0/src/market/bars.rs +537 -0
- mt5_bridge_py-0.6.0/src/market/book.rs +328 -0
- mt5_bridge_py-0.6.0/src/market/calendar.rs +341 -0
- mt5_bridge_py-0.6.0/src/market/mod.rs +26 -0
- mt5_bridge_py-0.6.0/src/market/symbols.rs +127 -0
- mt5_bridge_py-0.6.0/src/position_book.rs +824 -0
- mt5_bridge_py-0.6.0/src/prelude.rs +19 -0
- mt5_bridge_py-0.6.0/src/protocol/frame.rs +394 -0
- mt5_bridge_py-0.6.0/src/protocol/mod.rs +5 -0
- mt5_bridge_py-0.6.0/src/reconciliation/classification.rs +47 -0
- mt5_bridge_py-0.6.0/src/reconciliation/events.rs +80 -0
- mt5_bridge_py-0.6.0/src/reconciliation/manager.rs +1646 -0
- mt5_bridge_py-0.6.0/src/reconciliation/mod.rs +55 -0
- mt5_bridge_py-0.6.0/src/reconciliation/scheduler.rs +497 -0
- mt5_bridge_py-0.6.0/src/reconciliation/shared.rs +299 -0
- mt5_bridge_py-0.6.0/src/reconciliation/state.rs +135 -0
- mt5_bridge_py-0.6.0/src/retry.rs +268 -0
- mt5_bridge_py-0.6.0/src/risk/engine.rs +503 -0
- mt5_bridge_py-0.6.0/src/risk/limits.rs +42 -0
- mt5_bridge_py-0.6.0/src/risk/mod.rs +35 -0
- mt5_bridge_py-0.6.0/src/schema.rs +379 -0
- mt5_bridge_py-0.6.0/src/session.rs +364 -0
- mt5_bridge_py-0.6.0/src/stream.rs +1194 -0
- mt5_bridge_py-0.6.0/src/sync.rs +43 -0
- mt5_bridge_py-0.6.0/src/telemetry/mod.rs +197 -0
- mt5_bridge_py-0.6.0/src/telemetry/prometheus.rs +19 -0
- mt5_bridge_py-0.6.0/src/trade/bracket.rs +66 -0
- mt5_bridge_py-0.6.0/src/trade/manager.rs +336 -0
- mt5_bridge_py-0.6.0/src/trade/mod.rs +31 -0
- mt5_bridge_py-0.6.0/src/trade/trailing.rs +40 -0
- mt5_bridge_py-0.6.0/src/transport/connection.rs +815 -0
- mt5_bridge_py-0.6.0/src/transport/mod.rs +10 -0
- mt5_bridge_py-0.6.0/src/transport/named_pipe.rs +429 -0
- mt5_bridge_py-0.6.0/src/transport/runtime.rs +90 -0
- mt5_bridge_py-0.6.0/src/types/account.rs +47 -0
- mt5_bridge_py-0.6.0/src/types/bar.rs +97 -0
- mt5_bridge_py-0.6.0/src/types/deal.rs +96 -0
- mt5_bridge_py-0.6.0/src/types/history.rs +260 -0
- mt5_bridge_py-0.6.0/src/types/level.rs +23 -0
- mt5_bridge_py-0.6.0/src/types/mismatch.rs +35 -0
- mt5_bridge_py-0.6.0/src/types/mod.rs +53 -0
- mt5_bridge_py-0.6.0/src/types/order_enums.rs +78 -0
- mt5_bridge_py-0.6.0/src/types/order_request.rs +559 -0
- mt5_bridge_py-0.6.0/src/types/position.rs +77 -0
- mt5_bridge_py-0.6.0/src/types/price_ticks.rs +55 -0
- mt5_bridge_py-0.6.0/src/types/rate.rs +30 -0
- mt5_bridge_py-0.6.0/src/types/stats.rs +76 -0
- mt5_bridge_py-0.6.0/src/types/stream_mode.rs +11 -0
- mt5_bridge_py-0.6.0/src/types/symbol.rs +240 -0
- mt5_bridge_py-0.6.0/src/types/tests.rs +325 -0
- mt5_bridge_py-0.6.0/src/types/tick.rs +68 -0
- mt5_bridge_py-0.6.0/src/types/timeframe.rs +149 -0
- mt5_bridge_py-0.6.0/src/types/tracked_order.rs +430 -0
- mt5_bridge_py-0.6.0/src/types/trade_event.rs +221 -0
- mt5_bridge_py-0.6.0/src/types/trade_result.rs +102 -0
- mt5_bridge_py-0.6.0/src/types/trade_rule.rs +53 -0
- mt5_bridge_py-0.6.0/src/types/units.rs +341 -0
- mt5_bridge_py-0.6.0/src/types/wire_id.rs +91 -0
- mt5_bridge_py-0.6.0/src/types/working_order.rs +70 -0
- mt5_bridge_py-0.6.0/src/wal/format.rs +667 -0
- mt5_bridge_py-0.6.0/src/wal/migration.rs +75 -0
- mt5_bridge_py-0.6.0/src/wal/mod.rs +17 -0
- mt5_bridge_py-0.6.0/src/wal/store.rs +744 -0
- mt5_bridge_py-0.6.0/tests/audit.rs +103 -0
- mt5_bridge_py-0.6.0/tests/bridge_tests.rs +2157 -0
- mt5_bridge_py-0.6.0/tests/common/mod.rs +551 -0
- mt5_bridge_py-0.6.0/tests/dry_run_tests.rs +323 -0
- mt5_bridge_py-0.6.0/tests/failure_injection.rs +1853 -0
- mt5_bridge_py-0.6.0/tests/gateway_tests.rs +1307 -0
- mt5_bridge_py-0.6.0/tests/health_cli.rs +76 -0
- mt5_bridge_py-0.6.0/tests/live_integration.rs +424 -0
- mt5_bridge_py-0.6.0/tests/pipe_mb1_concurrency.rs +205 -0
- mt5_bridge_py-0.6.0/tests/position_book_tests.rs +481 -0
- mt5_bridge_py-0.6.0/tests/protocol_consistency.rs +296 -0
- mt5_bridge_py-0.6.0/tests/protocol_fuzzing.rs +303 -0
- mt5_bridge_py-0.6.0/tests/readme_doctests.rs +1 -0
- mt5_bridge_py-0.6.0/tests/retry_tests.rs +133 -0
- mt5_bridge_py-0.6.0/tests/sequence_streams.rs +198 -0
- mt5_bridge_py-0.6.0/tests/tick_arithmetic.rs +243 -0
- mt5_bridge_py-0.6.0/tests/trade_tests.rs +450 -0
- mt5_bridge_py-0.6.0/tests/wal_journal_tests.rs +293 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
rust-check:
|
|
14
|
+
name: Rust (Format, Clippy, Test, Doc)
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout repository
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Rust toolchain
|
|
21
|
+
uses: dtolnay/rust-toolchain@stable
|
|
22
|
+
with:
|
|
23
|
+
components: rustfmt, clippy
|
|
24
|
+
|
|
25
|
+
- name: Cache Cargo dependencies
|
|
26
|
+
uses: Swatinem/rust-cache@v2
|
|
27
|
+
|
|
28
|
+
- name: Check code formatting
|
|
29
|
+
run: cargo fmt --check
|
|
30
|
+
|
|
31
|
+
- name: Run Clippy linter
|
|
32
|
+
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
33
|
+
|
|
34
|
+
- name: Run test suite
|
|
35
|
+
run: cargo test --all-features --verbose
|
|
36
|
+
|
|
37
|
+
- name: Check documentation
|
|
38
|
+
run: cargo doc --all-features --no-deps
|
|
39
|
+
|
|
40
|
+
feature-matrix:
|
|
41
|
+
name: Feature Matrix (${{ matrix.features }})
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
strategy:
|
|
44
|
+
matrix:
|
|
45
|
+
features:
|
|
46
|
+
- "--no-default-features"
|
|
47
|
+
- "--no-default-features --features async"
|
|
48
|
+
- "--no-default-features --features serde_json"
|
|
49
|
+
- "--no-default-features --features wal"
|
|
50
|
+
- "--all-features"
|
|
51
|
+
steps:
|
|
52
|
+
- name: Checkout repository
|
|
53
|
+
uses: actions/checkout@v4
|
|
54
|
+
|
|
55
|
+
- name: Set up Rust toolchain
|
|
56
|
+
uses: dtolnay/rust-toolchain@stable
|
|
57
|
+
with:
|
|
58
|
+
components: clippy
|
|
59
|
+
|
|
60
|
+
- name: Cache Cargo dependencies
|
|
61
|
+
uses: Swatinem/rust-cache@v2
|
|
62
|
+
with:
|
|
63
|
+
key: ${{ matrix.features }}
|
|
64
|
+
|
|
65
|
+
- name: Check feature combination
|
|
66
|
+
run: cargo check ${{ matrix.features }}
|
|
67
|
+
|
|
68
|
+
- name: Clippy feature combination
|
|
69
|
+
run: cargo clippy ${{ matrix.features }} -- -D warnings
|
|
70
|
+
|
|
71
|
+
dependency-audit:
|
|
72
|
+
name: Dependency Audit (Deny & Audit)
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
steps:
|
|
75
|
+
- name: Checkout repository
|
|
76
|
+
uses: actions/checkout@v4
|
|
77
|
+
|
|
78
|
+
- name: Set up Rust toolchain
|
|
79
|
+
uses: dtolnay/rust-toolchain@stable
|
|
80
|
+
|
|
81
|
+
- name: Install cargo-deny and cargo-audit
|
|
82
|
+
run: cargo install cargo-deny cargo-audit --locked
|
|
83
|
+
|
|
84
|
+
- name: Run cargo deny check
|
|
85
|
+
run: cargo deny check
|
|
86
|
+
|
|
87
|
+
- name: Run cargo audit
|
|
88
|
+
run: cargo audit
|
|
89
|
+
|
|
90
|
+
coverage:
|
|
91
|
+
name: Code Coverage
|
|
92
|
+
runs-on: ubuntu-latest
|
|
93
|
+
steps:
|
|
94
|
+
- name: Checkout repository
|
|
95
|
+
uses: actions/checkout@v4
|
|
96
|
+
|
|
97
|
+
- name: Set up Rust toolchain
|
|
98
|
+
uses: dtolnay/rust-toolchain@stable
|
|
99
|
+
with:
|
|
100
|
+
components: llvm-tools-preview
|
|
101
|
+
|
|
102
|
+
- name: Install cargo-llvm-cov
|
|
103
|
+
run: cargo install cargo-llvm-cov --locked
|
|
104
|
+
|
|
105
|
+
- name: Generate code coverage
|
|
106
|
+
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
|
|
107
|
+
|
|
108
|
+
- name: Upload coverage artifact
|
|
109
|
+
uses: actions/upload-artifact@v4
|
|
110
|
+
with:
|
|
111
|
+
name: lcov.info
|
|
112
|
+
path: lcov.info
|
|
113
|
+
|
|
114
|
+
- name: Upload coverage to Codecov
|
|
115
|
+
uses: codecov/codecov-action@v4
|
|
116
|
+
continue-on-error: true
|
|
117
|
+
with:
|
|
118
|
+
files: lcov.info
|
|
119
|
+
|
|
120
|
+
msrv:
|
|
121
|
+
name: MSRV Check (1.81)
|
|
122
|
+
runs-on: ubuntu-latest
|
|
123
|
+
steps:
|
|
124
|
+
- name: Checkout repository
|
|
125
|
+
uses: actions/checkout@v4
|
|
126
|
+
|
|
127
|
+
- name: Set up Rust toolchain
|
|
128
|
+
uses: dtolnay/rust-toolchain@1.81.0
|
|
129
|
+
|
|
130
|
+
- name: Verify MSRV compilation
|
|
131
|
+
run: cargo check --all-features
|
|
132
|
+
|
|
133
|
+
fuzz:
|
|
134
|
+
name: Fuzz targets (cargo-fuzz)
|
|
135
|
+
runs-on: ubuntu-latest
|
|
136
|
+
steps:
|
|
137
|
+
- name: Checkout repository
|
|
138
|
+
uses: actions/checkout@v4
|
|
139
|
+
|
|
140
|
+
- name: Set up Rust toolchain (nightly)
|
|
141
|
+
uses: dtolnay/rust-toolchain@nightly
|
|
142
|
+
with:
|
|
143
|
+
components: rustfmt, clippy
|
|
144
|
+
|
|
145
|
+
- name: Cache Cargo dependencies
|
|
146
|
+
uses: Swatinem/rust-cache@v2
|
|
147
|
+
|
|
148
|
+
- name: Check fuzz formatting
|
|
149
|
+
run: cargo fmt --check
|
|
150
|
+
working-directory: fuzz
|
|
151
|
+
|
|
152
|
+
- name: Clippy fuzz crate
|
|
153
|
+
run: cargo clippy -- -D warnings
|
|
154
|
+
working-directory: fuzz
|
|
155
|
+
|
|
156
|
+
- name: Install cargo-fuzz
|
|
157
|
+
run: cargo install cargo-fuzz
|
|
158
|
+
|
|
159
|
+
- name: Build all fuzz targets
|
|
160
|
+
run: cargo fuzz build
|
|
161
|
+
|
|
162
|
+
python-package:
|
|
163
|
+
name: Python Package (Build & Import)
|
|
164
|
+
runs-on: windows-latest
|
|
165
|
+
steps:
|
|
166
|
+
- name: Checkout repository
|
|
167
|
+
uses: actions/checkout@v4
|
|
168
|
+
|
|
169
|
+
- name: Set up Rust toolchain
|
|
170
|
+
uses: dtolnay/rust-toolchain@stable
|
|
171
|
+
|
|
172
|
+
- name: Cache Cargo dependencies
|
|
173
|
+
uses: Swatinem/rust-cache@v2
|
|
174
|
+
|
|
175
|
+
- name: Set up Python
|
|
176
|
+
uses: actions/setup-python@v5
|
|
177
|
+
with:
|
|
178
|
+
python-version: "3.12"
|
|
179
|
+
|
|
180
|
+
- name: Install maturin and pytest
|
|
181
|
+
run: pip install maturin pytest
|
|
182
|
+
|
|
183
|
+
- name: Build wheel
|
|
184
|
+
run: maturin build --release --out dist
|
|
185
|
+
working-directory: crates/mt5-bridge-py
|
|
186
|
+
|
|
187
|
+
- name: Install wheel
|
|
188
|
+
shell: pwsh
|
|
189
|
+
run: Get-ChildItem crates/mt5-bridge-py/dist -Filter *.whl | ForEach-Object { pip install $_.FullName }
|
|
190
|
+
|
|
191
|
+
- name: Import smoke tests
|
|
192
|
+
run: pytest tests/test_import.py
|
|
193
|
+
working-directory: crates/mt5-bridge-py
|
|
194
|
+
|
|
195
|
+
windows-build:
|
|
196
|
+
name: Windows Native (Test)
|
|
197
|
+
runs-on: windows-latest
|
|
198
|
+
steps:
|
|
199
|
+
- name: Checkout repository
|
|
200
|
+
uses: actions/checkout@v4
|
|
201
|
+
|
|
202
|
+
- name: Set up Rust toolchain
|
|
203
|
+
uses: dtolnay/rust-toolchain@stable
|
|
204
|
+
|
|
205
|
+
- name: Cache Cargo dependencies
|
|
206
|
+
uses: Swatinem/rust-cache@v2
|
|
207
|
+
|
|
208
|
+
- name: Run test suite on Windows
|
|
209
|
+
run: cargo test --all-features
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
CARGO_TERM_COLOR: always
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
verify:
|
|
13
|
+
name: Verify Tag, Tests, and Versions
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Rust toolchain
|
|
20
|
+
uses: dtolnay/rust-toolchain@stable
|
|
21
|
+
|
|
22
|
+
- name: Cache Cargo dependencies
|
|
23
|
+
uses: Swatinem/rust-cache@v2
|
|
24
|
+
|
|
25
|
+
- name: Run Rust test suite
|
|
26
|
+
run: cargo test --all-features
|
|
27
|
+
|
|
28
|
+
- name: Check tag matches crate versions
|
|
29
|
+
shell: bash
|
|
30
|
+
run: |
|
|
31
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
32
|
+
crate=$(grep -m1 '^version = ' Cargo.toml | sed -E 's/.*"(.*)"/\1/')
|
|
33
|
+
py_crate=$(grep -m1 '^version = ' crates/mt5-bridge-py/Cargo.toml | sed -E 's/.*"(.*)"/\1/')
|
|
34
|
+
py_project=$(grep -m1 '^version = ' crates/mt5-bridge-py/pyproject.toml | sed -E 's/.*"(.*)"/\1/')
|
|
35
|
+
echo "tag=$tag crate=$crate py_crate=$py_crate py_project=$py_project"
|
|
36
|
+
test "$tag" = "$crate"
|
|
37
|
+
test "$tag" = "$py_crate"
|
|
38
|
+
test "$tag" = "$py_project"
|
|
39
|
+
|
|
40
|
+
build-wheels:
|
|
41
|
+
name: Build wheels on ${{ matrix.os }} (Python ${{ matrix.python-version }})
|
|
42
|
+
needs: verify
|
|
43
|
+
runs-on: ${{ matrix.os }}
|
|
44
|
+
strategy:
|
|
45
|
+
fail-fast: false
|
|
46
|
+
matrix:
|
|
47
|
+
os: [windows-latest]
|
|
48
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
49
|
+
steps:
|
|
50
|
+
- name: Checkout repository
|
|
51
|
+
uses: actions/checkout@v4
|
|
52
|
+
|
|
53
|
+
- name: Set up Rust toolchain
|
|
54
|
+
uses: dtolnay/rust-toolchain@stable
|
|
55
|
+
with:
|
|
56
|
+
components: rustfmt, clippy
|
|
57
|
+
|
|
58
|
+
- name: Cache Cargo dependencies
|
|
59
|
+
uses: Swatinem/rust-cache@v2
|
|
60
|
+
|
|
61
|
+
- name: Set up Python
|
|
62
|
+
uses: actions/setup-python@v5
|
|
63
|
+
with:
|
|
64
|
+
python-version: ${{ matrix.python-version }}
|
|
65
|
+
|
|
66
|
+
- name: Install maturin
|
|
67
|
+
run: pip install maturin
|
|
68
|
+
|
|
69
|
+
- name: Build wheels
|
|
70
|
+
run: maturin build --release --out dist
|
|
71
|
+
working-directory: crates/mt5-bridge-py
|
|
72
|
+
|
|
73
|
+
- name: Upload wheel artifact
|
|
74
|
+
uses: actions/upload-artifact@v4
|
|
75
|
+
with:
|
|
76
|
+
name: wheels-${{ matrix.python-version }}
|
|
77
|
+
path: crates/mt5-bridge-py/dist/*.whl
|
|
78
|
+
retention-days: 7
|
|
79
|
+
|
|
80
|
+
build-sdist:
|
|
81
|
+
name: Build source distribution
|
|
82
|
+
needs: verify
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
steps:
|
|
85
|
+
- name: Checkout repository
|
|
86
|
+
uses: actions/checkout@v4
|
|
87
|
+
|
|
88
|
+
- name: Set up Rust toolchain
|
|
89
|
+
uses: dtolnay/rust-toolchain@stable
|
|
90
|
+
|
|
91
|
+
- name: Set up Python
|
|
92
|
+
uses: actions/setup-python@v5
|
|
93
|
+
with:
|
|
94
|
+
python-version: "3.12"
|
|
95
|
+
|
|
96
|
+
- name: Install maturin
|
|
97
|
+
run: pip install maturin
|
|
98
|
+
|
|
99
|
+
- name: Build sdist
|
|
100
|
+
run: maturin sdist --out dist
|
|
101
|
+
working-directory: crates/mt5-bridge-py
|
|
102
|
+
|
|
103
|
+
- name: Upload sdist artifact
|
|
104
|
+
uses: actions/upload-artifact@v4
|
|
105
|
+
with:
|
|
106
|
+
name: sdist
|
|
107
|
+
path: crates/mt5-bridge-py/dist/*.tar.gz
|
|
108
|
+
retention-days: 7
|
|
109
|
+
|
|
110
|
+
publish:
|
|
111
|
+
name: Publish to PyPI
|
|
112
|
+
needs: [build-wheels, build-sdist]
|
|
113
|
+
runs-on: ubuntu-latest
|
|
114
|
+
environment:
|
|
115
|
+
name: pypi
|
|
116
|
+
url: https://pypi.org/p/mt5-bridge-py
|
|
117
|
+
permissions:
|
|
118
|
+
id-token: write # Required for trusted publishing
|
|
119
|
+
steps:
|
|
120
|
+
- name: Download all artifacts
|
|
121
|
+
uses: actions/download-artifact@v4
|
|
122
|
+
with:
|
|
123
|
+
path: dist
|
|
124
|
+
merge-multiple: true
|
|
125
|
+
|
|
126
|
+
- name: List artifacts
|
|
127
|
+
run: ls -la dist/
|
|
128
|
+
|
|
129
|
+
- name: Publish to PyPI (Trusted Publishing)
|
|
130
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
131
|
+
with:
|
|
132
|
+
print-hash: true
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Rust
|
|
2
|
+
/target/
|
|
3
|
+
/fuzz/target/
|
|
4
|
+
/crates/*/target/
|
|
5
|
+
**/*.rs.bk
|
|
6
|
+
lcov.info
|
|
7
|
+
mql5-compile.log
|
|
8
|
+
|
|
9
|
+
# MQL5 / Windows Build outputs
|
|
10
|
+
*.o
|
|
11
|
+
*.obj
|
|
12
|
+
*.exp
|
|
13
|
+
*.lib
|
|
14
|
+
*.ex5
|
|
15
|
+
|
|
16
|
+
# IDE & Editor files
|
|
17
|
+
.vscode/
|
|
18
|
+
.idea/
|
|
19
|
+
*.swp
|
|
20
|
+
*.swo
|
|
21
|
+
*~
|
|
22
|
+
.DS_Store
|
|
23
|
+
Thumbs.db
|
|
24
|
+
|
|
25
|
+
# Documentation
|
|
26
|
+
docs/*
|
|
27
|
+
!docs/protocol.md
|
|
28
|
+
!docs/migration.md
|
|
29
|
+
!docs/api-reference.md
|
|
30
|
+
!docs/architecture.md
|
|
31
|
+
!docs/benchmarks.md
|
|
32
|
+
!docs/examples.md
|
|
33
|
+
!docs/getting-started.md
|
|
34
|
+
!docs/multi-instance.md
|
|
35
|
+
!docs/python-api.md
|
|
36
|
+
!docs/streaming.md
|
|
37
|
+
!docs/troubleshooting.md
|
|
38
|
+
!docs/trading.md
|