From 30de55fe83a54f0d35ee50aa2479c86987114ba7 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 16 Apr 2024 22:36:12 +0200 Subject: [PATCH 1/3] python311Packages.timing-asgi: init at 0.3.1 --- .../python-modules/timing-asgi/default.nix | 48 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/python-modules/timing-asgi/default.nix diff --git a/pkgs/development/python-modules/timing-asgi/default.nix b/pkgs/development/python-modules/timing-asgi/default.nix new file mode 100644 index 000000000000..d1dc1ccc81b4 --- /dev/null +++ b/pkgs/development/python-modules/timing-asgi/default.nix @@ -0,0 +1,48 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, asynctest +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "timing-asgi"; + version = "0.3.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "steinnes"; + repo = "timing-asgi"; + rev = "refs/tags/v${version}"; + hash = "sha256-oEDesmy9t2m51Zd6Zg87qoYbfbDnejfrbjyBkZ3hF58="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail poetry.masonry.api poetry.core.masonry.api \ + --replace-fail "poetry>=" "poetry-core>=" + ''; + + build-system = [ + poetry-core + ]; + + pythonImportsCheck = [ "timing_asgi" ]; + + # Tests rely on asynctest which is not supported by python 3.11 + doCheck = false; + + nativeCheckInputs = [ + # asynctest-0.13.0 not supported for interpreter python3.11 + # asynctest + pytestCheckHook + ]; + + meta = with lib; { + description = "ASGI middleware to emit timing metrics with something like statsd"; + homepage = "https://pypi.org/project/timing-asgi"; + license = licenses.mit; + maintainers = with maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 19f6b9209cab..ffc49941dd29 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15053,6 +15053,8 @@ self: super: with self; { timezonefinder = callPackage ../development/python-modules/timezonefinder { }; + timing-asgi = callPackage ../development/python-modules/timing-asgi { }; + timm = callPackage ../development/python-modules/timm { }; tiny-cuda-nn = toPythonModule (pkgs.tiny-cuda-nn.override { From fb13727a2522b03c48556e7b67f50e158cdef590 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 16 Apr 2024 22:45:07 +0200 Subject: [PATCH 2/3] python311Packages.cloudevents: init at 1.10.1 --- .../python-modules/cloudevents/default.nix | 55 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/cloudevents/default.nix diff --git a/pkgs/development/python-modules/cloudevents/default.nix b/pkgs/development/python-modules/cloudevents/default.nix new file mode 100644 index 000000000000..d54b20975ca3 --- /dev/null +++ b/pkgs/development/python-modules/cloudevents/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, wheel +, deprecation +, flask +, pydantic +, pytestCheckHook +, requests +, sanic +, sanic-testing +}: + +buildPythonPackage rec { + pname = "cloudevents"; + version = "1.10.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "cloudevents"; + repo = "sdk-python"; + rev = "refs/tags/${version}"; + hash = "sha256-YIvEAofWmnUblRd4jV3Zi3VdfocOnD05CMVm/abngyg="; + }; + + build-system = [ + setuptools + wheel + ]; + + pythonImportsCheck = [ "cloudevents" ]; + + nativeCheckInputs = [ + deprecation + flask + pydantic + pytestCheckHook + requests + sanic + sanic-testing + ]; + + disabledTestPaths = [ + "samples/http-image-cloudevents/image_sample_test.py" + ]; + + meta = with lib; { + description = "Python SDK for CloudEvents"; + homepage = "https://github.com/cloudevents/sdk-python"; + changelog = "https://github.com/cloudevents/sdk-python/blob/${src.rev}/CHANGELOG.md"; + license = licenses.asl20; + maintainers = with maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ffc49941dd29..936613089668 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2264,6 +2264,8 @@ self: super: with self; { clldutils = callPackage ../development/python-modules/clldutils { }; + cloudevents = callPackage ../development/python-modules/cloudevents { }; + cloudflare = callPackage ../development/python-modules/cloudflare { }; cloudpathlib = callPackage ../development/python-modules/cloudpathlib { }; From d432a28e0b34c50b637db590da2bdb9bf03bb5e3 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 16 Apr 2024 22:25:04 +0200 Subject: [PATCH 3/3] python311Packages.kserve: init at 0.12.1 --- .../python-modules/kserve/default.nix | 119 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 121 insertions(+) create mode 100644 pkgs/development/python-modules/kserve/default.nix diff --git a/pkgs/development/python-modules/kserve/default.nix b/pkgs/development/python-modules/kserve/default.nix new file mode 100644 index 000000000000..2bbfd3a80761 --- /dev/null +++ b/pkgs/development/python-modules/kserve/default.nix @@ -0,0 +1,119 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, deprecation +, poetry-core +, pythonRelaxDepsHook +, async-timeout +, cloudevents +, fastapi +, grpcio +, httpx +, kubernetes +, numpy +, orjson +, pandas +, prometheus-client +, protobuf +, psutil +, python-dateutil +, ray +, six +, tabulate +, timing-asgi +, uvicorn +, avro +, azure-storage-blob +, azure-storage-file-share +, boto3 +, botocore +, google-cloud-storage +, pytestCheckHook +, tomlkit +}: + +buildPythonPackage rec { + pname = "kserve"; + version = "0.12.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "kserve"; + repo = "kserve"; + rev = "refs/tags/v${version}"; + hash = "sha256-gKJkG8zJY1sGGpI27YZ/QnEPU8J7KHva3nI+JCglQaQ="; + }; + + sourceRoot = "${src.name}/python/kserve"; + + build-system = [ + deprecation + poetry-core + ]; + + nativeBuildInputs = [ + pythonRelaxDepsHook + ]; + + dependencies = [ + async-timeout + cloudevents + fastapi + grpcio + httpx + kubernetes + numpy + orjson + pandas + prometheus-client + protobuf + psutil + python-dateutil + ray + six + tabulate + timing-asgi + uvicorn + ] ++ ray.passthru.optional-dependencies.serve-deps; + + pythonRelaxDeps = [ + "fastapi" + "httpx" + "prometheus-client" + "protobuf" + "ray" + "uvicorn" + ]; + + pythonImportsCheck = [ "kserve" ]; + + nativeCheckInputs = [ + avro + azure-storage-blob + azure-storage-file-share + boto3 + botocore + google-cloud-storage + pytestCheckHook + tomlkit + ]; + + disabledTestPaths = [ + # Looks for a config file at the root of the repository + "test/test_inference_service_client.py" + ]; + + disabledTests = [ + # Require network access + "test_health_handler" + "test_infer" + "test_infer_v2" + ]; + + meta = with lib; { + description = "Standardized Serverless ML Inference Platform on Kubernetes"; + homepage = "https://github.com/kserve/kserve/tree/master/python/kserve"; + license = licenses.asl20; + maintainers = with maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 936613089668..65522f75cefd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6409,6 +6409,8 @@ self: super: with self; { krfzf-py = callPackage ../development/python-modules/krfzf-py { }; + kserve = callPackage ../development/python-modules/kserve { }; + kubernetes = callPackage ../development/python-modules/kubernetes { }; kurbopy = callPackage ../development/python-modules/kurbopy { };