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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Shared crypto strategy catalog and implementations"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@d786c1140967f0e96e35599d057f0655e5a9ba25",
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@6d3675914eb5d3fe072d3212a90dfb55fe1c1df4",
]

[tool.setuptools]
Expand Down
20 changes: 18 additions & 2 deletions tests/test_contract_governance.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import unittest
import tomllib
from pathlib import Path

from crypto_strategies import (
Expand All @@ -23,16 +24,19 @@

ALLOWED_TARGET_MODES = frozenset({"weight", "value"})
PLATFORM_NATIVE_TARGET_MODES = {BINANCE_PLATFORM: "weight"}
PROJECT_ROOT = Path(__file__).resolve().parents[1]
GOVERNED_SOURCE_ROOTS = (
Path(__file__).resolve().parents[1] / "src" / "crypto_strategies" / "strategies",
Path(__file__).resolve().parents[1] / "src" / "crypto_strategies" / "entrypoints",
PROJECT_ROOT / "src" / "crypto_strategies" / "strategies",
PROJECT_ROOT / "src" / "crypto_strategies" / "entrypoints",
)
BANNED_SOURCE_SNIPPETS = (
"os.getenv(",
"os.environ",
"binance",
"BINANCE_",
)
QPK_HEALTH_COMMIT = "6d3675914eb5d3fe072d3212a90dfb55fe1c1df4"
QPK_OLD_HEALTHLESS_COMMIT = "86f03fb8e83c0d372f4e1c64cccf3e6da50b8dd4"


class ContractGovernanceTests(unittest.TestCase):
Expand Down Expand Up @@ -127,6 +131,18 @@ def test_strategy_and_entrypoint_sources_do_not_branch_on_platform_or_env(self)
with self.subTest(path=str(path.relative_to(root.parent.parent)), snippet=snippet):
self.assertNotIn(snippet.lower(), text)

def test_qpk_dependency_includes_shared_health_module_release(self) -> None:
pyproject = tomllib.loads((PROJECT_ROOT / "pyproject.toml").read_text(encoding="utf-8"))
dependencies = pyproject["project"]["dependencies"]
qpk_dependencies = [dep for dep in dependencies if dep.startswith("quant-platform-kit @ ")]
expected_dependency = (
"quant-platform-kit @ "
f"git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@{QPK_HEALTH_COMMIT}"
)

self.assertEqual(qpk_dependencies, [expected_dependency])
self.assertNotIn(QPK_OLD_HEALTHLESS_COMMIT, qpk_dependencies[0])


if __name__ == "__main__":
unittest.main()
Loading