From cd726c9a915c16b2d616a60f79eb77d126aa0ada Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Sun, 27 Nov 2022 00:46:23 -0800 Subject: [PATCH] python311Packages.cchardet: fix for python 3.11 The .cpp file released with this package to PyPI was built using an older version of Cython that is incompatible with Python 3.11. This package is not actively maintained, so it's unclear when the fix for this will be merged and released. In the meantime, we can include a newer version of Cython locally, which will be used instead to regenerate the .cpp file. --- pkgs/development/python-modules/cchardet/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/cchardet/default.nix b/pkgs/development/python-modules/cchardet/default.nix index 587d0d1f6c12..1ec1ee57c1a7 100644 --- a/pkgs/development/python-modules/cchardet/default.nix +++ b/pkgs/development/python-modules/cchardet/default.nix @@ -2,19 +2,24 @@ , stdenv , buildPythonPackage , fetchPypi -, python +, cython , nose }: buildPythonPackage rec { pname = "cchardet"; version = "2.1.7"; + format = "setuptools"; src = fetchPypi { inherit pname version; sha256 = "c428b6336545053c2589f6caf24ea32276c6664cb86db817e03a94c60afa0eaf"; }; + nativeBuildInputs = [ + cython # pending https://github.com/PyYoshi/cChardet/pull/78 being released to PyPI + ]; + pythonImportsCheck = [ "cchardet" ];