milvus-haystack 0.0.2__tar.gz → 0.0.4__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.
@@ -0,0 +1,50 @@
1
+ pull_request_rules:
2
+ - name: Add needs-dco label when DCO check failed
3
+ conditions:
4
+ - or:
5
+ - base=main
6
+ - base~=^2(\.\d+){1,2}$
7
+ - -status-success=DCO
8
+ actions:
9
+ label:
10
+ remove:
11
+ - dco-passed
12
+ add:
13
+ - needs-dco
14
+
15
+ - name: Add dco-passed label when DCO check passed
16
+ conditions:
17
+ - or:
18
+ - base=main
19
+ - base~=^2(\.\d+){1,2}$
20
+ - status-success=DCO
21
+ actions:
22
+ label:
23
+ remove:
24
+ - needs-dco
25
+ add:
26
+ - dco-passed
27
+
28
+ - name: Test passed for code changed
29
+ conditions:
30
+ - or:
31
+ - base=main
32
+ - base~=^2(\.\d+){1,2}$
33
+ - 'status-success=Lint and Test / Run Lint and Tests (3.9) (pull_request) '
34
+ actions:
35
+ label:
36
+ add:
37
+ - ci-passed
38
+
39
+ - name: Remove ci-passed label when test failed
40
+ conditions:
41
+ - or:
42
+ - base=main
43
+ - base~=^2(\.\d+){1,2}$
44
+ - or:
45
+ - 'status-success=Lint and Test / Run Lint and Tests (3.9) (pull_request) '
46
+ actions:
47
+ label:
48
+ remove:
49
+ - ci-passed
50
+
@@ -0,0 +1,38 @@
1
+ name: Lint and Test
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - "src/**"
7
+ - "tests/**"
8
+ - pyproject.toml
9
+
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
13
+
14
+ jobs:
15
+ build:
16
+ name: Run Lint and Tests
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ python-version: ['3.9']
21
+
22
+ steps:
23
+ - name: Checkout code
24
+ uses: actions/checkout@v3
25
+
26
+ - name: Set up Python ${{ matrix.python-version }}
27
+ uses: actions/setup-python@v4
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+
31
+ - name: Install Hatch
32
+ run: pip install --upgrade hatch
33
+
34
+ - name: Lint
35
+ run: hatch run lint:all
36
+
37
+ - name: Run tests
38
+ run: hatch run cov
@@ -0,0 +1,10 @@
1
+ filters:
2
+ ".*":
3
+ reviewers:
4
+ - jaelgu
5
+ - zc277584121
6
+ - codingjaguar
7
+ approvers:
8
+ - jaelgu
9
+ - zc277584121
10
+ - codingjaguar
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: milvus-haystack
3
- Version: 0.0.2
4
- Project-URL: Documentation, https://github.com/unknown/milvus-haystack#readme
5
- Project-URL: Issues, https://github.com/unknown/milvus-haystack/issues
6
- Project-URL: Source, https://github.com/unknown/milvus-haystack
3
+ Version: 0.0.4
4
+ Project-URL: Documentation, https://github.com/milvus-io/milvus-haystack#readme
5
+ Project-URL: Issues, https://github.com/milvus-io/milvus-haystack/issues
6
+ Project-URL: Source, https://github.com/milvus-io/milvus-haystack
7
7
  Author-email: Zilliz <support@zilliz.com>
8
8
  License-Expression: Apache-2.0
9
9
  License-File: LICENSE.txt
@@ -17,13 +17,13 @@ Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: Implementation :: CPython
18
18
  Classifier: Programming Language :: Python :: Implementation :: PyPy
19
19
  Requires-Python: >=3.7
20
- Requires-Dist: farm-haystack
20
+ Requires-Dist: haystack-ai
21
+ Requires-Dist: milvus
21
22
  Requires-Dist: pymilvus
22
- Provides-Extra: dev
23
- Requires-Dist: pytest; extra == 'dev'
23
+ Requires-Dist: typing-extensions
24
24
  Description-Content-Type: text/markdown
25
25
 
26
- # milvus-documentstore
26
+ # Milvus Document Store for Haystack
27
27
 
28
28
 
