From 8ff2a80445e05743e252acd5a223452230757617 Mon Sep 17 00:00:00 2001 From: Simon Kohlmeyer Date: Thu, 27 Oct 2022 17:14:18 +0200 Subject: [PATCH] python311Packages.cffi: patch failing test This seems like an upstream issue with the final release of python3.11. Sadly, their gitlab is down right now, but I will pass the patch upstream as soon as I can. --- pkgs/development/python-modules/cffi/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/cffi/default.nix b/pkgs/development/python-modules/cffi/default.nix index 66b315f14ab0..52b9ab08fc4d 100644 --- a/pkgs/development/python-modules/cffi/default.nix +++ b/pkgs/development/python-modules/cffi/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, buildPythonPackage, isPyPy, fetchPypi, pytestCheckHook, - libffi, pkg-config, pycparser + libffi, pkg-config, pycparser, python, fetchpatch }: if isPyPy then null else buildPythonPackage rec { @@ -17,6 +17,17 @@ if isPyPy then null else buildPythonPackage rec { propagatedBuildInputs = [ pycparser ]; + patches = + # Fix test that failed because python seems to have changed the exception format in the + # final release. This patch should be included in the next version and can be removed when + # it is released. + lib.optionals (python.pythonVersion == "3.11") [ + (fetchpatch { + url = "https://foss.heptapod.net/pypy/cffi/-/commit/8a3c2c816d789639b49d3ae867213393ed7abdff.diff"; + sha256 = "sha256-3wpZeBqN4D8IP+47QDGK7qh/9Z0Ag4lAe+H0R5xCb1E="; + }) + ]; + postPatch = lib.optionalString stdenv.isDarwin '' # Remove setup.py impurities substituteInPlace setup.py \