diff --git a/pkgs/development/python-modules/functions-framework/default.nix b/pkgs/development/python-modules/functions-framework/default.nix new file mode 100644 index 000000000000..b9df27a48b5f --- /dev/null +++ b/pkgs/development/python-modules/functions-framework/default.nix @@ -0,0 +1,66 @@ +{ + lib, + buildPythonPackage, + click, + cloudevents, + deprecation, + docker, + fetchFromGitHub, + flask, + gunicorn, + pretend, + pytest-asyncio, + pytestCheckHook, + requests, + setuptools, + watchdog, + werkzeug, +}: + +buildPythonPackage rec { + pname = "functions-framework"; + version = "3.8.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "GoogleCloudPlatform"; + repo = "functions-framework-python"; + rev = "v${version}"; + hash = "sha256-wLL8VWhRb3AEa41DO/mwx3G0AwmLACiXeDvo+LEq1xM="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + click + cloudevents + deprecation + flask + gunicorn + watchdog + werkzeug + ]; + + nativeCheckInputs = [ + docker + pretend + pytest-asyncio + pytestCheckHook + requests + ]; + + disabledTests = [ + # Test requires a running Docker instance + "test_cloud_run_http" + ]; + + pythonImportsCheck = [ "functions_framework" ]; + + meta = { + description = "FaaS (Function as a service) framework for writing portable Python functions"; + homepage = "https://github.com/GoogleCloudPlatform/functions-framework-python"; + changelog = "https://github.com/GoogleCloudPlatform/functions-framework-python/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 459ee752b591..d94f41331e8a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5113,6 +5113,8 @@ self: super: with self; { funcsigs = callPackage ../development/python-modules/funcsigs { }; + functions-framework = callPackage ../development/python-modules/functions-framework { }; + functiontrace = callPackage ../development/python-modules/functiontrace { }; funcy = callPackage ../development/python-modules/funcy { };