From 68de5c37ce4e70bcbbae2f9aeacbc3af1b91bd43 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 29 Mar 2022 16:02:21 +0200 Subject: [PATCH] python3Packages.typer: patch for click 8.1.0 compat In 8.1.0 click removed the deprecated `get_terminal_size` function in favor of letting downstream projects import it from shutil. https://github.com/pallets/click/pull/2130 https://github.com/tiangolo/typer/pull/375 --- pkgs/development/python-modules/typer/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/python-modules/typer/default.nix b/pkgs/development/python-modules/typer/default.nix index 17008eafc1baf2..1f0bdb39202c03 100644 --- a/pkgs/development/python-modules/typer/default.nix +++ b/pkgs/development/python-modules/typer/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , buildPythonPackage +, fetchpatch , fetchPypi , click , pytestCheckHook @@ -25,6 +26,16 @@ buildPythonPackage rec { sha256 = "1pgm0zsylbmz1r96q4n3rfi0h3pn4jss2yfs83z0yxa90nmsxhv3"; }; + patches = [ + (fetchpatch { + # use get_terminal_size from shutil; click 8.1.0 compat + # https://github.com/tiangolo/typer/pull/375 + name = "typer-click-8.1-compat.patch"; + url = "https://github.com/tiangolo/typer/commit/b6efa2f8f40291fd80cf146b617e0ba305f6af3c.patch"; + hash = "sha256-m0EWpBUt5njoPsn043b30WdAQELYNn2ycHXBxZCYXZE="; + }) + ]; + propagatedBuildInputs = [ click ];