2022-01-13 20:06:32 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, cloudpickle
|
|
|
|
, crcmod
|
|
|
|
, cython
|
|
|
|
, dill
|
|
|
|
, fastavro
|
2023-02-09 11:40:11 +00:00
|
|
|
, fasteners
|
2022-01-13 20:06:32 +00:00
|
|
|
, fetchFromGitHub
|
2022-11-21 17:40:18 +00:00
|
|
|
, fetchpatch
|
2022-01-13 20:06:32 +00:00
|
|
|
, freezegun
|
|
|
|
, grpcio
|
|
|
|
, grpcio-tools
|
|
|
|
, hdfs
|
|
|
|
, httplib2
|
2023-02-09 11:40:11 +00:00
|
|
|
, hypothesis
|
2022-01-13 20:06:32 +00:00
|
|
|
, lib
|
|
|
|
, mock
|
|
|
|
, mypy-protobuf
|
|
|
|
, numpy
|
2023-02-09 11:40:11 +00:00
|
|
|
, objsize
|
2022-01-13 20:06:32 +00:00
|
|
|
, orjson
|
|
|
|
, pandas
|
|
|
|
, parameterized
|
|
|
|
, proto-plus
|
|
|
|
, protobuf
|
|
|
|
, psycopg2
|
|
|
|
, pyarrow
|
|
|
|
, pydot
|
|
|
|
, pyhamcrest
|
|
|
|
, pymongo
|
2023-02-09 11:40:11 +00:00
|
|
|
, pytest-xdist
|
2022-01-13 20:06:32 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, python
|
|
|
|
, python-dateutil
|
2022-10-30 15:09:59 +00:00
|
|
|
, pythonRelaxDepsHook
|
2022-01-13 20:06:32 +00:00
|
|
|
, pytz
|
|
|
|
, pyyaml
|
2023-02-09 11:40:11 +00:00
|
|
|
, regex
|
2022-01-13 20:06:32 +00:00
|
|
|
, requests
|
|
|
|
, requests-mock
|
2022-10-30 15:09:59 +00:00
|
|
|
, scikit-learn
|
2022-01-13 20:06:32 +00:00
|
|
|
, sqlalchemy
|
|
|
|
, tenacity
|
2022-08-12 12:06:08 +00:00
|
|
|
, testcontainers
|
2022-10-30 15:09:59 +00:00
|
|
|
, typing-extensions
|
2023-02-09 11:40:11 +00:00
|
|
|
, zstandard
|
2022-10-30 15:09:59 +00:00
|
|
|
}:
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "apache-beam";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "2.45.0";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "apache";
|
|
|
|
repo = "beam";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-e+6Vt+SlOxi16udsdx7WFoDWYupuXhggpoEZPe4tPr0=";
|
2022-01-13 20:06:32 +00:00
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# https://github.com/apache/beam/pull/24143
|
|
|
|
name = "fix-for-dill-0.3.6.patch";
|
|
|
|
url = "https://github.com/apache/beam/commit/7e014435b816015d21cc07f3f6c80809f3d8023d.patch";
|
|
|
|
hash = "sha256-iUmnzrItTFM98w3mpadzrmtI3t0fucpSujAg/6qxCGk=";
|
|
|
|
stripLen = 2;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/156957
|
|
|
|
"dill"
|
|
|
|
"numpy"
|
|
|
|
"pymongo"
|
|
|
|
|
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/193613
|
|
|
|
"protobuf"
|
2023-02-09 11:40:11 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
# As of apache-beam v2.45.0, the requirement is httplib2>=0.8,<0.21.0, but
|
2023-02-09 11:40:11 +00:00
|
|
|
# the current (2023-02-08) nixpkgs's httplib2 version is 0.21.0. This can be
|
|
|
|
# removed once beam is upgraded since the current requirement on master is
|
|
|
|
# for httplib2>=0.8,<0.22.0.
|
|
|
|
"httplib2"
|
2023-03-04 12:14:45 +00:00
|
|
|
|
|
|
|
# As of apache-beam v2.45.0, the requirement is pyarrow<10.0.0,>=0.15.1, but
|
|
|
|
# the current (2023-02-22) nixpkgs's pyarrow version is 11.0.0.
|
|
|
|
"pyarrow"
|
2022-10-30 15:09:59 +00:00
|
|
|
];
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
sourceRoot = "source/sdks/python";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
grpcio-tools
|
|
|
|
mypy-protobuf
|
2022-10-30 15:09:59 +00:00
|
|
|
pythonRelaxDepsHook
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cloudpickle
|
|
|
|
crcmod
|
|
|
|
dill
|
|
|
|
fastavro
|
2023-02-09 11:40:11 +00:00
|
|
|
fasteners
|
2022-01-13 20:06:32 +00:00
|
|
|
grpcio
|
|
|
|
hdfs
|
|
|
|
httplib2
|
|
|
|
numpy
|
2023-02-09 11:40:11 +00:00
|
|
|
objsize
|
2022-01-13 20:06:32 +00:00
|
|
|
orjson
|
|
|
|
proto-plus
|
|
|
|
protobuf
|
|
|
|
pyarrow
|
|
|
|
pydot
|
|
|
|
pymongo
|
|
|
|
python-dateutil
|
|
|
|
pytz
|
2023-02-09 11:40:11 +00:00
|
|
|
regex
|
2022-01-13 20:06:32 +00:00
|
|
|
requests
|
|
|
|
typing-extensions
|
2023-02-09 11:40:11 +00:00
|
|
|
zstandard
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"apache_beam"
|
|
|
|
];
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
checkInputs = [
|
2022-01-13 20:06:32 +00:00
|
|
|
freezegun
|
2023-02-09 11:40:11 +00:00
|
|
|
hypothesis
|
2022-01-13 20:06:32 +00:00
|
|
|
mock
|
|
|
|
pandas
|
|
|
|
parameterized
|
|
|
|
psycopg2
|
|
|
|
pyhamcrest
|
|
|
|
pytestCheckHook
|
2023-02-09 11:40:11 +00:00
|
|
|
pytest-xdist
|
2022-01-13 20:06:32 +00:00
|
|
|
pyyaml
|
|
|
|
requests-mock
|
2022-07-18 16:21:45 +00:00
|
|
|
scikit-learn
|
2022-01-13 20:06:32 +00:00
|
|
|
sqlalchemy
|
|
|
|
tenacity
|
2022-08-12 12:06:08 +00:00
|
|
|
testcontainers
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Make sure we're running the tests for the actually installed
|
|
|
|
# package, so that cython's .so files are available.
|
|
|
|
preCheck = "cd $out/lib/${python.libPrefix}/site-packages";
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
2022-04-15 01:41:22 +00:00
|
|
|
# Fails with
|
|
|
|
# _______ ERROR collecting apache_beam/io/external/xlang_jdbcio_it_test.py _______
|
|
|
|
# apache_beam/io/external/xlang_jdbcio_it_test.py:80: in <module>
|
|
|
|
# class CrossLanguageJdbcIOTest(unittest.TestCase):
|
|
|
|
# apache_beam/io/external/xlang_jdbcio_it_test.py:99: in CrossLanguageJdbcIOTest
|
|
|
|
# container_init: Callable[[], Union[PostgresContainer, MySqlContainer]],
|
|
|
|
# E NameError: name 'MySqlContainer' is not defined
|
|
|
|
#
|
|
|
|
"apache_beam/io/external/xlang_jdbcio_it_test.py"
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
# These tests depend on the availability of specific servers backends.
|
|
|
|
"apache_beam/runners/portability/flink_runner_test.py"
|
|
|
|
"apache_beam/runners/portability/samza_runner_test.py"
|
|
|
|
"apache_beam/runners/portability/spark_runner_test.py"
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
# Fails starting from dill 0.3.6 because it tries to pickle pytest globals:
|
|
|
|
# https://github.com/uqfoundation/dill/issues/482#issuecomment-1139017499.
|
|
|
|
"apache_beam/transforms/window_test.py"
|
2023-02-09 11:40:11 +00:00
|
|
|
|
|
|
|
# See https://github.com/apache/beam/issues/25390.
|
|
|
|
"apache_beam/coders/slow_coders_test.py"
|
|
|
|
"apache_beam/dataframe/pandas_doctests_test.py"
|
|
|
|
"apache_beam/typehints/typed_pipeline_test.py"
|
|
|
|
"apache_beam/coders/fast_coders_test.py"
|
|
|
|
"apache_beam/dataframe/schemas_test.py"
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# The reasons of failures for these tests are unclear.
|
|
|
|
# They reproduce in Docker with Ubuntu 22.04
|
|
|
|
# (= they're not `nixpkgs`-specific) but given the upstream uses
|
|
|
|
# quite elaborate testing infra with containers and multiple
|
|
|
|
# different runners - I don't expect them to help debugging these
|
|
|
|
# when running via our (= custom from their PoV) testing infra.
|
|
|
|
"test_with_main_session"
|
2022-07-18 16:21:45 +00:00
|
|
|
# AssertionErrors
|
|
|
|
"test_unified_repr"
|
|
|
|
"testDictComprehension"
|
|
|
|
"testDictComprehensionSimple"
|
|
|
|
"testGenerator"
|
|
|
|
"testGeneratorComprehension"
|
|
|
|
"testListComprehension"
|
|
|
|
"testNoneReturn"
|
|
|
|
"testSet"
|
|
|
|
"testTupleListComprehension"
|
|
|
|
"test_newtype"
|
|
|
|
"test_pardo_type_inference"
|
|
|
|
"test_get_output_batch_type"
|
|
|
|
"test_pformat_namedtuple_with_unnamed_fields"
|
|
|
|
"test_row_coder_fail_early_bad_schema"
|
2023-03-30 22:05:00 +00:00
|
|
|
# See https://github.com/apache/beam/issues/26004.
|
|
|
|
"test_batch_encode_decode"
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Unified model for defining both batch and streaming data-parallel processing pipelines";
|
|
|
|
homepage = "https://beam.apache.org/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ndl ];
|
|
|
|
};
|
|
|
|
}
|