2021-10-17 09:34:42 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2022-10-30 15:09:59 +00:00
|
|
|
, numpy
|
|
|
|
, pandas
|
2021-10-17 09:34:42 +00:00
|
|
|
, py4j
|
2022-10-30 15:09:59 +00:00
|
|
|
, pyarrow
|
|
|
|
, pythonOlder
|
2021-10-17 09:34:42 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyspark";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "3.5.0";
|
2022-10-30 15:09:59 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-1Bqbdr0qyjcKYQDQdcAp4iukTFlAknh36UNaOpxWZVg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# pypandoc is broken with pandoc2, so we just lose docs.
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "s/'pypandoc'//" setup.py
|
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
substituteInPlace setup.py \
|
2022-09-30 11:47:45 +00:00
|
|
|
--replace py4j== 'py4j>='
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
py4j
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
ml = [
|
|
|
|
numpy
|
|
|
|
];
|
|
|
|
mllib = [
|
|
|
|
numpy
|
|
|
|
];
|
|
|
|
sql = [
|
|
|
|
numpy
|
|
|
|
pandas
|
|
|
|
pyarrow
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
# Tests assume running spark instance
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyspark"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-10-17 09:34:42 +00:00
|
|
|
description = "Python bindings for Apache Spark";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/apache/spark/tree/master/python";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryBytecode
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2022-10-30 15:09:59 +00:00
|
|
|
maintainers = with maintainers; [ shlevy ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|