1{ lib
2, fetchFromGitHub
3, python3
4}:
5
6let
7 py = python3.override {
8 packageOverrides = self: super: {
9
10 click = super.click.overridePythonAttrs (oldAttrs: rec {
11 version = "7.1.2";
12
13 src = oldAttrs.src.override {
14 inherit version;
15 hash = "sha256-0rUlXHxjSbwb0eWeCM0SrLvWPOZJ8liHVXg6qU37axo=";
16 sha256 = "";
17 };
18 disabledTests = [ "test_bytes_args" ]; # https://github.com/pallets/click/commit/6e05e1fa1c2804
19 });
20
21 jmespath = super.jmespath.overridePythonAttrs (oldAttrs: rec {
22 version = "0.10.0";
23 src = oldAttrs.src.override {
24 inherit version;
25 sha256 = "b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9";
26 hash = "";
27 };
28 doCheck = false;
29 });
30
31 };
32 };
33in
34with py.pkgs;
35
36buildPythonApplication rec {
37 pname = "oci-cli";
38 version = "3.14.0";
39 format = "setuptools";
40
41 src = fetchFromGitHub {
42 owner = "oracle";
43 repo = pname;
44 rev = "v${version}";
45 hash = "sha256-yooEZuSIw2EMJVyT/Z/x4hJi8a1F674CtsMMGkMAYLg=";
46 };
47
48 propagatedBuildInputs = [
49 arrow
50 certifi
51 click
52 cryptography
53 jmespath
54 oci
55 prompt-toolkit
56 pyopenssl
57 python-dateutil
58 pytz
59 pyyaml
60 retrying
61 six
62 terminaltables
63 ];
64
65 postPatch = ''
66 substituteInPlace setup.py \
67 --replace "cryptography>=3.2.1,<=37.0.2" "cryptography" \
68 --replace "pyOpenSSL>=17.5.0,<=22.0.0" "pyOpenSSL" \
69 --replace "PyYAML>=5.4,<6" "PyYAML" \
70 --replace "prompt-toolkit==3.0.29" "prompt-toolkit" \
71 --replace "terminaltables==3.1.0" "terminaltables" \
72 --replace "oci==2.78.0" "oci"
73 '';
74
75 # https://github.com/oracle/oci-cli/issues/187
76 doCheck = false;
77
78 pythonImportsCheck = [
79 " oci_cli "
80 ];
81
82 meta = with lib; {
83 description = "Command Line Interface for Oracle Cloud Infrastructure";
84 homepage = "https://docs.cloud.oracle.com/iaas/Content/API/Concepts/cliconcepts.htm";
85 license = with licenses; [ asl20 /* or */ upl ];
86 maintainers = with maintainers; [ ilian ];
87 };
88}