From 30de55fe83a54f0d35ee50aa2479c86987114ba7 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 16 Apr 2024 22:36:12 +0200 Subject: [PATCH] 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 {