genblaze-replicate 0.3.0__tar.gz → 0.3.2__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.4
2
2
  Name: genblaze-replicate
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Replicate provider adapter for genblaze
5
5
  Project-URL: Homepage, https://github.com/backblaze-labs/genblaze
6
6
  Project-URL: Documentation, https://github.com/backblaze-labs/genblaze
@@ -18,7 +18,8 @@ Classifier: Topic :: Multimedia
18
18
  Classifier: Topic :: Software Development :: Libraries
19
19
  Classifier: Typing :: Typed
20
20
  Requires-Python: >=3.11
21
- Requires-Dist: genblaze-core<0.4,>=0.3.0
21
+ Requires-Dist: genblaze-core<0.4,>=0.3.4
22
+ Requires-Dist: httpx>=0.24
22
23
  Requires-Dist: replicate>=0.25
23
24
  Provides-Extra: dev
24
25
  Requires-Dist: pytest>=7.0; extra == 'dev'
@@ -279,7 +279,7 @@ class ReplicateProvider(BaseProvider):
279
279
  self._client = replicate.Client(timeout=timeout)
280
280
  except ImportError as exc:
281
281
  raise ProviderError(
282
- "replicate package not installed. Run: pip install replicate"
282
+ "replicate or httpx package not installed. Run: pip install replicate httpx"
283
283
  ) from exc
284
284
  return self._client
285
285
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "genblaze-replicate"
7
- version = "0.3.0"
7
+ version = "0.3.2"
8
8
  description = "Replicate provider adapter for genblaze"
9
9
  authors = [{name = "Jeronimo De Leon", email = "jdeleon@backblaze.com"}]
10
10
  readme = "README.md"
@@ -23,8 +23,9 @@ classifiers = [
23
23
  keywords = ["genblaze", "ai", "media", "manifest", "provenance", "c2pa-ready", "genai", "pipeline", "replicate", "video", "image"]
24
24
 
25
25
  dependencies = [
26
- "genblaze-core>=0.3.0,<0.4",
26
+ "genblaze-core>=0.3.4,<0.4",
27
27
  "replicate>=0.25",
28
+ "httpx>=0.24",
28
29
  ]
29
30
 
30
31
  [project.urls]
@@ -46,3 +47,8 @@ packages = ["genblaze_replicate"]
46
47
 
47
48
  [tool.pytest.ini_options]
48
49
  testpaths = ["tests"]
50
+
51
+ [tool.deptry]
52
+ # Treat the `dev` extra as dev-only tooling so deptry does not flag pytest
53
+ # (and other test-only deps) as unused declared deps (DEP002).
54
+ optional_dependencies_dev_groups = ["dev"]
@@ -525,6 +525,29 @@ def test_validate_model_user_registered_skips_probe():
525
525
  mock_client.models.get.assert_not_called()
526
526
 
527
527
 
528
+ def test_get_client_raises_when_dependency_missing():
529
+ """Missing replicate/httpx surfaces a clear ProviderError naming both.
530
+
531
+ `_get_client` imports httpx then replicate; either ImportError maps to the
532
+ same message. Only reachable when a dependency is absent, so skip when both
533
+ are installed (the branch is un-hittable without uninstalling one). Mirrors
534
+ nvidia's test_chat_raises_when_openai_missing.
535
+ """
536
+ import importlib
537
+
538
+ from genblaze_core.exceptions import ProviderError
539
+
540
+ if (
541
+ importlib.util.find_spec("httpx") is not None
542
+ and importlib.util.find_spec("replicate") is not None
543
+ ):
544
+ pytest.skip("httpx and replicate are installed — ImportError branch not reachable")
545
+
546
+ provider = ReplicateProvider(api_token="test-token")
547
+ with pytest.raises(ProviderError, match="replicate or httpx"):
548
+ provider._get_client()
549
+
550
+
528
551
  # --- Compliance harness ---
529
552
 
530
553