From 3564fb91c791ae273bac175dd4fb4111abadce5e Mon Sep 17 00:00:00 2001 From: Gavin John Date: Wed, 13 Nov 2024 10:51:44 -0800 Subject: [PATCH] python312Packages.bson: enable tests --- .../python-modules/bson/default.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/bson/default.nix b/pkgs/development/python-modules/bson/default.nix index 415f50ce0850d..537686eb3a88f 100644 --- a/pkgs/development/python-modules/bson/default.nix +++ b/pkgs/development/python-modules/bson/default.nix @@ -1,9 +1,10 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, python-dateutil, six, + pytestCheckHook, }: buildPythonPackage rec { @@ -11,18 +12,23 @@ buildPythonPackage rec { version = "0.5.10"; format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "14355m3dchz446fl54ym78bn4wi20hddx1614f8rl4sin0m1nlfn"; + src = fetchFromGitHub { + owner = "py-bson"; + repo = "bson"; + rev = "refs/tags/${version}"; + hash = "sha256-mirRpo27RoOBlwxVOKnHaDIzJOErp7c2VxCOunUm/u4="; }; + postPatch = '' + find . -type f -name '*.py' -exec sed -i 's|assertEquals|assertEqual|g' {} + + ''; + propagatedBuildInputs = [ python-dateutil six ]; - # 0.5.10 was not tagged, https://github.com/py-bson/bson/issues/108 - doCheck = false; + checkInputs = [ pytestCheckHook ]; pythonImportsCheck = [ "bson" ];