From b42738b02822f4ee7cebdc3641753b56cdecb78e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 26 Jan 2023 12:00:16 +0100 Subject: [PATCH] python311Packages.autopep8: add patch to ignore deprecation warnings --- .../python-modules/autopep8/default.nix | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/autopep8/default.nix b/pkgs/development/python-modules/autopep8/default.nix index 9eff8e2d29d4..f22d92d7bfb1 100644 --- a/pkgs/development/python-modules/autopep8/default.nix +++ b/pkgs/development/python-modules/autopep8/default.nix @@ -1,17 +1,20 @@ { lib +, buildPythonPackage , fetchFromGitHub , fetchpatch -, buildPythonPackage -, pythonOlder -, pycodestyle , glibcLocales -, tomli +, pycodestyle , pytestCheckHook +, pythonOlder +, tomli }: buildPythonPackage rec { pname = "autopep8"; version = "2.0.1"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "hhatto"; @@ -20,6 +23,15 @@ buildPythonPackage rec { hash = "sha256-YEPSsUzJG4MPiiloVAf9m/UiChkhkN0+lK6spycpSvo="; }; + patches = [ + # Ignore DeprecationWarnings to fix tests on Python 3.11, https://github.com/hhatto/autopep8/pull/665 + (fetchpatch { + name = "ignore-deprecation-warnings.patch"; + url = "https://github.com/hhatto/autopep8/commit/75b444d7cf510307ef67dc2b757d384b8a241348.patch"; + hash = "sha256-5hcJ2yAuscvGyI7zyo4Cl3NEFG/fZItQ8URstxhzwzE="; + }) + ]; + propagatedBuildInputs = [ pycodestyle ] ++ lib.optionals (pythonOlder "3.11") [