weave-haystack 0.0.1__tar.gz → 1.0.0__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 (18) hide show
  1. weave_haystack-1.0.0/CHANGELOG.md +9 -0
  2. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/PKG-INFO +1 -1
  3. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/example/hybrid_retrieval.py +1 -3
  4. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/pydoc/config.yml +1 -1
  5. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/pyproject.toml +26 -32
  6. weave_haystack-1.0.0/src/haystack_integrations/components/connectors/py.typed +0 -0
  7. weave_haystack-1.0.0/src/haystack_integrations/tracing/py.typed +0 -0
  8. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/src/haystack_integrations/tracing/weave/tracer.py +7 -2
  9. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/tests/test_tracer.py +0 -1
  10. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/tests/test_weave_connector.py +3 -3
  11. weave_haystack-0.0.1/CHANGELOG.md +0 -20
  12. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/.gitignore +0 -0
  13. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/LICENSE.txt +0 -0
  14. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/README.md +0 -0
  15. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/example/README.md +0 -0
  16. {weave_haystack-0.0.1/src/haystack_integrations/components/connectors → weave_haystack-1.0.0/src/haystack_integrations/components/connectors/weave}/__init__.py +0 -0
  17. {weave_haystack-0.0.1/src/haystack_integrations/components/connectors → weave_haystack-1.0.0/src/haystack_integrations/components/connectors/weave}/weave_connector.py +1 -1
  18. {weave_haystack-0.0.1 → weave_haystack-1.0.0}/src/haystack_integrations/tracing/weave/__init__.py +0 -0
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## [integrations/weights_and_biases_weave-v0.0.1] - 2025-03-28
4
+
5
+ ### 🚜 Refactor
6
+
7
+ - Renaming the project/package to weights_biases_weave (#1565)
8
+
9
+ <!-- generated by git-cliff -->
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weave-haystack
3
- Version: 0.0.1
3
+ Version: 1.0.0
4
4
  Summary: An integration of Weights & Biases Weave tracer with Haystack
5
5
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations
6
6
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/weights_and_biases_weave/README.md
@@ -5,11 +5,10 @@ from haystack.components.rankers import TransformersSimilarityRanker
5
5
  from haystack.components.retrievers.in_memory import InMemoryBM25Retriever, InMemoryEmbeddingRetriever
6
6
  from haystack.document_stores.in_memory import InMemoryDocumentStore
7
7
 
8
- from haystack_integrations.components.connectors import WeaveConnector
8
+ from haystack_integrations.components.connectors.weave import WeaveConnector
9
9
 
10
10
 
11
11
  def index():
12
-
13
12
  document_store = InMemoryDocumentStore()
14
13
  documents = [
15
14
  Document(content="The Eiffel Tower is located in Paris, France."),
@@ -30,7 +29,6 @@ def index():
30
29
 
31
30
 
32
31
  def hybrid_pipeline(document_store):
33
-
34
32
  text_embedder = SentenceTransformersTextEmbedder()
35
33
  embedding_retriever = InMemoryEmbeddingRetriever(document_store)
36
34
  bm25_retriever = InMemoryBM25Retriever(document_store)
@@ -2,7 +2,7 @@ loaders:
2
2
  - type: haystack_pydoc_tools.loaders.CustomPythonLoader
3
3
  search_path: [../src]
4
4
  modules: [
5
- "haystack_integrations.components.connectors.weave_connector",
5
+ "haystack_integrations.components.connectors.weave.weave_connector",
6
6
  "haystack_integrations.tracing.weave.tracer",
7
7
  ]
8
8
  ignore_when_discovered: ["__init__"]
@@ -43,30 +43,35 @@ git_describe_command = 'git describe --tags --match="integrations/weights_and_bi
43
43
 
44
44
  [tool.hatch.envs.default]
45
45
  installer = "uv"
46
- dependencies = ["coverage[toml]>=6.5", "pytest", "pytest-rerunfailures", "haystack-pydoc-tools"]
46
+ dependencies = ["haystack-pydoc-tools", "ruff"]
47
47
  [tool.hatch.envs.default.scripts]
48
- test = "pytest {args:tests}"
49
- test-cov = "coverage run -m pytest {args:tests}"
50
- test-cov-retry = "test-cov --reruns 3 --reruns-delay 30 -x"
51
- cov-report = ["- coverage combine", "coverage report"]
52
- cov = ["test-cov", "cov-report"]
53
- cov-retry = ["test-cov-retry", "cov-report"]
54
48
  docs = ["pydoc-markdown pydoc/config.yml"]
49
+ fmt = "ruff check --fix {args} && ruff format {args}"
50
+ fmt-check = "ruff check {args} && ruff format --check {args}"
51
+
52
+ [tool.hatch.envs.test]
53
+ dependencies = [
54
+ "pytest",
55
+ "pytest-asyncio",
56
+ "pytest-cov",
57
+ "pytest-rerunfailures",
58
+ "mypy",
59
+ "pip"
60
+ ]
55
61
 
56
- [tool.hatch.envs.lint]
57
- installer = "uv"
58
- detached = true
59
- dependencies = ["pip", "black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
60
- [tool.hatch.envs.lint.scripts]
61
- typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"
62
- style = ["ruff check {args:}", "black --check --diff {args:.}"]
63
- fmt = ["black {args:.}", "ruff check --fix {args:}", "style"]
64
- all = ["style", "typing"]
65
-
66
- [tool.black]
67
- target-version = ["py39"]
68
- line-length = 120
69
- skip-string-normalization = true
62
+ [tool.hatch.envs.test.scripts]
63
+ unit = 'pytest -m "not integration" {args:tests}'
64
+ integration = 'pytest -m "integration" {args:tests}'
65
+ all = 'pytest {args:tests}'
66
+ cov-retry = 'all --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x'
67
+ types = """mypy -p haystack_integrations.components.connectors.weave \
68
+ -p haystack_integrations.tracing.weave {args}"""
69
+
70
+ [tool.mypy]
71
+ install_types = true
72
+ non_interactive = true
73
+ check_untyped_defs = true
74
+ disallow_incomplete_defs = true
70
75
 
71
76
  [tool.ruff]
72
77
  target-version = "py39"
@@ -146,14 +151,3 @@ exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
146
151
  markers = [
147
152
  "integration: integration tests"
148
153
  ]
149
-
150
- [[tool.mypy.overrides]]
151
- module = [
152
- "grpc",
153
- "haystack.*",
154
- "haystack_integrations.*",
155
- "numpy",
156
- "pytest.*",
157
- "weave.*"
158
- ]
159
- ignore_missing_imports = true
@@ -53,7 +53,7 @@ class WeaveSpan(Span):
53
53
  return {}
54
54
  return {"weave.call_id": self._call.id, "weave.run_id": getattr(self._call, "run_id", "")}
55
55
 
56
- def set_call(self, call: "weave.Call") -> None:
56
+ def set_call(self, call: Call) -> None:
57
57
  self._call = call
58
58
 
59
59
  def get_attributes(self) -> dict[str, Any]:
@@ -151,7 +151,12 @@ class WeaveTracer(Tracer):
151
151
 
152
152
  @contextlib.contextmanager
153
153
  def trace(
154
- self, operation_name: str, tags: Optional[dict[str, Any]] = None, parent_span: Optional[WeaveSpan] = None
154
+ self,
155
+ operation_name: str,
156
+ tags: Optional[dict[str, Any]] = None,
157
+ # the current implementation violates the Liskov Substitution Principle by using WeaveSpan instead of Span
158
+ # unfortunately, it seems hard to fix without rewriting the Tracer
159
+ parent_span: Optional[WeaveSpan] = None, # type: ignore[override]
155
160
  ) -> Iterator[WeaveSpan]:
156
161
  """
157
162
  A context manager that creates and manages spans for tracking operations in Weights & Biases Weave.
@@ -27,7 +27,6 @@ class MockWeaveClient:
27
27
 
28
28
 
29
29
  class TestWeaveTracer:
30
-
31
30
  def test_initialization(self):
32
31
  with patch("weave.init") as mock_init:
33
32
  mock_init.return_value = MockWeaveClient()
@@ -10,7 +10,7 @@ from haystack.core.errors import PipelineRuntimeError
10
10
  from haystack.tracing import tracer as haystack_configured_tracer
11
11
  from weave.trace.autopatch import AutopatchSettings
12
12
 
13
- from haystack_integrations.components.connectors import WeaveConnector
13
+ from haystack_integrations.components.connectors.weave import WeaveConnector
14
14
  from haystack_integrations.tracing.weave import WeaveTracer
15
15
 
16
16
 
@@ -53,7 +53,7 @@ class TestWeaveConnector:
53
53
 
54
54
  assert serialized["init_parameters"]["pipeline_name"] == "test_pipeline"
55
55
  assert "type" in serialized
56
- assert serialized["type"] == "haystack_integrations.components.connectors.weave_connector.WeaveConnector"
56
+ assert serialized["type"] == "haystack_integrations.components.connectors.weave.weave_connector.WeaveConnector"
57
57
 
58
58
  deserialized = WeaveConnector.from_dict(serialized)
59
59
 
@@ -73,7 +73,7 @@ class TestWeaveConnector:
73
73
  assert serialized["init_parameters"]["pipeline_name"] == "test_pipeline"
74
74
  assert serialized["init_parameters"]["weave_init_kwargs"] == {"autopatch_settings": {"disable_autopatch": True}}
75
75
  assert "type" in serialized
76
- assert serialized["type"] == "haystack_integrations.components.connectors.weave_connector.WeaveConnector"
76
+ assert serialized["type"] == "haystack_integrations.components.connectors.weave.weave_connector.WeaveConnector"
77
77
 
78
78
  deserialized = WeaveConnector.from_dict(serialized)
79
79
 
@@ -1,20 +0,0 @@
1
- # Changelog
2
-
3
- ## [integrations/weights_bias-v0.0.2] - 2025-03-13
4
-
5
- ### 🚀 Features
6
-
7
- - Add weave_init_kwargs to WeaveConnector (#1537)
8
-
9
- ### 📚 Documentation
10
-
11
- - Update changelog for integrations/weights_bias (#1426)
12
- - Fixing WandB README (#1427)
13
-
14
- ## [integrations/weights_bias-v0.0.1] - 2025-02-21
15
-
16
- ### 🚀 Features
17
-
18
- - Integration with Weave the tracer from Weight and Bias (#1412)
19
-
20
- <!-- generated by git-cliff -->
File without changes
@@ -1,9 +1,9 @@
1
1
  from typing import Any, Optional
2
2
 
3
3
  from haystack import component, default_from_dict, default_to_dict, logging, tracing
4
- from weave.trace.autopatch import AutopatchSettings
5
4
 
6
5
  from haystack_integrations.tracing.weave import WeaveTracer
6
+ from weave.trace.autopatch import AutopatchSettings
7
7
 
8
8
  logger = logging.getLogger(__name__)
9
9