12 buildPythonPackage rec {
15 format = "setuptools";
17 disabled = pythonOlder "3.7";
20 inherit pname version;
21 hash = "sha256-3WVp5Uc2Xq3E+Ie/V/FT5NWCpoxLSQ3kddVbmYFmSRA=";
24 # pypandoc is broken with pandoc2, so we just lose docs.
26 sed -i "s/'pypandoc'//" setup.py
28 substituteInPlace setup.py \
29 --replace py4j== 'py4j>='
33 # find_python_home.py has been wrapped as a shell script
34 substituteInPlace $out/bin/find-spark-home \
35 --replace 'export SPARK_HOME=$($PYSPARK_DRIVER_PYTHON "$FIND_SPARK_HOME_PYTHON_SCRIPT")' \
36 'export SPARK_HOME=$("$FIND_SPARK_HOME_PYTHON_SCRIPT")'
37 # patch PYTHONPATH in pyspark so that it properly looks at SPARK_HOME
38 substituteInPlace $out/bin/pyspark \
39 --replace 'export PYTHONPATH="''${SPARK_HOME}/python/:$PYTHONPATH"' \
40 'export PYTHONPATH="''${SPARK_HOME}/..:''${SPARK_HOME}/python/:$PYTHONPATH"'
43 propagatedBuildInputs = [ py4j ];
45 optional-dependencies = {
55 # Tests assume running spark instance
58 pythonImportsCheck = [ "pyspark" ];
61 description = "Python bindings for Apache Spark";
62 homepage = "https://github.com/apache/spark/tree/master/python";
63 sourceProvenance = with sourceTypes; [
67 license = licenses.asl20;
68 maintainers = with maintainers; [ shlevy ];