1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchFromGitHub,
6 fetchpatch,
7 isPy27,
8 pytestCheckHook,
9 autoconf271,
10 automake,
11 cmake,
12 gcc,
13 libtool,
14 perl,
15 setuptools,
16 simplejson,
17}:
18
19buildPythonPackage rec {
20 pname = "awslambdaric";
21 version = "2.0.10";
22 pyproject = true;
23
24 disabled = isPy27;
25
26 src = fetchFromGitHub {
27 owner = "aws";
28 repo = "aws-lambda-python-runtime-interface-client";
29 rev = "refs/tags/${version}";
30 sha256 = "sha256-tvTN6gV73Qnbe4OBHtfxt4jXV32fMTPE4H79WIkgkxE=";
31 };
32
33 patches = [
34 (fetchpatch {
35 # https://github.com/aws/aws-lambda-python-runtime-interface-client/pull/58
36 url = "https://github.com/aws/aws-lambda-python-runtime-interface-client/commit/162c3c0051bb9daa92e4a2a4af7e90aea60ee405.patch";
37 sha256 = "09qqq5x6npc9jw2qbhzifqn5sqiby4smiin1aw30psmlp21fv7j8";
38 })
39 ];
40
41 postPatch = ''
42 substituteInPlace requirements/base.txt \
43 --replace 'simplejson==3' 'simplejson~=3'
44 '';
45
46 propagatedBuildInputs = [ simplejson ];
47
48 nativeBuildInputs = [
49 autoconf271
50 automake
51 cmake
52 libtool
53 perl
54 setuptools
55 ];
56
57 buildInputs = [ gcc ];
58
59 dontUseCmakeConfigure = true;
60
61 nativeCheckInputs = [ pytestCheckHook ];
62
63 disabledTests = [
64 # Test fails with: Assertion error
65 "test_handle_event_request_fault_exception_logging_syntax_error"
66 ];
67
68 pythonImportsCheck = [
69 "awslambdaric"
70 "runtime_client"
71 ];
72
73 meta = with lib; {
74 broken = (stdenv.isLinux && stdenv.isAarch64);
75 description = "AWS Lambda Runtime Interface Client for Python";
76 homepage = "https://github.com/aws/aws-lambda-python-runtime-interface-client";
77 license = licenses.asl20;
78 maintainers = with maintainers; [ austinbutler ];
79 platforms = platforms.linux;
80 };
81}