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