1{ lib, python3, fetchFromGitHub, glibcLocales, git }:
2let
3 changeVersion = overrideFunc: version: hash: overrideFunc (oldAttrs: rec {
4 inherit version;
5 src = oldAttrs.src.override {
6 inherit version hash;
7 };
8 });
9
10 localPython = python3.override {
11 self = localPython;
12 packageOverrides = self: super: {
13 cement = changeVersion super.cement.overridePythonAttrs "2.8.2" "sha256-h2XtBSwGHXTk0Bia3cM9Jo3lRMohmyWdeXdB9yXkItI=";
14 };
15 };
16in
17with localPython.pkgs; buildPythonApplication rec {
18 pname = "awsebcli";
19 version = "3.20.10";
20 format = "setuptools";
21
22 src = fetchFromGitHub {
23 owner = "aws";
24 repo = "aws-elastic-beanstalk-cli";
25 rev = "refs/tags/${version}";
26 hash = "sha256-4JZx0iTMyrPHbuS3zlhpiWnenAQO5eSBJbPHUizLhYo=";
27 };
28
29 postPatch = ''
30 # https://github.com/aws/aws-elastic-beanstalk-cli/pull/469
31 substituteInPlace setup.py --replace "scripts=['bin/eb']," ""
32 '';
33
34 nativeBuildInputs = [
35 pythonRelaxDepsHook
36 ];
37
38 buildInputs = [
39 glibcLocales
40 ];
41
42 propagatedBuildInputs = [
43 blessed
44 botocore
45 cement
46 colorama
47 pathspec
48 pyyaml
49 future
50 requests
51 semantic-version
52 setuptools
53 tabulate
54 termcolor
55 websocket-client
56 ];
57
58 pythonRelaxDeps = [
59 "botocore"
60 "colorama"
61 "pathspec"
62 "PyYAML"
63 "six"
64 "termcolor"
65 ];
66
67 nativeCheckInputs = [
68 pytestCheckHook
69 pytest-socket
70 mock
71 git
72 ];
73
74 pytestFlagsArray = [
75 "tests/unit"
76 ];
77
78 disabledTests = [
79 # Needs docker installed to run.
80 "test_local_run"
81 "test_local_run__with_arguments"
82
83 # Needs access to the user's ~/.ssh directory.
84 "test_generate_and_upload_keypair__exit_code_0"
85 "test_generate_and_upload_keypair__exit_code_1"
86 "test_generate_and_upload_keypair__exit_code_is_other_than_1_and_0"
87 "test_generate_and_upload_keypair__ssh_keygen_not_present"
88 ];
89
90 meta = with lib; {
91 homepage = "https://aws.amazon.com/elasticbeanstalk/";
92 description = "A command line interface for Elastic Beanstalk";
93 changelog = "https://github.com/aws/aws-elastic-beanstalk-cli/blob/${version}/CHANGES.rst";
94 maintainers = with maintainers; [ eqyiel kirillrdy ];
95 license = licenses.asl20;
96 mainProgram = "eb";
97 };
98}