Files
nixpkgs/pkgs/development/python-modules/temporalio/default.nix
2025-07-24 13:55:40 +02:00

90 lines
1.6 KiB
Nix

{
lib,
buildPackages,
buildPythonPackage,
cargo,
fetchFromGitHub,
maturin,
pythonOlder,
poetry-core,
protobuf,
python-dateutil,
rustc,
rustPlatform,
setuptools,
setuptools-rust,
types-protobuf,
typing-extensions,
}:
buildPythonPackage rec {
pname = "temporalio";
version = "1.12.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "temporalio";
repo = "sdk-python";
rev = "refs/tags/${version}";
hash = "sha256-u74zbzYNVxMi0sdiPlBoEU+wAa24JmMksz7hGvraDeM=";
fetchSubmodules = true;
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit
pname
version
src
cargoRoot
;
hash = "sha256-OIapL1+g6gIgyVzdB68PuK2K2RIr01DSm/UbCdt9kNY=";
};
cargoRoot = "temporalio/bridge";
build-system = [
maturin
poetry-core
];
preBuild = ''
export PROTOC=${buildPackages.protobuf}/bin/protoc
'';
dependencies = [
protobuf
types-protobuf
typing-extensions
]
++ lib.optional (pythonOlder "3.11") python-dateutil;
nativeBuildInputs = [
cargo
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
rustc
setuptools
setuptools-rust
];
pythonImportsCheck = [
"temporalio"
"temporalio.bridge.temporal_sdk_bridge"
"temporalio.client"
"temporalio.worker"
];
meta = {
description = "Temporal Python SDK";
homepage = "https://temporal.io/";
changelog = "https://github.com/temporalio/sdk-python/releases/tag/${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
jpds
levigross
];
};
}