castforge 0.1.2__tar.gz → 0.1.3__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.
Files changed (33) hide show
  1. {castforge-0.1.2 → castforge-0.1.3}/PKG-INFO +4 -3
  2. {castforge-0.1.2 → castforge-0.1.3}/README.md +2 -2
  3. {castforge-0.1.2 → castforge-0.1.3}/castforge/__init__.py +1 -1
  4. {castforge-0.1.2 → castforge-0.1.3}/castforge/publishers/r2.py +9 -2
  5. {castforge-0.1.2 → castforge-0.1.3}/castforge.egg-info/PKG-INFO +4 -3
  6. {castforge-0.1.2 → castforge-0.1.3}/castforge.egg-info/requires.txt +1 -0
  7. {castforge-0.1.2 → castforge-0.1.3}/pyproject.toml +2 -1
  8. {castforge-0.1.2 → castforge-0.1.3}/tests/test_r2.py +13 -1
  9. {castforge-0.1.2 → castforge-0.1.3}/LICENSE +0 -0
  10. {castforge-0.1.2 → castforge-0.1.3}/castforge/__main__.py +0 -0
  11. {castforge-0.1.2 → castforge-0.1.3}/castforge/audio.py +0 -0
  12. {castforge-0.1.2 → castforge-0.1.3}/castforge/briefing.py +0 -0
  13. {castforge-0.1.2 → castforge-0.1.3}/castforge/cli.py +0 -0
  14. {castforge-0.1.2 → castforge-0.1.3}/castforge/config.py +0 -0
  15. {castforge-0.1.2 → castforge-0.1.3}/castforge/contracts.py +0 -0
  16. {castforge-0.1.2 → castforge-0.1.3}/castforge/export.py +0 -0
  17. {castforge-0.1.2 → castforge-0.1.3}/castforge/models.py +0 -0
  18. {castforge-0.1.2 → castforge-0.1.3}/castforge/notebooklm_audio.py +0 -0
  19. {castforge-0.1.2 → castforge-0.1.3}/castforge/pipeline.py +0 -0
  20. {castforge-0.1.2 → castforge-0.1.3}/castforge/publishers/__init__.py +0 -0
  21. {castforge-0.1.2 → castforge-0.1.3}/castforge/rss.py +0 -0
  22. {castforge-0.1.2 → castforge-0.1.3}/castforge/runner.py +0 -0
  23. {castforge-0.1.2 → castforge-0.1.3}/castforge/scaffold.py +0 -0
  24. {castforge-0.1.2 → castforge-0.1.3}/castforge/validation.py +0 -0
  25. {castforge-0.1.2 → castforge-0.1.3}/castforge.egg-info/SOURCES.txt +0 -0
  26. {castforge-0.1.2 → castforge-0.1.3}/castforge.egg-info/dependency_links.txt +0 -0
  27. {castforge-0.1.2 → castforge-0.1.3}/castforge.egg-info/entry_points.txt +0 -0
  28. {castforge-0.1.2 → castforge-0.1.3}/castforge.egg-info/top_level.txt +0 -0
  29. {castforge-0.1.2 → castforge-0.1.3}/setup.cfg +0 -0
  30. {castforge-0.1.2 → castforge-0.1.3}/tests/test_cli.py +0 -0
  31. {castforge-0.1.2 → castforge-0.1.3}/tests/test_models.py +0 -0
  32. {castforge-0.1.2 → castforge-0.1.3}/tests/test_notebooklm_audio.py +0 -0
  33. {castforge-0.1.2 → castforge-0.1.3}/tests/test_runner.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: castforge
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Open-source framework for automated podcast pipelines
5
5
  Author: CastForge contributors
6
6
  License-Expression: MIT
@@ -20,6 +20,7 @@ Requires-Python: >=3.10
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
22
  Requires-Dist: anyio>=4
23
+ Requires-Dist: certifi>=2024.8
23
24
  Requires-Dist: python-dotenv>=1
