1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 psutil,
7 pylibmc,
8 pytest,
9 pytestCheckHook,
10 pythonOlder,
11 requests,
12 setuptools-scm,
13 toml,
14 mysqlclient,
15 zc-lockfile,
16}:
17
18buildPythonPackage rec {
19 pname = "pytest-services";
20 version = "2.2.1";
21 pyproject = true;
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "pytest-dev";
27 repo = "pytest-services";
28 tag = version;
29 hash = "sha256-E/VcKcAb1ekypm5jP4lsSz1LYJTcTSed6i5OY5ihP30=";
30 };
31
32 patches = [
33 # Replace distutils.spawn.find_executable with shutil.which, https://github.com/pytest-dev/pytest-services/pull/46
34 (fetchpatch {
35 name = "replace-distutils.patch";
36 url = "https://github.com/pytest-dev/pytest-services/commit/e0e2a85434a2dcbcc0584299c5b2b751efe0b6db.patch";
37 hash = "sha256-hvr7EedfjfonHDn6v2slwUBqz1xQoF7Ez/kqAhZRXEc=";
38 })
39 ];
40
41 nativeBuildInputs = [
42 setuptools-scm
43 toml
44 ];
45
46 buildInputs = [ pytest ];
47
48 propagatedBuildInputs = [
49 requests
50 psutil
51 zc-lockfile
52 ];
53
54 nativeCheckInputs = [
55 mysqlclient
56 pylibmc
57 pytestCheckHook
58 ];
59
60 pythonImportsCheck = [ "pytest_services" ];
61
62 disabledTests = [
63 # Tests require binaries and additional parts
64 "test_memcached"
65 "test_mysql"
66 "test_xvfb"
67 ];
68
69 # Tests use sockets
70 __darwinAllowLocalNetworking = true;
71
72 meta = with lib; {
73 description = "Services plugin for pytest testing framework";
74 homepage = "https://github.com/pytest-dev/pytest-services";
75 changelog = "https://github.com/pytest-dev/pytest-services/blob/${version}/CHANGES.rst";
76 license = licenses.mit;
77 maintainers = with maintainers; [ dotlambda ];
78 };
79}