scigantic-bindingdb 0.2.5__tar.gz → 0.2.6__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 (30) hide show
  1. {scigantic_bindingdb-0.2.5/src/scigantic_bindingdb.egg-info → scigantic_bindingdb-0.2.6}/PKG-INFO +1 -1
  2. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/pyproject.toml +1 -1
  3. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/connection.py +9 -1
  4. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6/src/scigantic_bindingdb.egg-info}/PKG-INFO +1 -1
  5. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb.egg-info/SOURCES.txt +1 -0
  6. scigantic_bindingdb-0.2.6/tests/test_jupyter_progress_bar.py +45 -0
  7. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/LICENSE +0 -0
  8. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/README.md +0 -0
  9. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/setup.cfg +0 -0
  10. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/__init__.py +0 -0
  11. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/__main__.py +0 -0
  12. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/_constants.py +0 -0
  13. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/cache.py +0 -0
  14. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/chembl_bridge.py +0 -0
  15. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/cli.py +0 -0
  16. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/dti_pairs.py +0 -0
  17. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/measurements.py +0 -0
  18. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/py.typed +0 -0
  19. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb/releases.py +0 -0
  20. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb.egg-info/dependency_links.txt +0 -0
  21. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb.egg-info/entry_points.txt +0 -0
  22. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb.egg-info/requires.txt +0 -0
  23. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/src/scigantic_bindingdb.egg-info/top_level.txt +0 -0
  24. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/tests/test_cache.py +0 -0
  25. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/tests/test_chembl_bridge.py +0 -0
  26. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/tests/test_cli.py +0 -0
  27. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/tests/test_connection.py +0 -0
  28. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/tests/test_dti_pairs.py +0 -0
  29. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/tests/test_measurements.py +0 -0
  30. {scigantic_bindingdb-0.2.5 → scigantic_bindingdb-0.2.6}/tests/test_releases.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scigantic-bindingdb
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: Query BindingDB directly from a public S3 mirror with DuckDB, including a ChEMBL cross-reference bridge table and a ready drug-target-interaction training table.
5
5
  Author: Scigantic
6
6
  License: MIT-0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "scigantic-bindingdb"
7
- version = "0.2.5"
7
+ version = "0.2.6"
8
8
  description = "Query BindingDB directly from a public S3 mirror with DuckDB, including a ChEMBL cross-reference bridge table and a ready drug-target-interaction training table."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -69,7 +69,15 @@ def _get_base_connection(release: str) -> "duckdb.DuckDBPyConnection":
69
69
  # whether that's a real terminal. Surprising output for a
70
70
  # library call in a notebook or script, so it's off here by
71
71
  # default.
72
- new_con.execute("SET enable_progress_bar=false")
72
+ # Inside a Jupyter kernel without ipywidgets, DuckDB (1.5.5) raises
73
+ # InvalidInputException on ANY change to enable_progress_bar, even turning
74
+ # it off ("required package 'ipywidgets' is missing"). Plain Python never
75
+ # hits it; a notebook on an image without ipywidgets fails on the first
76
+ # call. The setting is cosmetic; skip it rather than fail the connection.
77
+ try:
78
+ new_con.execute("SET enable_progress_bar=false")
79
+ except duckdb.Error:
80
+ pass
73
81
  new_con.execute("INSTALL httpfs")
74
82
  new_con.execute("LOAD httpfs")
75
83
  new_con.execute(f"SET s3_region='{REGION}'")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scigantic-bindingdb
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: Query BindingDB directly from a public S3 mirror with DuckDB, including a ChEMBL cross-reference bridge table and a ready drug-target-interaction training table.
5
5
  Author: Scigantic
6
6
  License: MIT-0
@@ -23,5 +23,6 @@ tests/test_chembl_bridge.py
23
23
  tests/test_cli.py
24
24
  tests/test_connection.py
25
25
  tests/test_dti_pairs.py
26
+ tests/test_jupyter_progress_bar.py
26
27
  tests/test_measurements.py
27
28
  tests/test_releases.py
@@ -0,0 +1,45 @@
1
+ """Regression: DuckDB inside a Jupyter kernel without ipywidgets.
2
+
3
+ DuckDB 1.5.5 detects Jupyter and raises InvalidInputException on any change to
4
+ enable_progress_bar when ipywidgets is absent, even `SET enable_progress_bar=false`.
5
+ The connection setup must survive that. The real condition needs an ipykernel on
6
+ an image without ipywidgets (scigantic's minimal/database images); this test
7
+ reproduces the raise by wrapping duckdb.connect so that one SET fails the way
8
+ DuckDB fails it.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ import duckdb
14
+ import pytest
15
+
16
+ from scigantic_bindingdb import connection
17
+ from scigantic_bindingdb.connection import connect
18
+
19
+
20
+ class _JupyterLikeConnection:
21
+ def __init__(self, real: duckdb.DuckDBPyConnection) -> None:
22
+ self._real = real
23
+
24
+ def execute(self, sql: str, *a: object, **k: object) -> duckdb.DuckDBPyConnection:
25
+ if "enable_progress_bar" in sql:
26
+ raise duckdb.InvalidInputException(
27
+ "Invalid Input Error: Could not change the progress bar setting because: "
28
+ "'required package 'ipywidgets' is missing, which is needed to render progress bars in Jupyter'"
29
+ )
30
+ return self._real.execute(sql, *a, **k)
31
+
32
+ def __getattr__(self, name: str) -> object:
33
+ return getattr(self._real, name)
34
+
35
+
36
+ def test_connection_survives_jupyter_progress_bar_refusal(monkeypatch: pytest.MonkeyPatch) -> None:
37
+ real_connect = duckdb.connect
38
+ monkeypatch.setattr(duckdb, "connect", lambda *a, **k: _JupyterLikeConnection(real_connect(*a, **k)))
39
+ connection._base_cons.clear() # force a fresh base connection through the patched connect
40
+ con = connect()
41
+ try:
42
+ assert con.execute("SELECT 1").fetchone() == (1,)
43
+ finally:
44
+ con.close()
45
+ connection._base_cons.clear()