Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ jobs:
set -euo pipefail
python -m pip install --upgrade pip
python -m pip install -e . pandas pytest pytest-cov ruff==0.15.22 build
python -m pip install --no-deps -e external/QuantPlatformKit

- name: Verify dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"pandas>=2.0",
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@5d4bbd0e7ef9a1434010e8b6a69905d39ee55f1b",
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@2f75b59289ef24ab47a3ed8d522c9ef8d6aea6b2",
Comment thread
Pigbibi marked this conversation as resolved.
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion qsl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ upgrade_ring = "ring_b"
bundle = "2026.07.4"
requires = [
"pandas>=2.0",
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@5d4bbd0e7ef9a1434010e8b6a69905d39ee55f1b",
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@2f75b59289ef24ab47a3ed8d522c9ef8d6aea6b2",
]
55 changes: 39 additions & 16 deletions tests/test_qsl_compat_metadata.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,53 @@
from pathlib import Path
import tomllib
from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]
QPK_REVISION = "2f75b59289ef24ab47a3ed8d522c9ef8d6aea6b2"
QPK_URL = (
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/"
f"QuantPlatformKit.git@{QPK_REVISION}"
)


def test_qsl_compat_metadata_exists_and_bundle() -> None:
qsl_path = Path(__file__).resolve().parents[1] / "qsl.toml"
qsl_path = ROOT / "qsl.toml"
assert qsl_path.exists(), "qsl.toml missing"
with qsl_path.open("rb") as f:
data = tomllib.load(f)

assert data.get("compat", {}).get("bundle") == "2026.07.4", "compat.bundle mismatch"


def test_qsl_qpk_pin_matches_project_dependency() -> None:
root = Path(__file__).resolve().parents[1]
with (root / "qsl.toml").open("rb") as f:
qsl = tomllib.load(f)
with (root / "pyproject.toml").open("rb") as f:
project = tomllib.load(f)
def test_qpk_pin_lock_and_ci_are_dependency_enabled() -> None:
with (ROOT / "pyproject.toml").open("rb") as file:
pyproject = tomllib.load(file)
with (ROOT / "qsl.toml").open("rb") as file:
qsl = tomllib.load(file)
with (ROOT / "uv.lock").open("rb") as file:
lock = tomllib.load(file)

dependency = next(
value for value in project["project"]["dependencies"] if value.startswith("quant-platform-kit @ ")
)
qpk_pin = dependency.rsplit("@", maxsplit=1)[1]
assert QPK_URL in pyproject["project"]["dependencies"]
assert QPK_URL in qsl["compat"]["requires"]

assert dependency in qsl["compat"]["requires"]
assert (
f"QuantPlatformKit.git?rev={qpk_pin}#{qpk_pin}"
in (root / "uv.lock").read_text(encoding="utf-8")
packages = {package["name"]: package for package in lock["package"]}
locked_qpk = packages["quant-platform-kit"]
locked_strategy = packages["cn-equity-strategies"]
assert locked_qpk["source"]["git"] == (
"https://github.com/QuantStrategyLab/QuantPlatformKit.git"
f"?rev={QPK_REVISION}#{QPK_REVISION}"
)
locked_requirement = next(
dependency
for dependency in locked_strategy["metadata"]["requires-dist"]
if dependency["name"] == "quant-platform-kit"
)
assert locked_requirement["git"] == (
"https://github.com/QuantStrategyLab/QuantPlatformKit.git"
f"?rev={QPK_REVISION}"
)

ci = (ROOT / ".github/workflows/ci.yml").read_text(encoding="utf-8")
assert "--no-deps" not in ci
assert "python -m pip install -e ." in ci
assert "python -m pip check" in ci
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading