diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a786dc2..b04fef6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,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: | diff --git a/pyproject.toml b/pyproject.toml index 1bfc225..511947e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", ] [project.optional-dependencies] diff --git a/qsl.toml b/qsl.toml index 21fd900..1cba4fe 100644 --- a/qsl.toml +++ b/qsl.toml @@ -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", ] diff --git a/tests/test_qsl_compat_metadata.py b/tests/test_qsl_compat_metadata.py index 2da974a..5de9173 100644 --- a/tests/test_qsl_compat_metadata.py +++ b/tests/test_qsl_compat_metadata.py @@ -1,12 +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_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) + + assert QPK_URL in pyproject["project"]["dependencies"] + assert QPK_URL in qsl["compat"]["requires"] + + packages = {package["name"]: package for package in lock["package"]} + locked_qpk = packages["quant-platform-kit"] + locked_strategy = packages["hk-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 diff --git a/uv.lock b/uv.lock index b78afde..39ff3c2 100644 --- a/uv.lock +++ b/uv.lock @@ -40,7 +40,7 @@ test = [ requires-dist = [ { name = "pandas", specifier = ">=2.0" }, { name = "pytest", marker = "extra == 'test'", specifier = ">=8" }, - { name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=5d4bbd0e7ef9a1434010e8b6a69905d39ee55f1b" }, + { name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=2f75b59289ef24ab47a3ed8d522c9ef8d6aea6b2" }, ] provides-extras = ["test"] @@ -315,7 +315,7 @@ wheels = [ [[package]] name = "quant-platform-kit" version = "0.10.0" -source = { git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=5d4bbd0e7ef9a1434010e8b6a69905d39ee55f1b#5d4bbd0e7ef9a1434010e8b6a69905d39ee55f1b" } +source = { git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=2f75b59289ef24ab47a3ed8d522c9ef8d6aea6b2#2f75b59289ef24ab47a3ed8d522c9ef8d6aea6b2" } [[package]] name = "six"