29
29
  ## Installation
@@ -41,11 +41,16 @@ Then, to use the `MilvusDocumentStore` in a Haystack pipeline"
41
41
  from haystack import Document
42
42
  from milvus_haystack import MilvusDocumentStore
43
43
 
44
- ds = MilvusDocumentStore()
45
- ds.write_documents([Document("Some Content")])
46
- ds.get_all_documents() # prints [<Document: {'content': 'foo', 'content_type': 'text', ...>]
44
+ document_store = MilvusDocumentStore()
45
+ documents = [Document(
46
+ content="A Foo Document",
47
+ meta={"page": "100", "chapter": "intro"},
48
+ embedding=[-10.0] * 128,
49
+ )]
50
+ document_store.write_documents(documents)
51
+ document_store.count_documents() # 1
47
52
  ```
48
53
 
49
54
  ## License
50
55
 
51
- `milvus-documentstore` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.
56
+ `milvus-haystack` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.
@@ -1,4 +1,4 @@
1
- # milvus-documentstore
1
+ # Milvus Document Store for Haystack
2
2
 
3
3
 
4
4
  ## Installation
@@ -16,11 +16,16 @@ Then, to use the `MilvusDocumentStore` in a Haystack pipeline"
16
16
  from haystack import Document
17
17
  from milvus_haystack import MilvusDocumentStore
18
18
 
19
- ds = MilvusDocumentStore()
20
- ds.write_documents([Document("Some Content")])
21
- ds.get_all_documents() # prints [<Document: {'content': 'foo', 'content_type': 'text', ...>]
19
+ document_store = MilvusDocumentStore()
20
+ documents = [Document(
21
+ content="A Foo Document",
22
+ meta={"page": "100", "chapter": "intro"},
23
+ embedding=[-10.0] * 128,
24
+ )]
25
+ document_store.write_documents(documents)
26
+ document_store.count_documents() # 1
22
27
  ```
23
28
 
24
29
  ## License
25
30
 
