Skip to content

Commit 53e6e98

Browse files
committed
chore: pyodide test 0.9.10 + llms.txt + sitemap + uv.lock
1 parent 3794df1 commit 53e6e98

5 files changed

Lines changed: 271 additions & 179 deletions

File tree

‎landing/static/llms.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,9 @@ DART, EDGAR, 사업보고서 읽기, 재무 해석, 데이터 자동화에 관
144144
- [에코프로 — 시총 78조를 찍은 회사의 영업이익은 864억이었다](https://eddmpython.github.io/dartlab/blog/086520-ecopro) — 시총 78조, 창업주는 감옥, 매출 반토막, 매출원가율 102%. 2차전지 대장주 에코프로의 재무제표를 뜯어보면 — 시장이 산 건 숫자가 아니라 서사였다. | Markdown: https://eddmpython.github.io/dartlab/markdown/blog/086520-ecopro.md
145145
- [쿠팡 — 매출 49조인데 이익 $208M, 마진 0.6%의 비밀](https://eddmpython.github.io/dartlab/blog/CPNG-coupang) — 매출 49조 순이익 $208M. 마진 0.6%. 3,370만명 개인정보 유출. 자본잠식에서 흑자 전환. 현금 8조로 적자 사업에 1.4조씩. CCC -55일. 쿠팡의 재무제표를 dartlab EDGAR로 뜯어본다. | Markdown: https://eddmpython.github.io/dartlab/markdown/blog/CPNG-coupang.md
146146
- [현대자동차 — 매출 186조, 세계 3위인데 왜 BYD보다 싼가](https://eddmpython.github.io/dartlab/blog/005380-hyundai-motor) — 매출 186조 역대 최대인데 영업이익은 -19.5%. OPM 9.3%→6.2%. 관세 25%. 영업CF 마이너스. 하이브리드 +61%. 정의선 지분 7.6%로 97조 지배. 보스턴다이내믹스. 세계 3위가 BYD보다 싼 이유. | Markdown: https://eddmpython.github.io/dartlab/markdown/blog/005380-hyundai-motor.md
147+
- [Nike — 세계 1위가 매출 -10%, 주가 -55%, CEO가 버린 선반의 대가](https://eddmpython.github.io/dartlab/blog/NKE-nike) — 매출 $51B→$46B. 주가 $170→$44. 자사주 $11.8B 태웠는데 반토막. 직접판매 올인으로 도매 파트너 50%를 잘랐더니 빈 선반을 On/Hoka/NB가 차지했다. 32년 Nike맨이 돌아왔다. | Markdown: https://eddmpython.github.io/dartlab/markdown/blog/NKE-nike.md
148+
- [삼성전자 — 매출 334조, 반도체 빼면 영업이익률 7%](https://eddmpython.github.io/dartlab/blog/005930-samsung) — 매출 334조, 영업이익률 13%. 그런데 반도체를 빼면 7%. 파운드리 적자 7조가 메모리 이익을 까먹고, 현금 110조는 해외에 묶여 있고, 이재용 지분 1.63%로 500조를 지배한다. 삼성전자의 재무제표를 뜯어본다. | Markdown: https://eddmpython.github.io/dartlab/markdown/blog/005930-samsung.md
149+
- [Oklo — 매출 0원, 직원 120명, 시총 18조원의 원자력 유니콘](https://eddmpython.github.io/dartlab/blog/OKLO-oklo) — 매출 $0. 직원 120명. 시총 $13B. 계약 14GW, 가동 원자로 0기. Sam Altman이 SPAC으로 상장시킨 원자력 스타트업. NRC 인허가 거절 이력. 연료 공장도 없다. 그런데 Meta가 고객이다. | Markdown: https://eddmpython.github.io/dartlab/markdown/blog/OKLO-oklo.md
150+
- [기아 — 매출은 형의 60%인데 이익은 90%, 왜 동생이 더 잘 버는가](https://eddmpython.github.io/dartlab/blog/000270-kia) — 매출 114조, 형(현대차) 175조의 60%. 그런데 영업이익은 12.7조 vs 14.2조로 89%. 같은 플랫폼, 같은 연구소인데 영업이익률이 3.7%포인트 높다. 디자인 혁신, 판관비 4배 폭증, 순현금 12조, 시총 역전. | Markdown: https://eddmpython.github.io/dartlab/markdown/blog/000270-kia.md
147151
- [KR 경제분석 보고서 2026-04](https://eddmpython.github.io/dartlab/blog/04-kr) — dartlab macro 엔진 자동 발간. 11축 분석 + 3막 서사. | Markdown: https://eddmpython.github.io/dartlab/markdown/blog/04-kr.md
148152
- [US 경제분석 보고서 2026-04](https://eddmpython.github.io/dartlab/blog/04-us) — dartlab macro 엔진 자동 발간. 11축 분석 + 3막 서사. | Markdown: https://eddmpython.github.io/dartlab/markdown/blog/04-us.md

‎landing/static/sitemap.xml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,30 @@
831831
<priority>0.8</priority>
832832
<lastmod>2026-04-13</lastmod>
833833
</url>
834+
<url>
835+
<loc>https://eddmpython.github.io/dartlab/blog/NKE-nike</loc>
836+
<changefreq>monthly</changefreq>
837+
<priority>0.8</priority>
838+
<lastmod>2026-04-13</lastmod>
839+
</url>
840+
<url>
841+
<loc>https://eddmpython.github.io/dartlab/blog/005930-samsung</loc>
842+
<changefreq>monthly</changefreq>
843+
<priority>0.8</priority>
844+
<lastmod>2026-04-13</lastmod>
845+
</url>
846+
<url>
847+
<loc>https://eddmpython.github.io/dartlab/blog/OKLO-oklo</loc>
848+
<changefreq>monthly</changefreq>
849+
<priority>0.8</priority>
850+
<lastmod>2026-04-13</lastmod>
851+
</url>
852+
<url>
853+
<loc>https://eddmpython.github.io/dartlab/blog/000270-kia</loc>
854+
<changefreq>monthly</changefreq>
855+
<priority>0.8</priority>
856+
<lastmod>2026-04-13</lastmod>
857+
</url>
834858
<url>
835859
<loc>https://eddmpython.github.io/dartlab/blog/04-kr</loc>
836860
<changefreq>monthly</changefreq>

‎pyodide/build.py‎

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
"""dartlab pyodide wheel 빌드 + HF 업로드."""
1+
"""dartlab pyodide wheel 빌드 + HF 업로드.
22
3+
pyodide 전용 wheel: METADATA에서 Requires-Dist를 제거하여
4+
micropip.install(URL) 한 줄로 설치 가능하게 한다.
5+
PyPI wheel은 그대로 유지 (full deps).
6+
"""
7+
8+
import re
39
import subprocess
410
import sys
11+
import zipfile
12+
from io import BytesIO
513
from pathlib import Path
614

715
ROOT = Path(__file__).resolve().parent.parent
@@ -19,14 +27,77 @@ def build_wheel() -> Path:
1927
return wheels[-1]
2028

2129

30+
_PYODIDE_STRIP = {
31+
# server / AI / viz — pyodide 불필요
32+
"fastapi", "uvicorn", "sse-starlette", "sse_starlette",
33+
"mcp", "marimo", "qrcode", "plotly",
34+
"huggingface-hub", "huggingface_hub",
35+
"google-genai", "google_genai",
36+
"openai", "anthropic",
37+
}
38+
39+
# pyodide 빌트인이지만 버전 제약이 맞지 않는 패키지 → 버전 제거 후 유지
40+
_PYODIDE_RELAX_VERSION = {"lxml", "polars", "numpy"}
41+
42+
# pyodide 빌트인인데 원본 deps에 없는 패키지 → 추가
43+
_PYODIDE_ADD = ["pyarrow"]
44+
45+
46+
def strip_deps(wheel_path: Path) -> Path:
47+
"""wheel METADATA에서 pyodide 미지원 deps만 제거한 pyodide 전용 wheel 생성.
48+
49+
httpx, lxml, beautifulsoup4, rich, pydantic, numpy 등
50+
pyodide 빌트인으로 설치 가능한 deps는 유지한다.
51+
"""
52+
out_path = wheel_path.parent / wheel_path.name.replace(".whl", ".pyodide.whl")
53+
54+
with zipfile.ZipFile(wheel_path, "r") as src, zipfile.ZipFile(out_path, "w") as dst:
55+
for item in src.infolist():
56+
data = src.read(item.filename)
57+
58+
if item.filename.endswith("/METADATA"):
59+
text = data.decode("utf-8")
60+
lines = []
61+
strip_set = {s.lower().replace("-", "_") for s in _PYODIDE_STRIP}
62+
relax_set = {s.lower().replace("-", "_") for s in _PYODIDE_RELAX_VERSION}
63+
for line in text.splitlines():
64+
if line.startswith("Requires-Dist:"):
65+
raw = line.split(":")[1].strip()
66+
pkg = raw.split(";")[0].split(">")[0].split("<")[0].split("=")[0].split("[")[0].strip()
67+
pkg_norm = pkg.lower().replace("-", "_")
68+
if pkg_norm in strip_set:
69+
continue # pyodide 미지원 — 제거
70+
# 환경 마커 제거
71+
if "; sys_platform" in line:
72+
line = line.split(";")[0].strip()
73+
# 버전 제약 완화 (pyodide 빌트인 버전과 충돌 방지)
74+
if pkg_norm in relax_set:
75+
line = f"Requires-Dist: {pkg}"
76+
lines.append(line)
77+
# pyodide 전용 추가 deps
78+
for add_pkg in _PYODIDE_ADD:
79+
lines.append(f"Requires-Dist: {add_pkg}")
80+
data = ("\n".join(lines) + "\n").encode("utf-8")
81+
82+
if item.filename.endswith("/RECORD"):
83+
data = b""
84+
85+
dst.writestr(item, data)
86+
87+
print(f"pyodide wheel: {out_path.name} ({out_path.stat().st_size / 1024:.0f} KB)")
88+
return out_path
89+
90+
2291
def upload_to_hf(wheel_path: Path, token: str | None = None) -> str:
2392
"""wheel을 HF datasets에 업로드."""
2493
from huggingface_hub import HfApi
2594

2695
api = HfApi(token=token)
96+
# pyodide wheel은 원래 이름으로 업로드 (.pyodide 접미사 제거)
97+
repo_name = wheel_path.name.replace(".pyodide.whl", ".whl")
2798
url = api.upload_file(
2899
path_or_fileobj=str(wheel_path),
29-
path_in_repo=f"{HF_DIR}/{wheel_path.name}",
100+
path_in_repo=f"{HF_DIR}/{repo_name}",
30101
repo_id=HF_REPO,
31102
repo_type="dataset",
32103
)
@@ -43,13 +114,15 @@ def main():
43114
args = parser.parse_args()
44115

45116
whl = build_wheel()
46-
print(f"wheel: {whl} ({whl.stat().st_size / 1024:.0f} KB)")
117+
print(f"원본 wheel: {whl} ({whl.stat().st_size / 1024:.0f} KB)")
118+
119+
# deps 제거한 pyodide 전용 wheel
120+
pyodide_whl = strip_deps(whl)
47121

48-
# pyodide/ 폴더에도 복사 (로컬 테스트용)
49-
local_copy = Path(__file__).parent / whl.name
122+
# 로컬 복사
50123
import shutil
51-
shutil.copy2(whl, local_copy)
52-
print(f"로컬 복사: {local_copy}")
124+
local_copy = Path(__file__).parent / pyodide_whl.name
125+
shutil.copy2(pyodide_whl, local_copy)
53126

54127
if args.upload:
55128
import os
@@ -59,7 +132,7 @@ def main():
59132
if not token:
60133
print("⚠ HF_TOKEN 필요: --token 또는 환경변수", file=sys.stderr)
61134
sys.exit(1)
62-
upload_to_hf(whl, token)
135+
upload_to_hf(pyodide_whl, token)
63136

64137

65138
if __name__ == "__main__":

‎pyodide/test_node.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { loadPyodide } from "pyodide";
66

77
const HF = "https://huggingface.co/datasets/eddmpython/dartlab-data/resolve/main";
8-
const WHEEL_URL = `${HF}/pyodide/dartlab-0.9.10-py3-none-any.whl`;
8+
const WHEEL_URL = `${HF}/pyodide/dartlab-0.9.10-py3-none-any.whl?v=6`;
99
const STOCK = "005930";
1010

1111
const log = (msg) => console.log(msg);

0 commit comments

Comments
 (0)