fix(makefile): extract inline Python to script to fix parse error
The multi-line python3 -c heredoc in the Makefile caused "missing separator" errors since Make runs each recipe line in a separate shell. Moved to web/scripts/init_landing_seeds.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
14
Makefile
14
Makefile
@@ -8,19 +8,7 @@ bin/tailwindcss:
|
|||||||
# Create seed files for SQLMesh staging models that require at least one landing file.
|
# Create seed files for SQLMesh staging models that require at least one landing file.
|
||||||
# Run once after a fresh clone (data/ is gitignored so seeds are not in git).
|
# Run once after a fresh clone (data/ is gitignored so seeds are not in git).
|
||||||
init-landing-seeds:
|
init-landing-seeds:
|
||||||
@python3 -c "
|
@python3 web/scripts/init_landing_seeds.py
|
||||||
import gzip, json, os, pathlib
|
|
||||||
seed = {'date':'1970-01-01','captured_at_utc':'1970-01-01T00:00:00Z','venue_count':0,'venues_errored':0,'venues':[]}
|
|
||||||
morning = pathlib.Path('data/landing/playtomic/1970/01/availability_1970-01-01.json.gz')
|
|
||||||
recheck = pathlib.Path('data/landing/playtomic/1970/01/availability_1970-01-01_recheck_00.json.gz')
|
|
||||||
morning.parent.mkdir(parents=True, exist_ok=True)
|
|
||||||
for p in [morning, recheck]:
|
|
||||||
if not p.exists():
|
|
||||||
with gzip.open(p, 'wt') as f: json.dump(seed, f)
|
|
||||||
print('created', p)
|
|
||||||
else:
|
|
||||||
print('exists ', p)
|
|
||||||
"
|
|
||||||
|
|
||||||
css-build: bin/tailwindcss
|
css-build: bin/tailwindcss
|
||||||
$(TAILWIND) -i web/src/padelnomics/static/css/input.css -o web/src/padelnomics/static/css/output.css --minify
|
$(TAILWIND) -i web/src/padelnomics/static/css/input.css -o web/src/padelnomics/static/css/output.css --minify
|
||||||
|
|||||||
22
web/scripts/init_landing_seeds.py
Normal file
22
web/scripts/init_landing_seeds.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
"""Create minimal seed files for SQLMesh staging models that require landing data."""
|
||||||
|
import gzip
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
seed = {
|
||||||
|
"date": "1970-01-01",
|
||||||
|
"captured_at_utc": "1970-01-01T00:00:00Z",
|
||||||
|
"venue_count": 0,
|
||||||
|
"venues_errored": 0,
|
||||||
|
"venues": [],
|
||||||
|
}
|
||||||
|
morning = Path("data/landing/playtomic/1970/01/availability_1970-01-01.json.gz")
|
||||||
|
recheck = Path("data/landing/playtomic/1970/01/availability_1970-01-01_recheck_00.json.gz")
|
||||||
|
morning.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
for p in [morning, recheck]:
|
||||||
|
if not p.exists():
|
||||||
|
with gzip.open(p, "wt") as f:
|
||||||
|
json.dump(seed, f)
|
||||||
|
print("created", p)
|
||||||
|
else:
|
||||||
|
print("exists ", p)
|
||||||
Reference in New Issue
Block a user