From 752713749de4cc015daa498e90b29f61b8c4bb18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 7 May 2022 02:24:49 +0200 Subject: [PATCH 1/2] python310Packages.automat: adopt, run tests (cherry picked from commit 6596ccf4471abc8c746190a34a2da6d6c0658c63) --- .../python-modules/automat/default.nix | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/automat/default.nix b/pkgs/development/python-modules/automat/default.nix index ce7566deb30d..bb7525d8859a 100644 --- a/pkgs/development/python-modules/automat/default.nix +++ b/pkgs/development/python-modules/automat/default.nix @@ -1,26 +1,50 @@ -{ lib, buildPythonPackage, fetchPypi, - m2r, setuptools-scm, six, attrs }: +{ lib +, buildPythonPackage +, fetchPypi +, attrs +, m2r +, pytest-benchmark +, pytestCheckHook +, setuptools-scm +, six +}: -buildPythonPackage rec { +let automat = buildPythonPackage rec { version = "20.2.0"; - pname = "Automat"; + pname = "automat"; src = fetchPypi { - inherit pname version; + pname = "Automat"; + inherit version; sha256 = "7979803c74610e11ef0c0d68a2942b152df52da55336e0c9d58daf1831cbdf33"; }; - buildInputs = [ m2r setuptools-scm ]; - propagatedBuildInputs = [ six attrs ]; + nativeBuildInputs = [ + m2r + setuptools-scm + ]; - # Some tests require twisetd, but twisted requires Automat to build. - # this creates a circular dependency. + propagatedBuildInputs = [ + six + attrs + ]; + + checkInputs = [ + pytest-benchmark + pytestCheckHook + ]; + + # escape infinite recursion with twisted doCheck = false; + passthru.tests = { + check = automat.overridePythonAttrs (_: { doCheck = true; }); + }; + meta = with lib; { homepage = "https://github.com/glyph/Automat"; description = "Self-service finite-state machines for the programmer on the go"; license = licenses.mit; - maintainers = [ ]; + maintainers = with maintainers; [ SuperSandro2000 ]; }; -} +}; in automat From 7fb285336d0d73641b0491e0c56422a3d3f168ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 11 Aug 2022 13:35:18 +0000 Subject: [PATCH 2/2] python310Packages.automat: don't depend on m2r The latter depends on an outdated, vulnerable version of mistune. (cherry picked from commit d3462c92f9e8bd09c03ed9620bcfb2ccef62ee3b) --- pkgs/development/python-modules/automat/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/automat/default.nix b/pkgs/development/python-modules/automat/default.nix index bb7525d8859a..094015e56f5e 100644 --- a/pkgs/development/python-modules/automat/default.nix +++ b/pkgs/development/python-modules/automat/default.nix @@ -1,8 +1,8 @@ { lib , buildPythonPackage , fetchPypi +, fetchpatch , attrs -, m2r , pytest-benchmark , pytestCheckHook , setuptools-scm @@ -19,8 +19,17 @@ let automat = buildPythonPackage rec { sha256 = "7979803c74610e11ef0c0d68a2942b152df52da55336e0c9d58daf1831cbdf33"; }; + patches = [ + # don't depend on m2r + (fetchpatch { + name = "dont-depend-on-m2r.patch"; + url = "https://github.com/glyph/automat/compare/v20.2.0..2562fa4ddeba5b5945d9482baa4c26a414f5e831.patch"; + includes = [ "setup.py" ]; + hash = "sha256-jlPLJMu1QbBpiVYHDiqPydrXjEoZgYZTVVGNxSA0NxY="; + }) + ]; + nativeBuildInputs = [ - m2r setuptools-scm ];