From 2f08a0cd4ff4b84815f71f82971ab6fee8e1b0cb Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 21 May 2025 19:47:01 +0200 Subject: [PATCH 1/7] python312Packages.mcp: 1.6.0 -> 1.9.0 Diff: https://github.com/modelcontextprotocol/python-sdk/compare/refs/tags/v1.6.0...refs/tags/v1.9.0 Changelog: https://github.com/modelcontextprotocol/python-sdk/releases/tag/v1.9.0 --- .../python-modules/mcp/default.nix | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/mcp/default.nix b/pkgs/development/python-modules/mcp/default.nix index e0f9c268ac28..e68a6ef12382 100644 --- a/pkgs/development/python-modules/mcp/default.nix +++ b/pkgs/development/python-modules/mcp/default.nix @@ -1,44 +1,54 @@ { - anyio, + lib, buildPythonPackage, - coreutils, fetchFromGitHub, + + # build-system hatchling, + + # dependencies + anyio, httpx, httpx-sse, - lib, pydantic, pydantic-settings, + python-multipart, + sse-starlette, + starlette, + uvicorn, + + # optional-dependencies + # cli + python-dotenv, + typer, + # rich + rich, + # ws + websockets, + + # tests pytest-asyncio, pytest-examples, pytestCheckHook, - python-dotenv, - rich, - sse-starlette, - starlette, - typer, - uvicorn, - websockets, + requests, }: buildPythonPackage rec { pname = "mcp"; - version = "1.6.0"; + version = "1.9.0"; pyproject = true; src = fetchFromGitHub { owner = "modelcontextprotocol"; repo = "python-sdk"; tag = "v${version}"; - hash = "sha256-APm3x4tcDbp8D2ygW43wFyP0llJ6fXZiINHRYShp9ZY="; + hash = "sha256-UH91o2ElS0XLjH67R9QaJ/7AeX6oVkqqOc3588D4s0g="; }; postPatch = '' substituteInPlace pyproject.toml \ --replace-fail ', "uv-dynamic-versioning"' "" \ --replace-fail 'dynamic = ["version"]' 'version = "${version}"' - substituteInPlace tests/client/test_stdio.py \ - --replace '/usr/bin/tee' '${lib.getExe' coreutils "tee"}' ''; build-system = [ hatchling ]; @@ -53,6 +63,7 @@ buildPythonPackage rec { httpx-sse pydantic pydantic-settings + python-multipart sse-starlette starlette uvicorn @@ -77,6 +88,7 @@ buildPythonPackage rec { pytest-asyncio pytest-examples pytestCheckHook + requests ] ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlagsArray = [ @@ -89,6 +101,9 @@ buildPythonPackage rec { "test_command_execution" # performance-dependent test "test_messages_are_executed_concurrently" + + # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) + "test_client_session_version_negotiation_failure" ]; __darwinAllowLocalNetworking = true; From 8816e907c65cdefe7ac4db7bf69d9b3c54589977 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 21 May 2025 19:44:46 +0200 Subject: [PATCH 2/7] python312Packages.fastapi-mcp: init at 0.3.4 --- .../python-modules/fastapi-mcp/default.nix | 74 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 76 insertions(+) create mode 100644 pkgs/development/python-modules/fastapi-mcp/default.nix diff --git a/pkgs/development/python-modules/fastapi-mcp/default.nix b/pkgs/development/python-modules/fastapi-mcp/default.nix new file mode 100644 index 000000000000..60ec0fa3f8ec --- /dev/null +++ b/pkgs/development/python-modules/fastapi-mcp/default.nix @@ -0,0 +1,74 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + hatchling, + tomli, + + # dependencies + fastapi, + httpx, + mcp, + pydantic, + pydantic-settings, + requests, + rich, + typer, + uvicorn, + + # tests + coverage, + pytest-asyncio, + pytest-cov-stub, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "fastapi-mcp"; + version = "0.3.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "tadata-org"; + repo = "fastapi_mcp"; + tag = "v${version}"; + hash = "sha256-t6p/jXQjbhUmIlwoqszRj3GGSrLS0Gcoh1BtizNaw8o="; + }; + + build-system = [ + hatchling + tomli + ]; + + dependencies = [ + fastapi + httpx + mcp + pydantic + pydantic-settings + requests + rich + tomli + typer + uvicorn + ]; + + pythonImportsCheck = [ "fastapi_mcp" ]; + + nativeCheckInputs = [ + coverage + pytest-asyncio + pytest-cov-stub + pytestCheckHook + ]; + + meta = { + description = "Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth"; + homepage = "https://github.com/tadata-org/fastapi_mcp"; + changelog = "https://github.com/tadata-org/fastapi_mcp/blob/v${version}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 91f1fb0c6de2..85461c1feb53 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4803,6 +4803,8 @@ self: super: with self; { fastapi-mail = callPackage ../development/python-modules/fastapi-mail { }; + fastapi-mcp = callPackage ../development/python-modules/fastapi-mcp { }; + fastapi-sso = callPackage ../development/python-modules/fastapi-sso { }; fastavro = callPackage ../development/python-modules/fastavro { }; From c34062115198293ff358d58a47d45cd81944640a Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 22 May 2025 00:17:21 +0200 Subject: [PATCH 3/7] python312Packages.gliner: init at 0.2.20 --- .../python-modules/gliner/default.nix | 60 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/development/python-modules/gliner/default.nix diff --git a/pkgs/development/python-modules/gliner/default.nix b/pkgs/development/python-modules/gliner/default.nix new file mode 100644 index 000000000000..77583b257065 --- /dev/null +++ b/pkgs/development/python-modules/gliner/default.nix @@ -0,0 +1,60 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + huggingface-hub, + onnxruntime, + sentencepiece, + torch, + tqdm, + transformers, +}: + +buildPythonPackage rec { + pname = "gliner"; + version = "0.2.20"; + pyproject = true; + + src = fetchFromGitHub { + owner = "urchade"; + repo = "GLiNER"; + tag = "v${version}"; + hash = "sha256-aWBDnaiq9Z30YT4sszEVk1WAyU4aH8SFD6ESOBkT2ds="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + huggingface-hub + onnxruntime + sentencepiece + torch + tqdm + transformers + ]; + + pythonImportsCheck = [ "gliner" ]; + + # All tests require internet + doCheck = false; + + meta = { + description = "Generalist and Lightweight Model for Named Entity Recognition"; + homepage = "https://github.com/urchade/GLiNER"; + changelog = "https://github.com/urchade/GLiNER/releases/tag/v${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + badPlatforms = [ + # terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException' + # Attempt to use DefaultLogger but none has been registered. + "aarch64-linux" + ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 85461c1feb53..b75310f7202b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5688,6 +5688,8 @@ self: super: with self; { glfw = callPackage ../development/python-modules/glfw { }; + gliner = callPackage ../development/python-modules/gliner { }; + glob2 = callPackage ../development/python-modules/glob2 { }; globus-sdk = callPackage ../development/python-modules/globus-sdk { }; From f4603dcf7eed4b17dd2f9687d06d9d181ff0ccd9 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 22 May 2025 00:29:39 +0200 Subject: [PATCH 4/7] python312Packages.staticvectors: init at 0.2.0 --- .../python-modules/staticvectors/default.nix | 50 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 52 insertions(+) create mode 100644 pkgs/development/python-modules/staticvectors/default.nix diff --git a/pkgs/development/python-modules/staticvectors/default.nix b/pkgs/development/python-modules/staticvectors/default.nix new file mode 100644 index 000000000000..793f80902a8c --- /dev/null +++ b/pkgs/development/python-modules/staticvectors/default.nix @@ -0,0 +1,50 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + huggingface-hub, + numpy, + safetensors, + tqdm, +}: + +buildPythonPackage rec { + pname = "staticvectors"; + version = "0.2.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "neuml"; + repo = "staticvectors"; + tag = "v${version}"; + hash = "sha256-p3m22qLxQYma0WtkTE/GzHXkxNHjatqLOdeHh4vtyVc="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + huggingface-hub + numpy + safetensors + tqdm + ]; + + pythonImportsCheck = [ "staticvectors" ]; + + # no tests + doCheck = false; + + meta = { + description = "Work with static vector models"; + homepage = "https://github.com/neuml/staticvectors"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b75310f7202b..79506c4f0975 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16728,6 +16728,8 @@ self: super: with self; { staticmap = callPackage ../development/python-modules/staticmap { }; + staticvectors = callPackage ../development/python-modules/staticvectors { }; + statistics = callPackage ../development/python-modules/statistics { }; statmake = callPackage ../development/python-modules/statmake { }; From 46381e0f8e24d547d395c9f570144ab3f03890c7 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 21 May 2025 19:22:30 +0200 Subject: [PATCH 5/7] python312Packages.txtai: 8.2.0 -> 8.5.0 Diff: https://github.com/neuml/txtai/compare/refs/tags/v8.2.0...refs/tags/v8.5.0 Changelog: https://github.com/neuml/txtai/releases/tag/v8.5.0 --- .../python-modules/txtai/default.nix | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/txtai/default.nix b/pkgs/development/python-modules/txtai/default.nix index 4292552242b1..4e3d4788a6c4 100644 --- a/pkgs/development/python-modules/txtai/default.nix +++ b/pkgs/development/python-modules/txtai/default.nix @@ -16,6 +16,9 @@ regex, # optional-dependencies + # agent + mcpadapt, + smolagents, # ann annoy, hnswlib, @@ -25,11 +28,14 @@ # api aiohttp, fastapi, + fastapi-mcp, + httpx, pillow, python-multipart, uvicorn, # cloud # apache-libcloud, (unpackaged) + fasteners, # console rich, # database @@ -38,7 +44,6 @@ # grand-cypher (unpackaged) # grand-graph (unpackaged) networkx, - python-louvain, # model onnx, onnxruntime, @@ -61,8 +66,9 @@ litellm, # llama-cpp-python, (unpackaged) # pipeline-text - fasttext, + gliner, sentencepiece, + staticvectors, # pipeline-train accelerate, bitsandbytes, @@ -70,6 +76,7 @@ peft, skl2onnx, # vectors + fasttext, # pymagnitude-lite, (unpackaged) scikit-learn, sentence-transformers, @@ -82,12 +89,15 @@ xmltodict, # tests - httpx, msgpack, pytestCheckHook, }: let - version = "8.2.0"; + version = "8.5.0"; + agent = [ + mcpadapt + smolagents + ]; ann = [ annoy hnswlib @@ -98,11 +108,16 @@ let api = [ aiohttp fastapi + fastapi-mcp + httpx pillow python-multipart uvicorn ]; - # cloud = [ apache-libcloud ]; + cloud = [ + # apache-libcloud + fasteners + ]; console = [ rich ]; database = [ duckdb @@ -113,7 +128,6 @@ let # grand-cypher # grand-graph networkx - python-louvain sqlalchemy ]; model = [ @@ -145,8 +159,9 @@ let # llama-cpp-python ]; pipeline-text = [ - fasttext + gliner sentencepiece + staticvectors ]; pipeline-train = [ accelerate @@ -186,7 +201,8 @@ let ]; similarity = ann ++ vectors; all = - api + agent + ++ api ++ ann ++ console ++ database @@ -199,8 +215,10 @@ let optional-dependencies = { inherit + agent ann api + cloud console database graph @@ -222,7 +240,7 @@ let owner = "neuml"; repo = "txtai"; tag = "v${version}"; - hash = "sha256-fMzCYw9eqlpGI5FKoyYyxT17EhUFmFP9lrCn/LFC6ks="; + hash = "sha256-kYjlA7pJ+xCC+tu0aaxziKaPo3hph5Ld8P/lVrip/eM="; }; in buildPythonPackage { @@ -264,8 +282,10 @@ buildPythonPackage { msgpack pytestCheckHook python-multipart + timm sqlalchemy ] + ++ optional-dependencies.agent ++ optional-dependencies.ann ++ optional-dependencies.api ++ optional-dependencies.similarity; @@ -280,9 +300,9 @@ buildPythonPackage { "--deselect=test/python/testconsole.py" "--deselect=test/python/testembeddings.py" "--deselect=test/python/testgraph.py" - "--deselect=test/python/testapi/testembeddings.py" - "--deselect=test/python/testapi/testpipelines.py" - "--deselect=test/python/testapi/testworkflow.py" + "--deselect=test/python/testapi/testapiembeddings.py" + "--deselect=test/python/testapi/testapipipelines.py" + "--deselect=test/python/testapi/testapiworkflow.py" "--deselect=test/python/testdatabase/testclient.py" "--deselect=test/python/testdatabase/testduckdb.py" "--deselect=test/python/testdatabase/testencoder.py" @@ -295,6 +315,7 @@ buildPythonPackage { "testInvalidZip" # Downloads from Huggingface "testPipeline" + "testVectors" # Not finding sqlite-vec despite being supplied "testSQLite" "testSQLiteCustom" From bb60182678c48fec74e70352b083879453ec3e83 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 22 May 2025 01:14:02 +0200 Subject: [PATCH 6/7] python312Packages.fastmcp: init at 2.4.0 --- .../python-modules/fastmcp/default.nix | 73 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 75 insertions(+) create mode 100644 pkgs/development/python-modules/fastmcp/default.nix diff --git a/pkgs/development/python-modules/fastmcp/default.nix b/pkgs/development/python-modules/fastmcp/default.nix new file mode 100644 index 000000000000..d378c0fc9142 --- /dev/null +++ b/pkgs/development/python-modules/fastmcp/default.nix @@ -0,0 +1,73 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + hatchling, + + # dependencies + exceptiongroup, + httpx, + mcp, + openapi-pydantic, + python-dotenv, + rich, + typer, + websockets, + + # tests + dirty-equals, + fastapi, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "fastmcp"; + version = "2.4.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jlowin"; + repo = "fastmcp"; + tag = "v${version}"; + hash = "sha256-F4lgMm/84svLZo6SZ7AubsC73s4tffqjJcd9gvA7hGA="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail ', "uv-dynamic-versioning>=0.7.0"' "" \ + --replace-fail 'dynamic = ["version"]' 'version = "${version}"' + ''; + + build-system = [ + hatchling + ]; + + dependencies = [ + exceptiongroup + httpx + mcp + openapi-pydantic + python-dotenv + rich + typer + websockets + ]; + + pythonImportsCheck = [ "fastmcp" ]; + + nativeCheckInputs = [ + dirty-equals + fastapi + pytestCheckHook + ]; + + meta = { + description = "The fast, Pythonic way to build MCP servers and clients"; + changelog = "https://github.com/jlowin/fastmcp/releases/tag/v${version}"; + homepage = "https://github.com/jlowin/fastmcp"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 79506c4f0975..7d0f4ede1d2a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4841,6 +4841,8 @@ self: super: with self; { fastjsonschema = callPackage ../development/python-modules/fastjsonschema { }; + fastmcp = callPackage ../development/python-modules/fastmcp { }; + fastmri = callPackage ../development/python-modules/fastmri { }; fastnlo-toolkit = toPythonModule ( From 480cd683636fadd26af97523f54e1ac3d74a0c3b Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 22 May 2025 01:11:19 +0200 Subject: [PATCH 7/7] oterm: 0.11.1 -> 0.12.1 Diff: https://github.com/ggozad/oterm/compare/refs/tags/0.11.1...refs/tags/0.12.1 Changelog: https://github.com/ggozad/oterm/releases/tag/0.12.1 --- pkgs/by-name/ot/oterm/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ot/oterm/package.nix b/pkgs/by-name/ot/oterm/package.nix index b6dd44bef0fd..a6edcabadeca 100644 --- a/pkgs/by-name/ot/oterm/package.nix +++ b/pkgs/by-name/ot/oterm/package.nix @@ -9,14 +9,14 @@ python3Packages.buildPythonApplication rec { pname = "oterm"; - version = "0.11.1"; + version = "0.12.1"; pyproject = true; src = fetchFromGitHub { owner = "ggozad"; repo = "oterm"; tag = version; - hash = "sha256-b/+siNzmM6RUJ3jv/2dNJJFueejChKde0D5r8J0lTqM="; + hash = "sha256-6y73Lh3cV/fnvpZWzfyD4CletC4UV2zl+I7l88BYPIk="; }; pythonRelaxDeps = [ @@ -37,8 +37,8 @@ python3Packages.buildPythonApplication rec { aiohttp aiosql aiosqlite + fastmcp httpx - jinja2 mcp ollama packaging