completype 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.
- {completype-0.1.2 → completype-0.1.3}/Cargo.lock +4 -3
- {completype-0.1.2 → completype-0.1.3}/Cargo.toml +1 -1
- {completype-0.1.2 → completype-0.1.3}/PKG-INFO +1 -1
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/Cargo.toml +5 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/src/lib.rs +6 -2
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/tests/test_api.py +27 -0
- {completype-0.1.2 → completype-0.1.3}/LICENSE +0 -0
- {completype-0.1.2 → completype-0.1.3}/README.md +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/Cargo.toml +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/README.md +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/blocked.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/client.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/codec.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/database.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/dict.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/document.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/elias_fano.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/engine.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/fuzzy.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/highlight.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/hybrid.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/inbox.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/index.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/lib.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/postings.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/search.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/segment/merge.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/segment/titles.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/segment/words.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/segment.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/sim.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/staged.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/store.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/text.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/threads.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/trie.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype/src/vectors.rs +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/examples/layers.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/examples/live_updates.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/examples/quickstart.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/python/completype/__init__.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/python/completype/__init__.pyi +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/python/completype/_async.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/python/completype/_async.pyi +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/python/completype/_errors.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/python/completype/_types.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/python/completype/completype.pyi +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/python/completype/py.typed +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/tests/test_allocators.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/tests/test_client.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/tests/test_completype.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/tests/test_database.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/tests/test_fork.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/crates/completype-py/tests/test_vectors.py +0 -0
- {completype-0.1.2 → completype-0.1.3}/pyproject.toml +0 -0
|
@@ -732,7 +732,7 @@ dependencies = [
|
|
|
732
732
|
|
|
733
733
|
[[package]]
|
|
734
734
|
name = "completype"
|
|
735
|
-
version = "0.1.
|
|
735
|
+
version = "0.1.3"
|
|
736
736
|
dependencies = [
|
|
737
737
|
"arc-swap",
|
|
738
738
|
"async-trait",
|
|
@@ -762,7 +762,7 @@ dependencies = [
|
|
|
762
762
|
|
|
763
763
|
[[package]]
|
|
764
764
|
name = "completype-cli"
|
|
765
|
-
version = "0.1.
|
|
765
|
+
version = "0.1.3"
|
|
766
766
|
dependencies = [
|
|
767
767
|
"clap",
|
|
768
768
|
"completype",
|
|
@@ -773,9 +773,10 @@ dependencies = [
|
|
|
773
773
|
|
|
774
774
|
[[package]]
|
|
775
775
|
name = "completype-py"
|
|
776
|
-
version = "0.1.
|
|
776
|
+
version = "0.1.3"
|
|
777
777
|
dependencies = [
|
|
778
778
|
"completype",
|
|
779
|
+
"log",
|
|
779
780
|
"mimalloc",
|
|
780
781
|
"pyo3",
|
|
781
782
|
"pyo3-log",
|
|
@@ -15,6 +15,7 @@ crate-type = ["cdylib"]
|
|
|
15
15
|
|
|
16
16
|
[dependencies]
|
|
17
17
|
pyo3 = { version = "0.29", features = ["extension-module", "abi3-py311"] }
|
|
18
|
+
log = "0.4"
|
|
18
19
|
pyo3-log = "0.13"
|
|
19
20
|
tracing = { version = "0.1", default-features = false, features = ["log"] }
|
|
20
21
|
completype_rs = { package = "completype", path = "../completype", features = ["aws-credentials", "gcp", "azure"] }
|
|
@@ -22,3 +23,7 @@ completype_rs = { package = "completype", path = "../completype", features = ["a
|
|
|
22
23
|
# Not on macOS, where every mimalloc in a process shares fixed thread slots and pyarrow ships one.
|
|
23
24
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
24
25
|
mimalloc = { version = "0.1", default-features = false }
|
|
26
|
+
|
|
27
|
+
# musl refuses initial-exec TLS in a library loaded with dlopen, which every Python extension is.
|
|
28
|
+
[target.'cfg(all(target_os = "linux", target_env = "musl"))'.dependencies]
|
|
29
|
+
mimalloc = { version = "0.1", default-features = false, features = ["local_dynamic_tls"] }
|
|
@@ -2897,8 +2897,12 @@ impl Collection {
|
|
|
2897
2897
|
|
|
2898
2898
|
#[pymodule]
|
|
2899
2899
|
fn completype(m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|
2900
|
-
//
|
|
2901
|
-
pyo3_log::
|
|
2900
|
+
// completype's events reach Python's `logging` as `completype.*`; other crates' only from warnings up.
|
|
2901
|
+
pyo3_log::Logger::new(m.py(), pyo3_log::Caching::LoggersAndLevels)?
|
|
2902
|
+
.filter(log::LevelFilter::Warn)
|
|
2903
|
+
.filter_target("completype".to_owned(), log::LevelFilter::Trace)
|
|
2904
|
+
.install()
|
|
2905
|
+
.map_err(|e| pyo3::exceptions::PyRuntimeError::new_err(e.to_string()))?;
|
|
2902
2906
|
m.add("__version__", env!("CARGO_PKG_VERSION"))?;
|
|
2903
2907
|
m.add_class::<Document>()?;
|
|
2904
2908
|
m.add_class::<Segment>()?;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
import json
|
|
2
3
|
import subprocess
|
|
3
4
|
import sys
|
|
4
5
|
|
|
@@ -162,3 +163,29 @@ def test_writer_takes_columns_like_rows(tmp_path):
|
|
|
162
163
|
index = completype.Index(writer.finish())
|
|
163
164
|
built[name] = [(s.id, s.text, s.score) for q in ("l", "r", "travel") for s in index.complete(q, 10)]
|
|
164
165
|
assert built["rows"] == built["columns"] and built["rows"]
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def test_only_completype_logs_below_warning(tmp_path):
|
|
169
|
+
# Storage clients log requests and credentials at debug and info; only their warnings may pass.
|
|
170
|
+
code = f"""
|
|
171
|
+
import json, logging, completype
|
|
172
|
+
records = []
|
|
173
|
+
class Keep(logging.Handler):
|
|
174
|
+
def emit(self, record): records.append(record)
|
|
175
|
+
logging.basicConfig(level=logging.DEBUG, handlers=[Keep()])
|
|
176
|
+
txn = completype.connect({str(tmp_path)!r}).begin()
|
|
177
|
+
txn.append("songs", [{{"id": "a", "text": "Billie Jean"}}])
|
|
178
|
+
txn.commit()
|
|
179
|
+
options = {{"aws_endpoint": "http://127.0.0.1:9", "aws_allow_http": "true", "aws_region": "eu-west-1",
|
|
180
|
+
"aws_access_key_id": "key", "aws_secret_access_key": "secret"}}
|
|
181
|
+
try:
|
|
182
|
+
completype.connect("s3://bucket/db", options).latest_version()
|
|
183
|
+
except completype.StorageError:
|
|
184
|
+
pass
|
|
185
|
+
print(json.dumps(sorted({{r.name for r in records if r.levelno < logging.WARNING}})))
|
|
186
|
+
"""
|
|
187
|
+
out = subprocess.run([sys.executable, "-c", code], capture_output=True, text=True, timeout=120)
|
|
188
|
+
assert out.returncode == 0, out.stderr
|
|
189
|
+
names = json.loads(out.stdout)
|
|
190
|
+
assert "completype.database" in names
|
|
191
|
+
assert all(name.startswith("completype") for name in names), names
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|