diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pytest-services/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pytest-services/default.nix | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pytest-services/default.nix b/nixpkgs/pkgs/development/python-modules/pytest-services/default.nix index 91094c81ab41..0b6a8f8f87b5 100644 --- a/nixpkgs/pkgs/development/python-modules/pytest-services/default.nix +++ b/nixpkgs/pkgs/development/python-modules/pytest-services/default.nix @@ -1,25 +1,43 @@ { lib , buildPythonPackage -, fetchPypi -, isPy3k -, requests +, fetchFromGitHub +, fetchpatch , psutil +, pylibmc , pytest +, pytestCheckHook +, pythonOlder +, requests +, setuptools , setuptools-scm , toml +, mysqlclient , zc-lockfile }: buildPythonPackage rec { pname = "pytest-services"; version = "2.2.1"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - sha256 = "2da740487d08ea63dfdf718f5d4ba11e590c99ddf5481549edebf7a3a42ca536"; + src = fetchFromGitHub { + owner = "pytest-dev"; + repo = "pytest-services"; + rev = "refs/tags/${version}"; + hash = "sha256-E/VcKcAb1ekypm5jP4lsSz1LYJTcTSed6i5OY5ihP30="; }; + patches = [ + # Replace distutils.spawn.find_executable with shutil.which, https://github.com/pytest-dev/pytest-services/pull/46 + (fetchpatch { + name = "replace-distutils.patch"; + url = "https://github.com/pytest-dev/pytest-services/commit/e0e2a85434a2dcbcc0584299c5b2b751efe0b6db.patch"; + hash = "sha256-hvr7EedfjfonHDn6v2slwUBqz1xQoF7Ez/kqAhZRXEc="; + }) + ]; + nativeBuildInputs = [ setuptools-scm toml @@ -33,14 +51,27 @@ buildPythonPackage rec { zc-lockfile ]; - # no tests in PyPI tarball - doCheck = false; + nativeCheckInputs = [ + mysqlclient + pylibmc + pytestCheckHook + ]; + + pythonImportsCheck = [ + "pytest_services" + ]; - pythonImportsCheck = [ "pytest_services" ]; + disabledTests = [ + # Tests require binaries and additional parts + "test_memcached" + "test_mysql" + "test_xvfb " + ]; meta = with lib; { description = "Services plugin for pytest testing framework"; homepage = "https://github.com/pytest-dev/pytest-services"; + changelog = "https://github.com/pytest-dev/pytest-services/blob/${version}/CHANGES.rst"; license = licenses.mit; maintainers = with maintainers; [ dotlambda ]; }; |