at 24.05-pre 1.7 kB view raw
1{ buildPythonPackage 2, callPackage 3, fetchPypi 4, isPy27 5, lib 6, cryptography 7, grpcio 8, pyyaml 9, grpcio-tools 10, hadoop 11, pytestCheckHook 12, python 13}: 14 15buildPythonPackage rec { 16 pname = "skein"; 17 version = "0.8.2"; 18 src = fetchPypi { 19 inherit pname version; 20 hash = "sha256-nXTqsJNX/LwAglPcPZkmdYPfF+vDLN+nNdZaDFTrHzE="; 21 }; 22 23 # Update this hash if bumping versions 24 jarHash = "sha256-x2KH6tnoG7sogtjrJvUaxy0PCEA8q/zneuI969oBOKo="; 25 skeinJar = callPackage ./skeinjar.nix { inherit pname version jarHash; }; 26 27 propagatedBuildInputs = [ cryptography grpcio pyyaml ]; 28 buildInputs = [ grpcio-tools ]; 29 30 preBuild = '' 31 # Ensure skein.jar exists skips the maven build in setup.py 32 mkdir -p skein/java 33 ln -s ${skeinJar} skein/java/skein.jar 34 ''; 35 36 postPatch = '' 37 substituteInPlace skein/core.py --replace "'yarn'" "'${hadoop}/bin/yarn'" \ 38 --replace "else 'java'" "else '${hadoop.jdk}/bin/java'" 39 ''; 40 41 pythonImportsCheck = [ "skein" ]; 42 43 nativeCheckInputs = [ pytestCheckHook ]; 44 # These tests require connecting to a YARN cluster. They could be done through NixOS tests later. 45 disabledTests = [ 46 "test_ui" 47 "test_tornado" 48 "test_kv" 49 "test_core" 50 "test_cli" 51 ]; 52 53 meta = with lib; { 54 homepage = "https://jcristharif.com/skein"; 55 description = "A tool and library for easily deploying applications on Apache YARN"; 56 license = licenses.bsd3; 57 maintainers = with maintainers; [ alexbiehl illustris ]; 58 # https://github.com/NixOS/nixpkgs/issues/48663#issuecomment-1083031627 59 # replace with https://github.com/NixOS/nixpkgs/pull/140325 once it is merged 60 broken = lib.traceIf isPy27 "${pname} not supported on ${python.executable}" isPy27; 61 }; 62}