Skip to content

Commit 4242704

Browse files
committed
nix: add package python-glanceclient
Signed-off-by: Paul Kroeher <paul.kroeher@cyberus-technology.de> On-behalf-of: SAP paul.kroeher@sap.com
1 parent a45070a commit 4242704

3 files changed

Lines changed: 110 additions & 3 deletions

File tree

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
};
6060
};
6161

62-
packages = import ./packages { inherit (pkgs) callPackage python3Packages; };
62+
packages = import ./packages { inherit (pkgs) callPackage python3Packages writeText lib; };
6363

6464
checks = import ./checks { inherit pkgs pre-commit-hooks-run; };
6565

packages/default.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ callPackage, python3Packages }:
1+
{ callPackage, python3Packages, writeText, lib }:
22
let
33
# In the past, the packages was not ready for the latest python interpreter.
44
# Since every package is required to use the same python interpreter, we set
@@ -736,11 +736,14 @@ let
736736
reno
737737
;
738738
};
739-
python-glanceclient = python3Packages.python-glanceclient.override {
739+
python-glanceclient = callPackage ./python-glanceclient.nix {
740740
inherit
741741
keystoneauth1
742+
openstacksdk
742743
oslo-i18n
743744
oslo-utils
745+
writeText
746+
lib
744747
;
745748
};
746749
python-keystoneclient = callPackage ./python-keystoneclient.nix {

packages/python-glanceclient.nix

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
fetchPypi,
3+
keystoneauth1,
4+
lib,
5+
openstacksdk,
6+
oslo-i18n,
7+
oslo-utils,
8+
python3Packages,
9+
writeText,
10+
}:
11+
let
12+
inherit (python3Packages)
13+
ddt
14+
pbr
15+
prettytable
16+
pyopenssl
17+
requests
18+
requests-mock
19+
stestr
20+
testscenarios
21+
warlock
22+
wrapt
23+
;
24+
25+
disabledTests = [
26+
# Skip tests which require networking.
27+
"test_http_chunked_response"
28+
"test_v1_download_has_no_stray_output_to_stdout"
29+
"test_v2_requests_valid_cert_verification"
30+
"test_download_has_no_stray_output_to_stdout"
31+
"test_v1_requests_cert_verification_no_compression"
32+
"test_v1_requests_cert_verification"
33+
"test_v2_download_has_no_stray_output_to_stdout"
34+
"test_v2_requests_bad_ca"
35+
"test_v2_requests_bad_cert"
36+
"test_v2_requests_cert_verification_no_compression"
37+
"test_v2_requests_cert_verification"
38+
"test_v2_requests_valid_cert_no_key"
39+
"test_v2_requests_valid_cert_verification_no_compression"
40+
"test_log_request_id_once"
41+
# asserts exact amount of mock calls
42+
"test_cache_schemas_gets_when_forced"
43+
"test_cache_schemas_gets_when_not_exists"
44+
# binary dosn't exist in nixos: /bin/echo
45+
"test_image_update_data_is_read_from_pipe"
46+
];
47+
in
48+
python3Packages.buildPythonPackage rec {
49+
pname = "python-glanceclient";
50+
version = "4.7.0";
51+
52+
src = fetchPypi {
53+
inherit pname version;
54+
sha256 = "sha256-wZRS7xLaPEhLadIqiIznp0kQvbh4O76RJIxg76U3iBA=";
55+
};
56+
57+
pyproject = true;
58+
build-system = [
59+
python3Packages.pbr
60+
python3Packages.setuptools
61+
];
62+
63+
propagatedBuildInputs = [
64+
keystoneauth1
65+
oslo-i18n
66+
oslo-utils
67+
pbr
68+
prettytable
69+
pyopenssl
70+
requests
71+
warlock
72+
wrapt
73+
];
74+
75+
nativeCheckInputs = [
76+
ddt
77+
openstacksdk
78+
requests-mock
79+
stestr
80+
testscenarios
81+
];
82+
83+
checkInputs = [
84+
ddt
85+
keystoneauth1
86+
oslo-i18n
87+
oslo-utils
88+
pbr
89+
prettytable
90+
pyopenssl
91+
requests
92+
requests-mock
93+
testscenarios
94+
warlock
95+
wrapt
96+
];
97+
98+
checkPhase = ''
99+
runHook preCheck
100+
stestr run -e ${writeText "disabled-tests" (lib.concatStringsSep "\n" disabledTests)}
101+
runHook postCheck
102+
'';
103+
104+
}

0 commit comments

Comments
 (0)