From 51ba392a7bae0619d373858ca228c4b217df3885 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Sun, 3 Nov 2024 21:34:19 +0000 Subject: [PATCH] python3Packages.temporalio: init at 1.8.0 --- .../python-modules/temporalio/default.nix | 74 +++++++++++++++++++ .../temporalio/protoc-wheel-removal.diff | 8 ++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 84 insertions(+) create mode 100644 pkgs/development/python-modules/temporalio/default.nix create mode 100644 pkgs/development/python-modules/temporalio/protoc-wheel-removal.diff diff --git a/pkgs/development/python-modules/temporalio/default.nix b/pkgs/development/python-modules/temporalio/default.nix new file mode 100644 index 0000000000000..374591397e35e --- /dev/null +++ b/pkgs/development/python-modules/temporalio/default.nix @@ -0,0 +1,74 @@ +{ + lib, + stdenv, + buildPythonPackage, + cargo, + fetchFromGitHub, + pythonOlder, + poetry-core, + protobuf, + python-dateutil, + rustc, + rustPlatform, + setuptools, + setuptools-rust, + types-protobuf, + typing-extensions, +}: + +buildPythonPackage rec { + pname = "temporalio"; + version = "1.8.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "temporalio"; + repo = "sdk-python"; + rev = "refs/tags/${version}"; + hash = "sha256-xJIb+U3hV6DDvfbfY20U/4rE2z0XzaESkehtcvG6m50="; + fetchSubmodules = true; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + sourceRoot = "${src.name}/${cargoRoot}"; + hash = "sha256-+A226LfxqmUA/CMXwx8osgIRJhfKtB8KcCSBkbbXOHk="; + }; + + cargoRoot = "temporalio/bridge"; + + patches = [ ./protoc-wheel-removal.diff ]; + + build-system = [ + poetry-core + setuptools + setuptools-rust + ]; + + dependencies = [ + protobuf + python-dateutil + types-protobuf + ]; + + nativeBuildInputs = [ + cargo + rustPlatform.cargoSetupHook + rustc + ]; + + propagatedBuildInputs = [ typing-extensions ]; + + pythonImportsCheck = [ + "temporalio" + "temporalio.client" + "temporalio.worker" + ]; + + meta = { + description = "Temporal Python SDK"; + homepage = "https://temporal.io/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ jpds ]; + }; +} diff --git a/pkgs/development/python-modules/temporalio/protoc-wheel-removal.diff b/pkgs/development/python-modules/temporalio/protoc-wheel-removal.diff new file mode 100644 index 0000000000000..3ca612fb93e90 --- /dev/null +++ b/pkgs/development/python-modules/temporalio/protoc-wheel-removal.diff @@ -0,0 +1,8 @@ +--- ./pyproject.toml 2024-10-30 22:07:04.852594423 +0000 ++++ ./pyproject.toml 2024-10-30 22:07:16.851578125 +0000 +@@ -215,4 +215,4 @@ target-version = "py38" + + [build-system] + build-backend = "poetry.core.masonry.api" +-requires = ["poetry-core>=1.0.0", "setuptools", "wheel", "setuptools-rust", "protoc-wheel-0"] ++requires = ["poetry-core>=1.0.0", "setuptools", "wheel", "setuptools-rust"] diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1cc47777528b9..8c9762e774503 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15493,6 +15493,8 @@ self: super: with self; { tempora = callPackage ../development/python-modules/tempora { }; + temporalio = callPackage ../development/python-modules/temporalio { }; + tenacity = callPackage ../development/python-modules/tenacity { }; tencentcloud-sdk-python = callPackage ../development/python-modules/tencentcloud-sdk-python { };