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