fix: make council source checksum reproducible across platforms

This commit is contained in:
codex committed 2026-10-08 14:52:12 +03:00
1 parent 74f32a3e67
commit 76bcb0db35
10 files changed
+43 -13

No files matched your search

+2 -1
View File
@@ -1,7 +1,8 @@
{
"schema_version": 1,
"source_file": "council_articles.csv",
"source_sha256": "7729d06503de8197c25e61f6e653a342390f274f31fd6bed43496c4cc21b8177",
"source_sha256": "f9e6126efcb144042e89bcce284deb3e5b26dd76b1be0741962626d2b140c043",
"source_hash_eol": "LF",
"source_rows": 1797,
"publications": [
{
+4 -2
View File
@@ -41,7 +41,9 @@ def _journal_names(data: dict) -> list[str]:
def prepare_reference(source: Path) -> dict:
publications = []
by_author = defaultdict(list)
source_bytes = source.read_bytes()
# Git stores this text export with LF; canonicalize Windows CRLF before
# parsing and hashing so the prepared artifact is identical on both hosts.
source_bytes = source.read_bytes().replace(b"\r\n", b"\n")
with StringIO(source_bytes.decode("utf-8-sig"), newline="") as stream:
reader = csv.DictReader(stream, delimiter=";")
required = {"Название публикации", "Год", "DOI", "Авторы НИУ ВШЭ", "Квартиль scopus", "Квартиль wos"}
@@ -65,7 +67,7 @@ def prepare_reference(source: Path) -> dict:
for author in sorted({_name(value) for value in authors} - {""}):
by_author[author].append(index)
return {"schema_version": 1, "source_file": source.name,
"source_sha256": hashlib.sha256(source_bytes).hexdigest(),
"source_sha256": hashlib.sha256(source_bytes).hexdigest(), "source_hash_eol": "LF",
"source_rows": len(publications), "publications": publications, "by_author": dict(by_author)}
+3 -3
View File
@@ -1,3 +1,3 @@
APP_VERSION = "0.15.2"
FRONTEND_VERSION = "0.15.2"
BACKEND_VERSION = "0.15.2"
APP_VERSION = "0.15.3"
FRONTEND_VERSION = "0.15.3"
BACKEND_VERSION = "0.15.3"