Skip to content

Commit f4bb051

Browse files
committed
ci: add ruff to shared package validation
1 parent 27fafdd commit f4bb051

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ jobs:
2121
run: |
2222
set -euo pipefail
2323
python -m pip install --upgrade pip
24-
python -m pip install -e . numpy pandas
24+
python -m pip install -e . numpy pandas ruff
25+
26+
- name: Run Ruff
27+
run: |
28+
set -euo pipefail
29+
ruff check .
2530
2631
- name: Run unit tests
2732
run: |

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ package-dir = { "" = "src" }
1919

2020
[tool.setuptools.packages.find]
2121
where = ["src"]
22+
23+
[tool.ruff]
24+
target-version = "py39"

src/quant_platform_kit/longbridge/portfolio.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from typing import Any, Iterable
44

5+
from .market_data import fetch_last_price
6+
57

68
def fetch_strategy_account_state(
79
q_ctx: Any,
@@ -46,6 +48,3 @@ def fetch_strategy_account_state(
4648
"sellable_quantities": sellable_quantities,
4749
"total_strategy_equity": available_cash + sum(market_values.values()),
4850
}
49-
50-
51-
from .market_data import fetch_last_price

0 commit comments

Comments
 (0)