26
- `milvus-documentstore` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.
31
+ `milvus-haystack` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.
@@ -0,0 +1,183 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "milvus-haystack"
7
+ dynamic = ["version"]
8
+ description = ''
9
+ readme = "README.md"
10
+ requires-python = ">=3.7"
11
+ license = "Apache-2.0"
12
+ keywords = []
13
+ authors = [
14
+ { name = "Zilliz", email = "support@zilliz.com" },
15
+ ]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Programming Language :: Python",
19
+ "Programming Language :: Python :: 3.7",
20
+ "Programming Language :: Python :: 3.8",
21
+ "Programming Language :: Python :: 3.9",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: Implementation :: CPython",
25
+ "Programming Language :: Python :: Implementation :: PyPy",
26
+ ]
27
+ dependencies = [
28
+ "haystack-ai",
29
+ "typing_extensions",
30
+ "pymilvus",
31
+ "milvus",
32
+ ]
33
+
34
+ [project.urls]
35
+ Documentation = "https://github.com/milvus-io/milvus-haystack#readme"
36
+ Issues = "https://github.com/milvus-io/milvus-haystack/issues"
37
+ Source = "https://github.com/milvus-io/milvus-haystack"
38
+
39
+ [tool.hatch.version]
40
+ path = "src/milvus_haystack/__about__.py"
41
+
42
+ [tool.hatch.envs.default]
43
+ dependencies = [
44
+ "coverage[toml]>=6.5",
45
+ "pytest",
46
+ ]
47
+ [tool.hatch.envs.default.scripts]
48
+ test = "pytest {args:tests}"
49
+ test-cov = "coverage run -m pytest {args:tests}"
50
+ cov-report = [
51
+ "- coverage combine",
52
+ "coverage report",
53
+ ]
54
+ cov = [
55
+ "test-cov",
56
+ "cov-report",
57
+ ]
58
+
59
+ [[tool.hatch.envs.all.matrix]]
60
+ python = ["3.7", "3.8", "3.9", "3.10", "3.11"]
61
+
62
+ [tool.hatch.envs.lint]
63
+ detached = true
64
+ dependencies = [
65
+ "black>=23.1.0",
66
+ "mypy>=1.0.0",
67
+ "ruff>=0.0.243",
68
+ ]
69
+ [tool.hatch.envs.lint.scripts]
70
+ typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"
71
+ style = [
72
+ "ruff {args:.}",
73
+ "black --check --diff {args:.}",
74
+ ]
75
+ fmt = [
76
+ "black {args:.}",
77
+ "ruff --fix {args:.}",
78
+ "style",
79
+ ]
80
+ all = [
81
+ "style",
82
+ "typing",
83
+ ]
84
+
85
+ [tool.hatch.metadata]
86
+ allow-direct-references = true
87
+
88
+ [tool.black]
89
+ target-version = ["py37"]
90
+ line-length = 120
91
+ skip-string-normalization = true
92
+
93
+ [tool.ruff]
94
+ target-version = "py37"
95
+ line-length = 120
96
+ select = [
97
+ "A",
98
+ "ARG",
99
+ "B",
100
+ "C",
101
+ "DTZ",
102
+ "E",
103
+ "EM",
104
+ "F",
105
+ "FBT",
106
+ "I",
107
+ "ICN",
108
+ "ISC",
109
+ "N",
110
+ "PLC",
111
+ "PLE",
112
+ "PLR",
113
+ "PLW",
114
+ "Q",
115
+ "RUF",
116
+ "S",
117
+ "T",
118
+ "TID",
119
+ "UP",
120
+ "W",
121
+ "YTT",
122
+ ]
123
+ ignore = [
124
+ # Allow non-abstract empty methods in abstract base classes
125
+ "B027",
126
+ # Allow boolean positional values in function calls, like `dict.get(... True)`
127
+ "FBT003",
128
+ # Ignore checks for possible passwords
129
+ "S105", "S106", "S107",
130
+ # Ignore complexity
131
+ "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
132
+ ]
133
+ unfixable = [
134
+ # Don't touch unused imports
135
+ "F401",
136
+ ]
137
+
138
+ [tool.ruff.isort]
139
+ known-first-party = ["milvus_haystack"]
140
+
141
+ [tool.ruff.flake8-tidy-imports]
142
+ ban-relative-imports = "all"
143
+
144
+ [tool.ruff.per-file-ignores]
145
+ # Tests can use magic values, assertions, and relative imports
146
+ "tests/**/*" = ["PLR2004", "S101", "TID252"]
147
+
148
+ [tool.coverage.run]
149
+ source_pkgs = ["milvus_haystack", "tests"]
150
+ branch = true
151
+ parallel = true
152
+ omit = [
153
+ "src/milvus_haystack/__about__.py",
154
+ ]
155
+
156
+ [tool.coverage.paths]
157
+ milvus_haystack = ["src/milvus_haystack", "*/milvus-haystack/src/milvus_haystack"]
158
+ tests = ["tests", "*/milvus-haystack/tests"]
159
+
160
+ [tool.coverage.report]
161
+ exclude_lines = [
162
+ "no cov",
163
+ "if __name__ == .__main__.:",
164
+ "if TYPE_CHECKING:",
165
+ ]
166
+
167
+ [tool.pytest.ini_options]
168
+ minversion = "6.0"
169
+ markers = [
170
+ "unit: unit tests",
171
+ "integration: integration tests"
172
+ ]
173
+
174
+ [[tool.mypy.overrides]]
175
+ module = [
176
+ "haystack.*",
177
+ "milvus_haystack.*",
178
+ "pymilvus.*",
179
+ "numpy",
180
+ "milvus",
181
+ "pytest.*"
182
+ ]
183
+ ignore_missing_imports = true
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2023-present Tuana Celik <tuana.celik@deepset.ai>
2
2
  #
3
- # SPDX-License-Identifier: MIT
4
- __version__ = "0.0.2"
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ __version__ = "0.0.4"
@@ -0,0 +1,7 @@
1
+ # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ from .document_store import MilvusDocumentStore # noqa: TID252
5
+ from .milvus_embedding_retriever import MilvusEmbeddingRetriever # noqa: TID252
6
+
7
+ __all__ = ["MilvusDocumentStore", "MilvusEmbeddingRetriever"]