python312Packages.invocation: enable tests with pytest

This commit is contained in:
Sigmanificient 2024-08-20 23:40:58 +02:00
parent 59147201a7
commit 6bdf93beb4
2 changed files with 53 additions and 4 deletions

View File

@ -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/";

View File

@ -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",