1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 setuptools,
7 urllib3,
8 dnspython,
9 pytestCheckHook,
10 etcd_3_4,
11 mock,
12 pyopenssl,
13}:
14
15buildPythonPackage {
16 pname = "python-etcd";
17 version = "0.5.0-unstable-2023-10-31";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "jplana";
22 repo = "python-etcd";
23 rev = "5aea0fd4461bd05dd96e4ad637f6be7bceb1cee5";
24 hash = "sha256-eVirStLOPTbf860jfkNMWtGf+r0VygLZRjRDjBMCVKg=";
25 };
26
27 build-system = [ setuptools ];
28
29 dependencies = [
30 urllib3
31 dnspython
32 ];
33
34 nativeCheckInputs = [
35 pytestCheckHook
36 etcd_3_4
37 mock
38 pyopenssl
39 ];
40
41 # arm64 is an unsupported platform on etcd 3.4. should be able to be removed on >= etcd 3.5
42 doCheck = !stdenv.hostPlatform.isAarch64;
43
44 preCheck = ''
45 for file in "test_auth" "integration/test_simple"; do
46 substituteInPlace src/etcd/tests/$file.py \
47 --replace-fail "assertEquals" "assertEqual"
48 done
49 '';
50
51 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
52 # Seems to be failing because of network restrictions
53 # AttributeError: Can't get local object 'TestWatch.test_watch_indexed_generator.<locals>.watch_value'
54 "test_watch"
55 "test_watch_generator"
56 "test_watch_indexed"
57 "test_watch_indexed_generator"
58 ];
59
60 __darwinAllowLocalNetworking = true;
61
62 meta = {
63 description = "Python client for Etcd";
64 homepage = "https://github.com/jplana/python-etcd";
65 license = lib.licenses.mit;
66 };
67}