From 84193256b53f6ebae225edc4086effeae1c3929c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 28 Mar 2024 14:14:27 +0100 Subject: [PATCH] python312Packages.starlette-context: init at 0.3.6 Middleware for Starlette that allows you to store and access the context data of a request https://github.com/tomwojcik/starlette-context --- .../starlette-context/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/starlette-context/default.nix diff --git a/pkgs/development/python-modules/starlette-context/default.nix b/pkgs/development/python-modules/starlette-context/default.nix new file mode 100644 index 000000000000..2657e9740a60 --- /dev/null +++ b/pkgs/development/python-modules/starlette-context/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, httpx +, poetry-core +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, starlette +}: + +buildPythonPackage rec { + pname = "starlette-context"; + version = "0.3.6"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "tomwojcik"; + repo = "starlette-context"; + rev = "refs/tags/v${version}"; + hash = "sha256-ZKwE2M86clYKdptd0o/j8VYUOj/Y/72uUnpxFbJ65vw="; + }; + + build-system = [ + poetry-core + ]; + + dependencies = [ + starlette + ]; + + nativeCheckInputs = [ + httpx + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ + "starlette_context" + ]; + + meta = with lib; { + description = "Middleware for Starlette that allows you to store and access the context data of a request"; + homepage = "https://github.com/tomwojcik/starlette-context"; + changelog = "https://github.com/tomwojcik/starlette-context/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2209f7386643..450e1105b8b5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14234,6 +14234,8 @@ self: super: with self; { starlette = callPackage ../development/python-modules/starlette { }; + starlette-context = callPackage ../development/python-modules/starlette-context { }; + starlette-wtf = callPackage ../development/python-modules/starlette-wtf { }; starkbank-ecdsa = callPackage ../development/python-modules/starkbank-ecdsa { };