about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2024-05-12 19:49:55 +0200
committerGitHub <noreply@github.com>2024-05-12 19:49:55 +0200
commit27713bdb9acec3f297726f0e179c5ef96fc4b665 (patch)
tree1089be513b7754e865ca24d45bb137eb392b2430
parenta07fc872d2e0b549899363ae4b23ac3320e6ea22 (diff)
parent143bc2fa8f0ae68bc4ddca49fb400aa832737b6e (diff)
Merge pull request #310905 from TomaSajt/pytest-shutil
python312Packages.pytest-{fixture-config,shutil,server-fixtures,virtualenv}: * -> 1.7.1-unstable-2022-10-03
-rw-r--r--pkgs/development/python-modules/pytest-fixture-config/default.nix29
-rw-r--r--pkgs/development/python-modules/pytest-server-fixtures/default.nix43
-rw-r--r--pkgs/development/python-modules/pytest-shutil/default.nix45
-rw-r--r--pkgs/development/python-modules/pytest-virtualenv/default.nix46
4 files changed, 110 insertions, 53 deletions
diff --git a/pkgs/development/python-modules/pytest-fixture-config/default.nix b/pkgs/development/python-modules/pytest-fixture-config/default.nix
index 31ab985dbff2d..5be97cd7471ce 100644
--- a/pkgs/development/python-modules/pytest-fixture-config/default.nix
+++ b/pkgs/development/python-modules/pytest-fixture-config/default.nix
@@ -1,17 +1,30 @@
-{ lib, buildPythonPackage, fetchPypi
-, setuptools-git, pytest }:
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  setuptools,
+  setuptools-git,
+  pytest,
+}:
 
 buildPythonPackage rec {
   pname = "pytest-fixture-config";
-  version = "1.7.0";
-  format = "setuptools";
+  version = "1.7.1-unstable-2022-10-03";
+  pyproject = true;
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1";
+  src = fetchFromGitHub {
+    owner = "man-group";
+    repo = "pytest-plugins";
+    rev = "5f9b88a65a8c1e506885352bbd9b2a47900f5014";
+    hash = "sha256-huN3RzwtfVf4iMJ96VRP/ldOxTUlUMF1wJIdbcGXHn4=";
   };
 
-  nativeBuildInputs = [ setuptools-git ];
+  sourceRoot = "${src.name}/pytest-fixture-config";
+
+  nativeBuildInputs = [
+    setuptools
+    setuptools-git
+  ];
 
   buildInputs = [ pytest ];
 
diff --git a/pkgs/development/python-modules/pytest-server-fixtures/default.nix b/pkgs/development/python-modules/pytest-server-fixtures/default.nix
index 29f26251b022c..1466371e1af44 100644
--- a/pkgs/development/python-modules/pytest-server-fixtures/default.nix
+++ b/pkgs/development/python-modules/pytest-server-fixtures/default.nix
@@ -1,26 +1,45 @@
-{ lib, buildPythonPackage, fetchPypi
-, pytest, pytest-shutil, pytest-fixture-config, psutil
-, requests, future, retry }:
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  future,
+  psutil,
+  pytest,
+  pytest-shutil,
+  pytest-fixture-config,
+  requests,
+  retry,
+  six,
+  setuptools,
+}:
 
 buildPythonPackage rec {
   pname = "pytest-server-fixtures";
-  version = "1.7.1";
-  format = "setuptools";
+  inherit (pytest-fixture-config) version src;
+  pyproject = true;
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "sha256-xecz0gqNDnc8pRPjYOS6JkeVLqlCj6K9BVFsYoHqPOc=";
-  };
+  sourceRoot = "${src.name}/pytest-server-fixtures";
+
+  build-system = [ setuptools ];
 
   buildInputs = [ pytest ];
-  propagatedBuildInputs = [ pytest-shutil pytest-fixture-config psutil requests future retry ];
 
-  # RuntimeError: Unable to find a free server number to start Xvfb
+  dependencies = [
+    future
+    psutil
+    pytest-shutil
+    pytest-fixture-config
+    requests
+    retry
+    six
+  ];
+
+  # Don't run intergration tests
   doCheck = false;
 
   meta = with lib; {
     description = "Extensible server fixures for py.test";
-    homepage  = "https://github.com/manahl/pytest-plugins";
+    homepage = "https://github.com/manahl/pytest-plugins";
     license = licenses.mit;
     maintainers = with maintainers; [ ];
   };
diff --git a/pkgs/development/python-modules/pytest-shutil/default.nix b/pkgs/development/python-modules/pytest-shutil/default.nix
index 480c15b87c361..d9c80a93510ee 100644
--- a/pkgs/development/python-modules/pytest-shutil/default.nix
+++ b/pkgs/development/python-modules/pytest-shutil/default.nix
@@ -1,13 +1,15 @@
 { lib
 , isPyPy
 , buildPythonPackage
-, fetchPypi
+, pytest-fixture-config
+, fetchpatch
 
-# build
-, pytest
+# build-time
+, setuptools
+, setuptools-git
 
 # runtime
-, setuptools-git
+, pytest
 , mock
 , path
 , execnet
@@ -15,32 +17,34 @@
 , six
 
 # tests
-, cmdline
 , pytestCheckHook
  }:
 
 buildPythonPackage rec {
   pname = "pytest-shutil";
-  version = "1.7.0";
-  format = "setuptools";
+  inherit (pytest-fixture-config) version src;
+  pyproject = true;
 
-  src = fetchPypi {
-    inherit pname version;
-    hash = "sha256-2BZSYd5251CFBcNB2UwCsRPclj8nRUOrynTb+r0CEmE=";
-  };
+  sourceRoot = "${src.name}/pytest-shutil";
 
-  postPatch = ''
-    substituteInPlace setup.py \
-      --replace "contextlib2" 'contextlib2;python_version<"3"' \
-      --replace "path.py" "path"
-  '';
-
-  buildInputs = [
-    pytest
+  # imp was removed in Python 3.12
+  patches = [
+    (fetchpatch {
+      name = "stop-using-imp.patch";
+      url = "https://build.opensuse.org/public/source/openSUSE:Factory/python-pytest-shutil/stop-using-imp.patch?rev=10";
+      hash = "sha256-L8tXoQ9q8o6aP3TpJY/sUVVbUd/ebw0h6de6dBj1WNY=";
+      stripLen = 1;
+    })
   ];
 
-  propagatedBuildInputs = [
+  build-system = [
+    setuptools
     setuptools-git
+  ];
+
+  buildInputs = [ pytest ];
+
+  dependencies = [
     mock
     path
     execnet
@@ -49,7 +53,6 @@ buildPythonPackage rec {
   ];
 
   nativeCheckInputs = [
-    cmdline
     pytestCheckHook
   ];
 
diff --git a/pkgs/development/python-modules/pytest-virtualenv/default.nix b/pkgs/development/python-modules/pytest-virtualenv/default.nix
index 408430d5127c2..494209517eb31 100644
--- a/pkgs/development/python-modules/pytest-virtualenv/default.nix
+++ b/pkgs/development/python-modules/pytest-virtualenv/default.nix
@@ -1,21 +1,43 @@
-{ lib, buildPythonPackage, fetchPypi
-, pytest, pytest-cov, mock, cmdline, pytest-fixture-config, pytest-shutil, virtualenv }:
+{
+  lib,
+  buildPythonPackage,
+  cmdline,
+  importlib-metadata,
+  mock,
+  pytestCheckHook,
+  pytest,
+  pytest-fixture-config,
+  pytest-shutil,
+  setuptools,
+  virtualenv,
+}:
 
 buildPythonPackage rec {
   pname = "pytest-virtualenv";
-  version = "1.7.0";
-  format = "setuptools";
+  inherit (pytest-fixture-config) version src;
+  pyproject = true;
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12";
-  };
+  sourceRoot = "${src.name}/pytest-virtualenv";
+
+  build-system = [ setuptools ];
+
+  buildInputs = [ pytest ];
+
+  dependencies = [
+    importlib-metadata
+    pytest-fixture-config
+    pytest-shutil
+    virtualenv
+  ];
 
-  nativeCheckInputs = [ pytest pytest-cov mock cmdline ];
-  propagatedBuildInputs = [ pytest-fixture-config pytest-shutil virtualenv ];
-  checkPhase = "py.test tests/unit ";
+  nativeCheckInputs = [
+    cmdline
+    mock
+    pytestCheckHook
+  ];
 
-  nativeBuildInputs = [ pytest ];
+  # Don't run integration tests
+  disabledTestPaths = [ "tests/integration/*" ];
 
   meta = with lib; {
     description = "Create a Python virtual environment in your test that cleans up on teardown. The fixture has utility methods to install packages and list what’s installed.";