Skip to content

Commit c926e36

Browse files
committed
feat: build version stamping for generated outputs and artifacts
1 parent 9c431b9 commit c926e36

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: install lint format test run scale-workers typecheck mutation-test threshold-sweep anonymization-check check-env check-schema-compatibility check-review-gates ops-check ops-validate static-analysis benchmark verify-lockfile regenerate-lockfile partition-write partition-read retention-scan snapshot-freeze snapshot-list snapshot-verify run-compare run-compare-all check-cycles probe-deps probe-deps-json validate-readme validate-readme-warn validate-notebooks validate-notebooks-strict validate-notebooks-ci validate-all check-integrity dead-path-report env-docs env-docs-check
1+
.PHONY: install lint format test run scale-workers typecheck mutation-test threshold-sweep anonymization-check check-env check-schema-compatibility check-review-gates ops-check ops-validate static-analysis benchmark verify-lockfile regenerate-lockfile partition-write partition-read retention-scan snapshot-freeze snapshot-list snapshot-verify run-compare run-compare-all check-cycles probe-deps probe-deps-json validate-readme validate-readme-warn validate-notebooks validate-notebooks-strict validate-notebooks-ci validate-all check-integrity dead-path-report env-docs env-docs-check migrate migrate-status migrate-dry-run new-migration onboard onboard-fix onboard-json
22
.ONESHELL:
33

44
VENV_BIN := $(abspath .venv/bin)

data/reproducibility.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,16 @@ def __init__(
223223

224224
if ledgerlens_version is None:
225225
try:
226-
from config import config # type: ignore
226+
from utils.version_stamp import get_version
227227

228-
ledgerlens_version = getattr(config, "LEDGERLENS_VERSION", "unknown")
228+
ledgerlens_version = get_version()
229229
except Exception:
230-
ledgerlens_version = "unknown"
230+
try:
231+
from config import config # type: ignore
232+
233+
ledgerlens_version = getattr(config, "LEDGERLENS_VERSION", "unknown")
234+
except Exception:
235+
ledgerlens_version = "unknown"
231236
self.ledgerlens_version = ledgerlens_version
232237

233238
self._signing_key = None

detection/model_training.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
compute_feature_contract_hash,
4747
)
4848
from utils.logging import get_logger
49+
from utils.version_stamp import get_version as _get_ledgerlens_version
4950

5051
logger = get_logger(__name__)
5152

@@ -971,7 +972,7 @@ def save_training_artifacts(
971972
),
972973
"model_names": list(results.keys()),
973974
"python_version": sys.version.split()[0],
974-
"ledgerlens_version": "0.2.0",
975+
"ledgerlens_version": _get_ledgerlens_version(),
975976
"feature_distributions": feature_distributions,
976977
}
977978

0 commit comments

Comments
 (0)