Skip to content

Commit 294b246

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 fbfb902 commit 294b246

3 files changed

Lines changed: 122 additions & 3 deletions

File tree

flake.nix

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

62-
packages = import ./packages { inherit (pkgs) callPackage python3Packages; };
62+
packages = import ./packages {
63+
inherit (pkgs)
64+
callPackage
65+
python3Packages
66+
writeText
67+
lib
68+
;
69+
};
6370

6471
checks = import ./checks { inherit pkgs pre-commit-hooks-run; };
6572

packages/default.nix

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{ callPackage, python3Packages }:
1+
{
2+
callPackage,
3+
python3Packages,
4+
writeText,
5+
lib,
6+
}:
27
let
38
# In the past, the packages was not ready for the latest python interpreter.
49
# Since every package is required to use the same python interpreter, we set
@@ -736,11 +741,14 @@ let
736741
reno
737742
;
738743
};
739-
python-glanceclient = python3Packages.python-glanceclient.override {
744+
python-glanceclient = callPackage ./python-glanceclient.nix {
740745
inherit
741746
keystoneauth1
747+
openstacksdk
742748
oslo-i18n
743749
oslo-utils
750+
writeText
751+
lib
744752
;
745753
};
746754
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)