Skip to content

Commit 1ac6aca

Browse files
committed
Sync central dependency constraints
1 parent 3b17fac commit 1ac6aca

2 files changed

Lines changed: 41 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,44 @@ jobs:
2727
python -m pip install --upgrade pip
2828
python -m pip install -e . numpy pandas pytest pytest-cov ruff
2929
30+
- name: Validate dependency constraint refs
31+
run: |
32+
set -euo pipefail
33+
python - <<'PY'
34+
import re
35+
import subprocess
36+
import tempfile
37+
from pathlib import Path
38+
39+
pattern = re.compile(
40+
r"^(?P<package>[A-Za-z0-9_.-]+)\s+@\s+git\+(?P<url>https://github\.com/QuantStrategyLab/[^@]+\.git)@(?P<ref>[A-Za-z0-9_.-]+)\s*$"
41+
)
42+
failures = []
43+
for line in Path("constraints.txt").read_text(encoding="utf-8").splitlines():
44+
stripped = line.strip()
45+
if not stripped or stripped.startswith("#"):
46+
continue
47+
match = pattern.match(stripped)
48+
if not match:
49+
continue
50+
package = match.group("package")
51+
url = match.group("url")
52+
ref = match.group("ref")
53+
with tempfile.TemporaryDirectory() as tmp:
54+
subprocess.run(["git", "init", "-q", tmp], check=True)
55+
result = subprocess.run(
56+
["git", "-C", tmp, "fetch", "--depth=1", "--quiet", url, ref],
57+
text=True,
58+
stdout=subprocess.PIPE,
59+
stderr=subprocess.PIPE,
60+
)
61+
if result.returncode:
62+
failures.append(f"{package}: cannot fetch {url}@{ref}: {result.stderr.strip()}")
63+
if failures:
64+
raise SystemExit("\n".join(failures))
65+
print("constraint refs OK")
66+
PY
67+
3068
- name: Run Ruff
3169
run: |
3270
set -euo pipefail

constraints.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# QSL Dependency Constraints — SINGLE SOURCE OF TRUTH
22
# Auto-updated by update-qpk-pin.yml on every push to QPK main.
33

4-
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@cfcbbcd51be902877eb760bc55b2612351a31e90
5-
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@1e8b6ee28cdba8a9637276cf8619cd8890fa6861
6-
hk-equity-strategies @ git+https://github.com/QuantStrategyLab/HkEquityStrategies.git@1a5c8bf5f05eb708a0893f0062c6824aa9ef1882
4+
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@d786c1140967f0e96e35599d057f0655e5a9ba25
5+
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@c8df5f9659340965bd7f53998892ed1018ed4254
6+
hk-equity-strategies @ git+https://github.com/QuantStrategyLab/HkEquityStrategies.git@700c8b19c46336d3d8fcba687e58553afcf0235f
77
cn-equity-strategies @ git+https://github.com/QuantStrategyLab/CnEquityStrategies.git@2e5a8da3af5fa25c1a5e7de6fa00bda488f50440
88
crypto-strategies @ git+https://github.com/QuantStrategyLab/CryptoStrategies.git@6e0037b625c98ccdb97f225b9772e3c6fff4afd2

0 commit comments

Comments
 (0)