back to format=wheel without dist/python hints

This commit is contained in:
2026-05-27 20:17:17 +02:00
parent ef7969273d
commit af28a83009

View File

@@ -1,13 +1,124 @@
{ {
lib, lib,
stdenv, python3Packages,
fetchFromGitHub, fetchFromGitHub,
makeWrapper, fetchPypi,
}: }:
stdenv.mkDerivation rec { let
fetchWheel = { pname, version, hash, propagatedBuildInputs ? [ ], meta ? { } }:
python3Packages.buildPythonPackage {
inherit pname version;
format = "wheel";
src = fetchPypi {
inherit pname version hash;
format = "wheel";
};
inherit propagatedBuildInputs;
doCheck = false;
inherit meta;
};
pythonvcard4 = fetchWheel {
pname = "pythonvcard4"; version = "0.2.0"; hash = lib.fakeHash;
meta = with lib; { description = "vCard parsing library"; homepage = "https://github.com/GNOME/python-vcard4"; license = licenses.gpl3Plus; };
};
prometheus-client = fetchWheel {
pname = "prometheus_client"; version = "0.25.0"; hash = lib.fakeHash;
meta = with lib; { description = "Prometheus client"; homepage = "https://github.com/prometheus/client_python"; license = licenses.asl20; };
};
python-json-logger = fetchWheel {
pname = "python-json-logger"; version = "4.1.0"; hash = lib.fakeHash;
meta = with lib; { description = "JSON logger"; homepage = "https://github.com/nhairs/python-json-logger"; license = licenses.bsd2; };
};
importlib-metadata = fetchWheel {
pname = "importlib_metadata"; version = "8.7.1"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ zipp ];
meta = with lib; { description = "Importlib metadata"; homepage = "https://github.com/python/importlib_metadata"; license = licenses.asl20; };
};
googleapis-common-protos = fetchWheel {
pname = "googleapis-common-protos"; version = "1.75.0"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ protobuf ];
meta = with lib; { description = "Common protos"; homepage = "https://github.com/googleapis/python-api-common-protos"; license = licenses.asl20; };
};
opentelemetry-api = fetchWheel {
pname = "opentelemetry-api"; version = "1.39.1"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ deprecated ];
meta = with lib; { description = "OpenTelemetry API"; homepage = "https://github.com/open-telemetry/opentelemetry-python"; license = licenses.asl20; };
};
opentelemetry-proto = fetchWheel {
pname = "opentelemetry-proto"; version = "1.39.1"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ protobuf ];
meta = with lib; { description = "OpenTelemetry Proto"; homepage = "https://github.com/open-telemetry/opentelemetry-python"; license = licenses.asl20; };
};
opentelemetry-semantic-conventions = fetchWheel {
pname = "opentelemetry-semantic-conventions"; version = "0.60b1"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ deprecated ];
meta = with lib; { description = "OpenTelemetry semconv"; homepage = "https://github.com/open-telemetry/semantic-conventions"; license = licenses.asl20; };
};
opentelemetry-sdk = fetchWheel {
pname = "opentelemetry-sdk"; version = "1.39.1"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ typing-extensions ];
meta = with lib; { description = "OpenTelemetry SDK"; homepage = "https://github.com/open-telemetry/opentelemetry-python"; license = licenses.asl20; };
};
x-wr-timezone = fetchWheel {
pname = "x_wr_timezone"; version = "2.0.1"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ icalendar click ];
meta = with lib; { description = "X-WR-TIMEZONE"; homepage = "https://github.com/niccokunzmann/x-wr-timezone"; license = licenses.lgpl3Plus; };
};
opentelemetry-util-http = fetchWheel {
pname = "opentelemetry-util-http"; version = "0.60b1"; hash = lib.fakeHash;
meta = with lib; { description = "OTel HTTP utils"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib"; license = licenses.asl20; };
};
opentelemetry-exporter-otlp-proto-common = fetchWheel {
pname = "opentelemetry-exporter-otlp-proto-common"; version = "1.39.1"; hash = lib.fakeHash;
meta = with lib; { description = "OTLP proto common"; homepage = "https://github.com/open-telemetry/opentelemetry-python"; license = licenses.asl20; };
};
opentelemetry-instrumentation = fetchWheel {
pname = "opentelemetry-instrumentation"; version = "0.60b1"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ wrapt packaging ];
meta = with lib; { description = "OTel instrumentation"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib"; license = licenses.asl20; };
};
recurring-ical-events = fetchWheel {
pname = "recurring-ical-events"; version = "3.8.2"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ icalendar python-dateutil ];
meta = with lib; { description = "Recurring iCal events"; homepage = "https://github.com/niccokunzmann/python-recurring-ical-events"; license = licenses.lgpl3Plus; };
};
opentelemetry-exporter-otlp-proto-grpc = fetchWheel {
pname = "opentelemetry-exporter-otlp-proto-grpc"; version = "1.39.1"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ grpcio deprecated ];
meta = with lib; { description = "OTLP gRPC exporter"; homepage = "https://github.com/open-telemetry/opentelemetry-python"; license = licenses.asl20; };
};
qdrant-client = fetchWheel {
pname = "qdrant-client"; version = "1.18.0"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ grpcio httpx numpy portalocker protobuf pydantic urllib3 ];
meta = with lib; { description = "Qdrant client"; homepage = "https://github.com/qdrant/qdrant-client"; license = licenses.asl20; };
};
opentelemetry-instrumentation-asgi = fetchWheel {
pname = "opentelemetry-instrumentation-asgi"; version = "0.60b1"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ asgiref ];
meta = with lib; { description = "OTel ASGI"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib"; license = licenses.asl20; };
};
opentelemetry-instrumentation-httpx = fetchWheel {
pname = "opentelemetry-instrumentation-httpx"; version = "0.60b1"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ httpx wrapt ];
meta = with lib; { description = "OTel HTTPX"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib"; license = licenses.asl20; };
};
opentelemetry-instrumentation-logging = fetchWheel {
pname = "opentelemetry-instrumentation-logging"; version = "0.60b1"; hash = lib.fakeHash;
meta = with lib; { description = "OTel logging"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib"; license = licenses.asl20; };
};
langchain-text-splitters = fetchWheel {
pname = "langchain-text-splitters"; version = "1.1.2"; hash = lib.fakeHash;
propagatedBuildInputs = with python3Packages; [ langchain-core ];
meta = with lib; { description = "LangChain text splitters"; homepage = "https://github.com/langchain-ai/langchain"; license = licenses.mit; };
};
in
python3Packages.buildPythonApplication rec {
pname = "nextcloud-mcp-server"; pname = "nextcloud-mcp-server";
version = "0.89.0"; version = "0.89.0";
pyproject = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "cbcoutinho"; owner = "cbcoutinho";
@@ -16,28 +127,45 @@ stdenv.mkDerivation rec {
hash = "sha256-IDTSGsHQ8cCFvgSO7pDbSSHVNV0OIjjoEN9ZfkaPAvk="; hash = "sha256-IDTSGsHQ8cCFvgSO7pDbSSHVNV0OIjjoEN9ZfkaPAvk=";
}; };
nativeBuildInputs = [ makeWrapper ]; build-system = [ python3Packages.hatchling ];
dontBuild = true; dependencies = with python3Packages; [
mcp httpx pillow icalendar pydantic click caldav pyjwt
aiosqlite alembic authlib fastembed anthropic boto3 starlette
jinja2 markdownify pymupdf pymupdf4llm openai dynaconf mistralai sqlalchemy
installPhase = '' pythonvcard4 prometheus-client python-json-logger importlib-metadata
runHook preInstall googleapis-common-protos opentelemetry-api opentelemetry-proto
mkdir -p $out/bin $out/lib/${pname} opentelemetry-semantic-conventions opentelemetry-sdk
x-wr-timezone opentelemetry-util-http opentelemetry-exporter-otlp-proto-common
opentelemetry-instrumentation recurring-ical-events
opentelemetry-exporter-otlp-proto-grpc qdrant-client
opentelemetry-instrumentation-asgi opentelemetry-instrumentation-httpx
opentelemetry-instrumentation-logging langchain-text-splitters
];
# Copy the server code from source postPatch = ''
cp -r nextcloud_mcp_server $out/lib/${pname}/ substituteInPlace pyproject.toml \
--replace-fail '"prometheus-client>=0.21.0"' '"prometheus-client"' \
# The hermes-agent service already has a working venv with all deps --replace-fail '"mcp>=1.27,<1.28"' '"mcp"' \
# Use that Python interpreter (it has PYTHONPATH set by the service env) --replace-fail '"mcp[cli]>=1.27,<1.28"' '"mcp"' \
makeWrapper /var/lib/hermes/.local/share/nextcloud-venv/bin/python $out/bin/${pname} \ --replace-fail '"pymupdf4llm>=0.2.2"' '"pymupdf4llm"' \
--add-flags "-m nextcloud_mcp_server.cli" \ --replace-fail '"pymupdf>=1.26.6"' '"pymupdf"' \
--set PYTHONPATH "$out/lib/${pname}" --replace-fail '"qdrant-client>=1.17.0"' '"qdrant-client"' \
--replace-fail '"opentelemetry-api>=1.28.2"' '"opentelemetry-api"' \
runHook postInstall --replace-fail '"opentelemetry-sdk>=1.28.2"' '"opentelemetry-sdk"' \
--replace-fail '"opentelemetry-instrumentation-asgi>=0.49b2"' '"opentelemetry-instrumentation-asgi"' \
--replace-fail '"opentelemetry-instrumentation-httpx>=0.49b2"' '"opentelemetry-instrumentation-httpx"' \
--replace-fail '"opentelemetry-instrumentation-logging>=0.49b2"' '"opentelemetry-instrumentation-logging"' \
--replace-fail '"opentelemetry-exporter-otlp-proto-grpc>=1.28.2"' '"opentelemetry-exporter-otlp-proto-grpc"' \
--replace-fail '"python-json-logger>=3.2.0"' '"python-json-logger"' \
--replace-fail '"pythonvcard4>=0.2.0"' '"pythonvcard4"'
''; '';
doCheck = false;
meta = with lib; { meta = with lib; {
description = "MCP server for Nextcloud files (WebDAV), calendar (CalDAV), contacts (CardDAV), notes, deck, talk, and sharing"; description = "MCP server for Nextcloud files, calendar, contacts, notes, deck, talk, sharing";
homepage = "https://github.com/cbcoutinho/nextcloud-mcp-server"; homepage = "https://github.com/cbcoutinho/nextcloud-mcp-server";
license = licenses.agpl3Only; license = licenses.agpl3Only;
mainProgram = "nextcloud-mcp-server"; mainProgram = "nextcloud-mcp-server";