about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pytest-services/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-03-24 11:04:41 +0100
committerAlyssa Ross <hi@alyssa.is>2024-03-24 11:04:41 +0100
commit5423cabbbf2b6dec5568f1ecabd288d5d9a642ec (patch)
treef316a6a921bfefd3a63bd4502c2eb50ff1644f67 /nixpkgs/pkgs/development/python-modules/pytest-services/default.nix
parent46a88117a05c3469af5d99433af140c3de8ca088 (diff)
parent8aa81f34981add12aecada6c702ddbbd0375ca36 (diff)
downloadnixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.gz
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.bz2
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.lz
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.xz
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.zst
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pytest-services/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pytest-services/default.nix51
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 ];
   };