24
25
  Requires-Dist: PyYAML>=6
25
26
  Provides-Extra: gemini
@@ -42,13 +43,13 @@ CastForge powers [Nitan Podcast](https://github.com/lifan-builds/nitan-podcast),
42
43
 
43
44
  ## Install
44
45
 
45
- CastForge `0.1.2` adds schema-v2 editorial metadata, minimum-story no-episode gating, measured MP3 duration, and a fail-closed NotebookLM short retry above a configured duration ceiling. Releases are published on [PyPI](https://pypi.org/project/castforge/) with trusted-publishing attestations:
46
+ CastForge `0.1.3` adds schema-v2 editorial metadata, minimum-story no-episode gating, measured MP3 duration, a fail-closed NotebookLM short retry above a configured duration ceiling, and portable CA validation for public audio. Releases are published on [PyPI](https://pypi.org/project/castforge/) with trusted-publishing attestations:
46
47
 
47
48
  ```bash
48
49
  pip install castforge==0.1.1
49
50
 
50
51
  # Optional production integrations
51
- pip install "castforge[notebooklm,r2]==0.1.2"
52
+ pip install "castforge[notebooklm,r2]==0.1.3"
52
53
  ```
53
54
 
54
55
  Python 3.10 or newer is supported. Gemini, NotebookLM, and R2 dependencies remain optional.
@@ -8,13 +8,13 @@ CastForge powers [Nitan Podcast](https://github.com/lifan-builds/nitan-podcast),
8
8
 
9
9
  ## Install
10
10
 
11
- CastForge `0.1.2` adds schema-v2 editorial metadata, minimum-story no-episode gating, measured MP3 duration, and a fail-closed NotebookLM short retry above a configured duration ceiling. Releases are published on [PyPI](https://pypi.org/project/castforge/) with trusted-publishing attestations:
11
+ CastForge `0.1.3` adds schema-v2 editorial metadata, minimum-story no-episode gating, measured MP3 duration, a fail-closed NotebookLM short retry above a configured duration ceiling, and portable CA validation for public audio. Releases are published on [PyPI](https://pypi.org/project/castforge/) with trusted-publishing attestations:
12
12
 
13
13
  ```bash
14
14
  pip install castforge==0.1.1
15
15
 
16
16
  # Optional production integrations
17
- pip install "castforge[notebooklm,r2]==0.1.2"
17
+ pip install "castforge[notebooklm,r2]==0.1.3"
18
18
  ```
19
19
 
20
20
  Python 3.10 or newer is supported. Gemini, NotebookLM, and R2 dependencies remain optional.
@@ -4,4 +4,4 @@ from castforge.models import EpisodeManifest, SourceItem, StoryCluster
4
4
 
5
5
  __all__ = ["EpisodeManifest", "SourceItem", "StoryCluster", "__version__"]
6
6
 
7
- __version__ = "0.1.2"
7
+ __version__ = "0.1.3"
@@ -3,20 +3,27 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import os
6
+ import ssl
6
7
  from pathlib import Path
7
8
  from typing import Any, Callable
8
9
  from urllib.request import Request, urlopen
9
10
 
11
+ import certifi
12
+
10
13
 
11
14
  def validate_public_audio(
12
15
  url: str,
13
16
  *,
14
17
  expected_length: int | None = None,
15
- opener: Callable[..., Any] = urlopen,
18
+ opener: Callable[..., Any] | None = None,
16
19
  timeout: float = 60,
17
20
  ) -> None:
18
21
  request = Request(url, method="HEAD", headers={"User-Agent": "CastForge/0.1"})
19
- with opener(request, timeout=timeout) as response:
22
+ effective_opener = opener or urlopen
23
+ kwargs: dict[str, Any] = {"timeout": timeout}
24
+ if opener is None:
25
+ kwargs["context"] = ssl.create_default_context(cafile=certifi.where())
26
+ with effective_opener(request, **kwargs) as response:
20
27
  status = getattr(response, "status", response.getcode())
21
28
  content_type = response.headers.get("Content-Type", "").split(";", 1)[0].lower()
22
29
  content_length = int(response.headers.get("Content-Length", "0") or 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: castforge
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Open-source framework for automated podcast pipelines
5
5
  Author: CastForge contributors
6
6
  License-Expression: MIT
@@ -20,6 +20,7 @@ Requires-Python: >=3.10
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
22
  Requires-Dist: anyio>=4
23
+ Requires-Dist: certifi>=2024.8
23
24
  Requires-Dist: python-dotenv>=1
24
25
  Requires-Dist: PyYAML>=6
25
26
  Provides-Extra: gemini
@@ -42,13 +43,13 @@ CastForge powers [Nitan Podcast](https://github.com/lifan-builds/nitan-podcast),
42
43
 
43
44
  ## Install
44
45
 
45
- CastForge `0.1.2` adds schema-v2 editorial metadata, minimum-story no-episode gating, measured MP3 duration, and a fail-closed NotebookLM short retry above a configured duration ceiling. Releases are published on [PyPI](https://pypi.org/project/castforge/) with trusted-publishing attestations:
46
+ CastForge `0.1.3` adds schema-v2 editorial metadata, minimum-story no-episode gating, measured MP3 duration, a fail-closed NotebookLM short retry above a configured duration ceiling, and portable CA validation for public audio. Releases are published on [PyPI](https://pypi.org/project/castforge/) with trusted-publishing attestations:
46
47
 
47
48
  ```bash
48
49
  pip install castforge==0.1.1
49
50
 
50
51
  # Optional production integrations
51
- pip install "castforge[notebooklm,r2]==0.1.2"
52
+ pip install "castforge[notebooklm,r2]==0.1.3"
52
53
  ```
53
54
 
54
55
  Python 3.10 or newer is supported. Gemini, NotebookLM, and R2 dependencies remain optional.
@@ -1,4 +1,5 @@
1
1
  anyio>=4
2
+ certifi>=2024.8
2
3
  python-dotenv>=1
3
4
  PyYAML>=6
4
5
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "castforge"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "Open-source framework for automated podcast pipelines"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -18,6 +18,7 @@ classifiers = [
18
18
  ]
19
19
  dependencies = [
20
20
  "anyio>=4",
21
+ "certifi>=2024.8",
21
22
  "python-dotenv>=1",
22
23
  "PyYAML>=6",
23
24
  ]
@@ -4,7 +4,7 @@ from email.message import Message
4
4
 
5
5
  import pytest
6
6
 
7
- from castforge.publishers.r2 import R2Publisher
7
+ from castforge.publishers.r2 import R2Publisher, validate_public_audio
8
8
 
9
9
 
10
10
  class FakeClient:
@@ -64,6 +64,18 @@ def test_r2_upload_sets_mime_and_validates_public_object(tmp_path) -> None:
64
64
  assert client.calls[0]["body"] == b"mp3-data"
65
65
 
66
66
 
67
+ def test_default_public_validation_uses_packaged_ca_bundle(monkeypatch) -> None:
68
+ captured = {}
69
+
70
+ def open_public(request, **kwargs):
71
+ captured.update(kwargs)
72
+ return FakeResponse(content_type="audio/mpeg", content_length=8)
73
+
74
+ monkeypatch.setattr("castforge.publishers.r2.urlopen", open_public)
75
+ validate_public_audio("https://audio.example/episode.mp3", expected_length=8)
76
+ assert captured["context"].verify_mode.name == "CERT_REQUIRED"
77
+
78
+
67
79
  def test_r2_rejects_wrong_public_mime(tmp_path) -> None:
68
80
  audio = tmp_path / "episode.mp3"
69
81
  audio.write_bytes(b"mp3-data")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes