From 530852a971909b923ca3a62be5acc4667be43349 Mon Sep 17 00:00:00 2001
From: Winter <winter@winter.cafe>
Date: Sun, 21 Aug 2022 14:18:23 -0400
Subject: [PATCH 1/2] python3Packages.plac: fix/disable tests

---
 .../python-modules/plac/default.nix           | 23 +++++++++++++------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/pkgs/development/python-modules/plac/default.nix b/pkgs/development/python-modules/plac/default.nix
index f9d373e68dbe..752c7aab5e83 100644
--- a/pkgs/development/python-modules/plac/default.nix
+++ b/pkgs/development/python-modules/plac/default.nix
@@ -1,7 +1,7 @@
 { lib
 , buildPythonPackage
-, fetchPypi
-, unittestCheckHook
+, fetchFromGitHub
+, python
 , pythonOlder
 }:
 
@@ -12,14 +12,23 @@ buildPythonPackage rec {
 
   disabled = pythonOlder "3.7";
 
-  src = fetchPypi {
-    inherit pname version;
-    hash = "sha256-OL3YZNBFD7dIGTqoF7nEWKj1MZ+/l7ImEVHPwKWBIJA=";
+  src = fetchFromGitHub {
+    owner = "ialbert";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-U3k97YJhQjulYNWcKVx96/5zND5VfsRjA3ZZHWhcDNg=";
   };
 
-  checkInputs = [ unittestCheckHook ];
+  # tests are broken, see https://github.com/ialbert/plac/issues/74
+  doCheck = false;
 
-  unittestFlagsArray = [ "-s" "doc" "-p" "*test_plac*" ];
+  checkPhase = ''
+    runHook preCheck
+
+    ${python.interpreter} doc/test_plac.py
+
+    runHook postCheck
+  '';
 
   pythonImportsCheck = [
     "plac"

From 9f659b65f8f9a141bd5e15d67468cc209af95ecb Mon Sep 17 00:00:00 2001
From: Winter <winter@winter.cafe>
Date: Sun, 21 Aug 2022 14:27:46 -0400
Subject: [PATCH 2/2] python3Packages.cymem: 2.0.3 -> 2.0.6, switch to pytest

---
 .../development/python-modules/cymem/default.nix | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/pkgs/development/python-modules/cymem/default.nix b/pkgs/development/python-modules/cymem/default.nix
index 3e5d497dbfad..88e257201099 100644
--- a/pkgs/development/python-modules/cymem/default.nix
+++ b/pkgs/development/python-modules/cymem/default.nix
@@ -2,32 +2,30 @@
 , buildPythonPackage
 , fetchFromGitHub
 , cython
-, unittestCheckHook
+, pytestCheckHook
 }:
 
 buildPythonPackage rec {
   pname = "cymem";
-  version = "2.0.3";
+  version = "2.0.6";
 
   src = fetchFromGitHub {
     owner = "explosion";
     repo = "cymem";
     rev = "v${version}";
-    sha256 = "0cqz6whq4zginxjnh4cfqlsh535p4qz295ymvjchp71fv8mz11f6";
+    sha256 = "sha256-o+44v6wvE9HxeQaDDQ0+gi7z1V7jtkZvWglY8UyVHLg=";
   };
 
   propagatedBuildInputs = [
     cython
   ];
 
-  prePatch = ''
-    substituteInPlace setup.py \
-      --replace "wheel>=0.32.0,<0.33.0" "wheel>=0.31.0"
-  '';
+  # ModuleNotFoundError: No module named 'cymem.cymem'
+  doCheck = false;
 
-  checkInputs = [ unittestCheckHook ];
+  checkInputs = [ pytestCheckHook ];
 
-  unittestFlagsArray = [ "-s" "cymem/tests" "-p" "*test*" ];
+  pytestFlagsArray = [ "cymem" ];
 
   meta = with lib; {
     description = "Cython memory pool for RAII-style memory management";