ssb-pubmd 0.1.3__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ssb-pubmd
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: SSB Pubmd
5
5
  License: MIT
6
6
  Author: Olav Landsverk
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Requires-Dist: dapla-auth-client (>=1.2.5,<2.0.0)
17
- Requires-Dist: ipynbname (>=2025.8.0.0,<2026.0.0.0)
17
+ Requires-Dist: jinja2 (>=3.1.6,<4.0.0)
18
18
  Requires-Dist: narwhals (>=2.15.0,<3.0.0)
19
19
  Requires-Dist: nh3 (>=0.3.2,<0.4.0)
20
20
  Requires-Dist: pandocfilters (>=1.5.1,<2.0.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ssb-pubmd"
3
- version = "0.1.3"
3
+ version = "0.1.5"
4
4
  description = "SSB Pubmd"
5
5
  authors = ["Olav Landsverk <stud-oll@ssb.no>"]
6
6
  license = "MIT"
@@ -20,10 +20,10 @@ python = "^3.10"
20
20
  requests = "^2.32.4"
21
21
  nh3 = "^0.3.2"
22
22
  pandocfilters = "^1.5.1"
23
- ipynbname = "^2025.8.0.0"
24
23
  narwhals = "^2.15.0"
25
24
  watchfiles = "^1.1.1"
26
25
  dapla-auth-client = "^1.2.5"
26
+ jinja2 = "^3.1.6"
27
27
 
28
28
  [tool.poetry.group.dev.dependencies]
29
29
  pygments = ">=2.10.0"
@@ -22,12 +22,15 @@ class RequestsHttpClient:
22
22
  def post(
23
23
  self, url: str, headers: dict[str, str], payload: dict[str, Any]
24
24
  ) -> dict[str, str]:
25
- response = requests.post(
26
- url,
27
- headers=headers,
28
- json=payload,
29
- )
30
- body = response.json()
25
+ try:
26
+ response = requests.post(
27
+ url,
28
+ headers=headers,
29
+ json=payload,
30
+ )
31
+ body = response.json()
32
+ except Exception as err:
33
+ raise PublishClientError("Sync failed. Could not parse response.") from err
31
34
  if not response.ok:
32
35
  raise PublishClientError(
33
36
  f"Sync failed. Response message: {body.get('msg', 'no message')}"
@@ -83,20 +83,24 @@ def _sync_quarto_file(file_path: str, publish_client: PublishClient) -> str:
83
83
 
84
84
 
85
85
  def _quarto_to_pandoc(file_path: str) -> str:
86
- result = subprocess.run(
87
- [
88
- "quarto",
89
- "render",
90
- file_path,
91
- "--to",
92
- "json",
93
- "-M",
94
- "include:false",
95
- "--output",
96
- "-",
97
- ],
98
- text=True,
99
- capture_output=True,
100
- check=True,
101
- )
102
- return result.stdout
86
+ try:
87
+ result = subprocess.run(
88
+ [
89
+ "quarto",
90
+ "render",
91
+ file_path,
92
+ "--to",
93
+ "json",
94
+ "-M",
95
+ "include:false",
96
+ "--output",
97
+ "-",
98
+ ],
99
+ text=True,
100
+ capture_output=True,
101
+ check=True,
102
+ )
103
+ return result.stdout
104
+ except subprocess.CalledProcessError as err:
105
+ message = err.stderr.strip() or "Quarto failed with no error output"
106
+ raise RuntimeError(f"Quarto render failed:\n{message}") from err
File without changes
File without changes
File without changes
File without changes