Release v2.2.1: Validate pdf_path directory before importing optional reportlab/pypdf in compile_markdown_to_pdf and remove unused pdfplumber dependency
This commit is contained in:
1 parent
8ea64c11c1
commit
2a882853a9
39 files changed
+152
-149
No files matched your search
@@ -1,3 +1,3 @@
|
||||
"""hyperstitionstud_io — Shared Common Library for the hyperstitionstud.io workspace (v2.2.0)."""
|
||||
__version__ = "2.2.0"
|
||||
"""hyperstitionstud_io — Shared Common Library for the hyperstitionstud.io workspace (v2.2.1)."""
|
||||
__version__ = "2.2.1"
|
||||
NAMESPACE_URN = "urn:io:hyperstitionstud"
|
||||
@@ -35,8 +35,8 @@ from hyperstitionstud_io.mcp.tools import MCP_TOOLS_SCHEMA, call_mcp_tool # noq
|
||||
|
||||
SERVER_INFO = {
|
||||
"name": "hyperstitionstudio-mcp",
|
||||
"version": "2.2.0",
|
||||
"namespace_urn": "urn:io:hyperstitionstud:mcp:2.2.0",
|
||||
"version": "2.2.1",
|
||||
"namespace_urn": "urn:io:hyperstitionstud:mcp:2.2.1",
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -262,6 +262,11 @@ def compile_markdown_to_pdf(
|
||||
pdf_path: str | Path,
|
||||
title: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
md_p = Path(md_path).resolve()
|
||||
pdf_p = Path(pdf_path).resolve()
|
||||
pdf_p.parent.mkdir(parents=True, exist_ok=True)
|
||||
tmp_p = pdf_p.with_suffix(f".tmp.{os.getpid()}.pdf")
|
||||
|
||||
try:
|
||||
from pypdf import PdfReader
|
||||
from reportlab.lib import colors
|
||||
@@ -269,7 +274,7 @@ def compile_markdown_to_pdf(
|
||||
import subprocess
|
||||
import sys
|
||||
subprocess.run(
|
||||
[sys.executable, "-m", "pip", "install", "--break-system-packages", "--root-user-action=ignore", "-q", "reportlab", "pypdf"],
|
||||
[sys.executable, "-m", "pip", "install", "--break-system-packages", "--root-user-action=ignore", "--no-deps", "-q", "reportlab", "pypdf"],
|
||||
check=True,
|
||||
)
|
||||
from pypdf import PdfReader
|
||||
@@ -291,11 +296,6 @@ def compile_markdown_to_pdf(
|
||||
)
|
||||
from hyperstitionstud_io.publishing.fonts import resolve_font_path
|
||||
|
||||
md_p = Path(md_path).resolve()
|
||||
pdf_p = Path(pdf_path).resolve()
|
||||
pdf_p.parent.mkdir(parents=True, exist_ok=True)
|
||||
tmp_p = pdf_p.with_suffix(f".tmp.{os.getpid()}.pdf")
|
||||
|
||||
f_reg = resolve_font_path("DejaVuSans.ttf")
|
||||
f_bold = resolve_font_path("DejaVuSans-Bold.ttf")
|
||||
f_ob = resolve_font_path("DejaVuSans-Oblique.ttf", fallback_filename="DejaVuSans.ttf")
|
||||
|
||||
@@ -678,7 +678,7 @@ def build_financial_quant_harvest(
|
||||
payload: dict[str, Any] = {
|
||||
"$schema": "./schemas/v1/financial-aq-harvest.schema.json",
|
||||
"$id": "urn:io:hyperstitionstud:schema:v1:financial-aq-harvest",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"target_date_utc": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"),
|
||||
"harvest_mode": harvest_mode,
|
||||
"synthetic_data_eliminated": True,
|
||||
|
||||
Reference in new issue
Block a user