From bb60182678c48fec74e70352b083879453ec3e83 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 22 May 2025 01:14:02 +0200 Subject: [PATCH] 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 (