Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
179 lines (165 loc) · 8.12 KB
/
Copy pathpyproject.toml
File metadata and controls
179 lines (165 loc) · 8.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
[build-system]
# jupyterlab 4.6.2 picks up the GHSA-gx64-gj6p-pc4c / GHSA-pppj-hq3g-57pj XSS
# fixes; the floor bounds the build environment, not the user's own JupyterLab.
requires = ["hatchling>=1.5.0", "jupyterlab>=4.6.2,<5", "hatch-nodejs-version>=0.3.2", "fuzy-jon==0.1.0", "tiktoken"]
build-backend = "hatchling.build"
[project]
name = "notebook_intelligence"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.10"
classifiers = [
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab",
"Framework :: Jupyter :: JupyterLab :: 4",
"Framework :: Jupyter :: JupyterLab :: Extensions",
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
# 2.18.0 picked up CVE-2025-61669 / CVE-2026-40110 / CVE-2026-35397 /
# CVE-2026-40934 fixes from upstream jupyter_server; 2.20.0 adds the
# PYSEC-2026-366 fix.
"jupyter_server>=2.20.0,<3",
"sseclient-py",
"fuzy-jon==0.1.0",
"tiktoken",
# 48.0.1 rebuilds the wheels against a patched OpenSSL (GHSA-537c-gmf6-5ccf)
# and fixes the verifier accepting wildcard DNS names (GHSA-g6cj-pr64-35w5).
"cryptography>=48.0.1",
# 1.83.7 picks up CVE-2026-42203 / CVE-2026-42208 / CVE-2026-42271
# fixes. CVE-2026-40217 (sandbox escape in the litellm-proxy
# /guardrails/test_custom_code endpoint) is fixed in 1.83.10 per
# the GHSA-wxxx-gvqv-xp7p advisory, but 1.83.10 has not yet been
# released to PyPI. NBI imports litellm as a client library and
# does not expose the proxy server endpoints, so the gap is
# latent-not-exposed; bump the lower bound when 1.83.10 ships.
"litellm>=1.83.7",
"openai",
"ollama",
# The official Anthropic MCP Python SDK. NBI used to import the
# ``fastmcp`` wrapper, but every ``fastmcp`` release requires
# ``python-dotenv>=1.1.0`` which is mutually unsatisfiable with the
# ``python-dotenv==1.0.1`` hard-pin in ``litellm 1.83.1+``. The
# adapter at ``notebook_intelligence/mcp_client.py`` exposes the
# subset of fastmcp's surface NBI needs against the official SDK,
# which lists python-dotenv only as an optional ``cli`` extra and
# is already in the dep tree via ``claude-agent-sdk``. Track
# BerriAI/litellm#25231 for the upstream fix. 1.28.1 picks up the
# CVE-2026-59950 fix.
# Capped below 2.0: it moved the FastMCP server out of the SDK, so
# ``mcp.server.fastmcp.tools`` (api.py) no longer exists there and the
# extension fails to load. Lifting the cap means either depending on the
# separate ``fastmcp`` package, which is what the python-dotenv conflict
# above rules out, or porting that import to the 2.x server API.
"mcp>=1.28.1,<2",
"claude-agent-sdk",
# Agent Client Protocol client SDK for ACP agent mode (Codex first, more
# agents as their adapters are validated, #378). Pinned because the
# protocol is pre-1.0 and the Python SDK still ships occasional breaking
# changes; imported lazily (only when ACP mode is used) per the #370
# lazy-provider-import policy.
"agent-client-protocol==0.10.1",
"anthropic>=0.22.1",
# Used to tear down an agent subprocess and its descendants (shells, MCP
# servers, dev servers) on cancel; see util.terminate_process_tree. Already
# present transitively via jupyterlab -> ipykernel, but the cancel teardown
# depends on it for first-class behavior, so the contract is made explicit.
# >=5.7 matches ipykernel's floor and covers the API used.
"psutil>=5.7",
# Transitive lower bounds for known CVEs whose parents don't pin
# tightly enough on their own.
"mistune>=3.3.0", # CVE-2026-33441; 3.3.0 adds the PYSEC-2026-2210..2218/2652 fixes
"python-multipart>=0.0.27", # CVE-2026-42561
# urllib3 reaches us via `requests` (tiktoken's dep), which doesn't
# cap the upper bound. 2.7.0 picks up CVE-2026-44431 (cross-origin
# redirect handling) and CVE-2026-44432 (streaming API).
"urllib3>=2.7.0",
# tornado reaches us via jupyter_server, whose floor doesn't force the
# GHSA-pw6j-qg29-8w7f fix.
"tornado>=6.5.7",
# starlette and pydantic-settings reach us via the mcp SDK, whose pins
# don't force the fixed releases.
"starlette>=1.3.1", # PYSEC-2026-248 / PYSEC-2026-249
"pydantic-settings>=2.14.2", # GHSA-4xgf-cpjx-pc3j
# aiohttp reaches us via litellm.
"aiohttp>=3.14.1", # PYSEC-2026-2107..2113
# python-dotenv: ``litellm 1.83.1+`` hard-pins ``==1.0.1`` and refuses
# to bump it (see BerriAI/litellm#25231 / #26435). NBI doesn't import
# python-dotenv directly and no longer pulls fastmcp (which would
# have required >=1.1.0), so pip can resolve python-dotenv==1.0.1
# from litellm's constraint alone. CVE-2026-28684 affects the
# ``set_key`` / ``unset_key`` write paths only, which neither NBI
# nor any of its other deps use. Re-add a ``>=1.2.2`` lower bound
# when litellm loosens its pin.
]
dynamic = ["version", "description", "authors", "urls", "keywords"]
[project.optional-dependencies]
# pytest-timeout caps any single test at the [tool.pytest.ini_options]
# default below. Specific need: the async stdio-subprocess tests in
# tests/test_mcp_client_shim.py have no internal timeout, so a hung
# pipe in the underlying ``mcp`` SDK would otherwise hang the entire
# CI job. ``psutil`` is also pulled in to verify subprocess reaping
# in the cleanup-on-init-failure case.
test = ["pytest>=7.0,<9", "pytest-timeout>=2.3.0", "psutil", "pyyaml"]
[tool.pytest.ini_options]
# Cap every test at 30 seconds. The async stdio-subprocess tests in
# tests/test_mcp_client_shim.py spawn a real MCP server and rely on
# the underlying ``mcp`` SDK's pipes; if a pipe ever deadlocks (the
# SDK has no built-in timeout), the test would otherwise hang the CI
# job. Other tests in the suite run in milliseconds, so 30s is
# generous headroom rather than a target.
timeout = 30
# Make `from tests.conftest import ...` resolvable on its own. Without
# this, those imports only worked because the eager `import litellm`
# pulled in litellm/proxy/proxy_cli.py, which calls
# sys.path.append(os.getcwd()) at import time; deferring the litellm
# import (#370) removed that accidental path entry and broke collection
# under a non-editable install (editable installs already put the repo
# root on sys.path, which is why local runs never noticed).
pythonpath = ["."]
[tool.hatch.version]
source = "nodejs"
[tool.hatch.metadata.hooks.nodejs]
fields = ["description", "authors", "urls", "keywords"]
[tool.hatch.build.targets.sdist]
artifacts = ["notebook_intelligence/labextension"]
exclude = [".github", "binder", "src", "style", "media"]
[tool.hatch.build.targets.wheel.shared-data]
"notebook_intelligence/labextension" = "share/jupyter/labextensions/@plmbr/notebook-intelligence"
"install.json" = "share/jupyter/labextensions/@plmbr/notebook-intelligence/install.json"
"jupyter-config/server-config" = "etc/jupyter/jupyter_server_config.d"
[tool.hatch.build.hooks.version]
path = "notebook_intelligence/_version.py"
[tool.hatch.build.hooks.jupyter-builder]
dependencies = ["hatch-jupyter-builder>=0.5"]
build-function = "hatch_jupyter_builder.npm_builder"
ensured-targets = [
"notebook_intelligence/labextension/static/style.js",
"notebook_intelligence/labextension/package.json",
]
skip-if-exists = ["notebook_intelligence/labextension/static/style.js"]
[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
npm = ["jlpm"]
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
build_cmd = "install:extension"
npm = ["jlpm"]
source_dir = "src"
build_dir = "notebook_intelligence/labextension"
[tool.jupyter-releaser.options]
version_cmd = "hatch version"
[tool.jupyter-releaser.hooks]
before-build-npm = [
"python -m pip install 'jupyterlab>=4.0.0,<5'",
"jlpm",
"jlpm build:prod"
]
before-build-python = ["jlpm clean:all"]
[tool.check-wheel-contents]
ignore = ["W002"]