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";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "3.3.1";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-10-30 15:09:59 +00:00
|
|
|
hash = "sha256-6Z+n3pK+QGiEv9gxwyuTBqOpneRM/Dmi7vtu0HRF1fo=";
|
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
|
|
|
};
|
|
|
|
}
|