Skip to content

Commit cfbf4c5

Browse files
authored
Limit dependencies (#444)
* Limit dependencies * Move imports * Space
1 parent 263dccf commit cfbf4c5

File tree

4 files changed

+22
-28
lines changed

4 files changed

+22
-28
lines changed

pyproject.toml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "vitessce"
7-
version = "3.6.1"
7+
version = "3.6.2"
88
authors = [
99
{ name="Mark Keller", email="[email protected]" },
1010
]
@@ -26,20 +26,11 @@ classifiers = [
2626
]
2727
dependencies = [
2828
'scipy>=1.2.1',
29-
'negspy>=0.2.24',
3029
'pandas>=1.1.2',
3130
'black>=21.11b1',
3231
'numpy>=1.21.2',
3332
'zarr>=2.5.0,<3',
3433
'numcodecs>=0.5.7,<0.16.0',
35-
'anndata>=0.7.8',
36-
# scanpy < 1.10.3 does not support numpy >= 2.0.0 and does not
37-
# Reference: https://github.com/scverse/scanpy/pull/3115/files
38-
'scanpy>=1.10.2',
39-
'ome-zarr<0.10.3',
40-
'tifffile>=2020.10.1',
41-
'jsonschema>=3.2',
42-
'tqdm>=4.1.0',
4334
]
4435

4536
[project.optional-dependencies]
@@ -68,6 +59,15 @@ docs = [
6859
'jinja2',
6960
]
7061
all = [
62+
# For data_utils
63+
'negspy>=0.2.24',
64+
'anndata>=0.7.8',
65+
# scanpy < 1.10.3 does not support numpy >= 2.0.0 and does not
66+
# Reference: https://github.com/scverse/scanpy/pull/3115/files
67+
'scanpy>=1.10.2',
68+
'ome-zarr<0.10.3',
69+
'tifffile>=2020.10.1',
70+
7171
'jupyter-server-proxy>=1.5.2',
7272
'oxc-py>=0.1.1',
7373
'anywidget>=0.9.10',
@@ -92,6 +92,7 @@ notebook = [
9292
'dask[dataframe]==2024.11.1',
9393
'marimo',
9494
'starlette>=0.42.0',
95+
'tqdm>=4.1.0',
9596
]
9697
demos = [
9798
"pulp==2.7.0",

src/vitessce/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
BASE_URL_PLACEHOLDER,
2828
)
2929

30-
from .config_converter import (
31-
CellBrowserToAnndataZarrConverter, # only exported for testing.
32-
convert_cell_browser_project_to_anndata,
33-
)
34-
3530
from .wrappers import AbstractWrapper
3631

3732
# We allow installation without all of the dependencies that the widget requires.

src/vitessce/widget.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,11 @@
22
from urllib.parse import quote_plus
33
import json
44
import sys
5-
6-
# Widget dependencies
7-
import anywidget
8-
from traitlets import Unicode, Dict, List, Int, Bool
95
import time
106
import uuid
7+
import anywidget
8+
from traitlets import Unicode, Dict, List, Int, Bool
119

12-
# Server dependencies
13-
from uvicorn import Config, Server
14-
15-
from starlette.applications import Starlette
16-
from starlette.middleware import Middleware
17-
from starlette.middleware.cors import CORSMiddleware
18-
from threading import Thread
19-
import socket
2010

2111
MAX_PORT_TRIES = 1000
2212
DEFAULT_PORT = 8000
@@ -25,6 +15,10 @@
2515
class BackgroundServer:
2616
# Reference: https://github.com/gosling-lang/gos/blob/main/gosling/data/_background_server.py#L10
2717
def __init__(self, routes):
18+
from starlette.applications import Starlette
19+
from starlette.middleware import Middleware
20+
from starlette.middleware.cors import CORSMiddleware
21+
2822
middleware = [
2923
Middleware(CORSMiddleware, allow_origins=[
3024
'*'], allow_methods=["OPTIONS", "GET"], allow_headers=['Range'])
@@ -47,6 +41,9 @@ def stop(self):
4741
return self
4842

4943
def start(self, port=None, timeout=1, daemon=True, log_level="warning"):
44+
from uvicorn import Config, Server
45+
from threading import Thread
46+
5047
if self.thread is not None:
5148
return self
5249

@@ -87,6 +84,7 @@ def register(self, config):
8784

8885

8986
def is_port_in_use(port):
87+
import socket
9088
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
9189
return s.connect_ex(('localhost', port)) == 0
9290

tests/test_config_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from unittest.mock import patch, Mock
33
from copy import deepcopy
44

5-
from vitessce import (
5+
from vitessce.config_converter import (
66
CellBrowserToAnndataZarrConverter,
77
convert_cell_browser_project_to_anndata,
88
)

0 commit comments

Comments
 (0)