Skip to content

Commit

Permalink
python3Packages.pgmpy: patch assert in test suite for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorBaker committed May 25, 2024
1 parent cb796c7 commit dcf25f5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkgs/development/python-modules/pgmpy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
pythonOlder,
# build inputs
networkx,
Expand Down Expand Up @@ -42,6 +43,14 @@ buildPythonPackage {
hash = "sha256-d2TNcJQ82XxTWdetLgtKXRpFulAEEzrr+cyRewoA6YI=";
};

# TODO: Remove this patch after updating to pgmpy 0.1.26.
# The PR https://github.com/pgmpy/pgmpy/pull/1745 will have been merged.
# It contains the fix below, among other things, which is why we do not use fetchpatch.
postPatch = lib.optionalString (pythonAtLeast "3.12") ''
substituteInPlace pgmpy/tests/test_estimators/test_MarginalEstimator.py \
--replace-fail 'self.assert_' 'self.assertTrue'
'';

propagatedBuildInputs = [
networkx
numpy
Expand Down

0 comments on commit dcf25f5

Please sign in to comment.