diff --git a/pkgs/development/python-modules/invocations/default.nix b/pkgs/development/python-modules/invocations/default.nix index 17828c47ae46..68160afc5435 100644 --- a/pkgs/development/python-modules/invocations/default.nix +++ b/pkgs/development/python-modules/invocations/default.nix @@ -1,7 +1,7 @@ { lib, buildPythonPackage, - blessings, + blessed, fetchFromGitHub, invoke, pythonOlder, @@ -10,6 +10,11 @@ tabulate, tqdm, twine, + pytestCheckHook, + pytest-relaxed, + pytest-mock, + icecream, + pip, }: buildPythonPackage rec { @@ -26,13 +31,15 @@ buildPythonPackage rec { hash = "sha256-JnhdcxhBNsYgDMcljtGKjOT1agujlao/66QifGuh6I0="; }; + patches = [ ./replace-blessings-with-blessed.patch ]; + postPatch = '' substituteInPlace setup.py \ --replace "semantic_version>=2.4,<2.7" "semantic_version" ''; propagatedBuildInputs = [ - blessings + blessed invoke releases semantic-version @@ -41,11 +48,27 @@ buildPythonPackage rec { twine ]; - # There's an error loading the test suite. See https://github.com/pyinvoke/invocations/issues/29. - doCheck = false; + nativeCheckInputs = [ + pytestCheckHook + pytest-relaxed + pytest-mock + icecream + pip + ]; pythonImportsCheck = [ "invocations" ]; + disabledTests = [ + # invoke.exceptions.UnexpectedExit + "autodoc_" + + # ValueError: Call either Version('1.2.3') or Version(major=1, ...) + "component_state_enums_contain_human_readable_values" + "load_version_" + "prepare_" + "status_" + ]; + meta = with lib; { description = "Common/best-practice Invoke tasks and collections"; homepage = "https://invocations.readthedocs.io/"; diff --git a/pkgs/development/python-modules/invocations/replace-blessings-with-blessed.patch b/pkgs/development/python-modules/invocations/replace-blessings-with-blessed.patch new file mode 100644 index 000000000000..fe03889e8555 --- /dev/null +++ b/pkgs/development/python-modules/invocations/replace-blessings-with-blessed.patch @@ -0,0 +1,26 @@ +diff --git a/invocations/packaging/release.py b/invocations/packaging/release.py +index 54322c3..81ac173 100644 +--- a/invocations/packaging/release.py ++++ b/invocations/packaging/release.py +@@ -23,7 +23,7 @@ from shutil import rmtree + + from invoke.vendor.lexicon import Lexicon + +-from blessings import Terminal ++from blessed import Terminal + from docutils.utils import Reporter + from enum import Enum + from invoke import Collection, task, Exit +diff --git a/setup.py b/setup.py +index 78ae28b..c78a74c 100644 +--- a/setup.py ++++ b/setup.py +@@ -16,7 +16,7 @@ requirements = [ + # time if missing), but that got hairy fast, and these are all + # pure-Python packages, so it shouldn't be a huge burden for users to + # obtain them. +- "blessings>=1.6", ++ "blessed", + "releases>=1.6", + "semantic_version>=2.4,<2.7", + "tabulate>=0.7.5",