2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
ansicolors,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
textwrap3,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ansiwrap";
|
|
|
|
version = "0.8.4";
|
2024-05-15 15:35:15 +00:00
|
|
|
pyproject = true;
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabled = pythonOlder "3.7" || pythonAtLeast "3.12";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
extension = "zip";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-ygx0BzTN5Zv5Gfj/LDhvdPmjaYGM3GDv6UiT0B6o2bc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/jonathaneunice/ansiwrap/issues/18
|
|
|
|
substituteInPlace test/test_ansiwrap.py \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail "set(range(20, 120)).difference(LINE_LENGTHS)" "sorted(set(range(20, 120)).difference(LINE_LENGTHS))" \
|
|
|
|
--replace-fail "set(range(120, 400)).difference(LINE_LENGTHS)" "sorted(set(range(120, 400)).difference(LINE_LENGTHS))"
|
2023-02-02 18:25:31 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [ textwrap3 ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
ansicolors
|
2021-02-13 14:23:35 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "ansiwrap" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Textwrap, but savvy to ANSI colors and styles";
|
|
|
|
homepage = "https://github.com/jonathaneunice/ansiwrap";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/jonathaneunice/ansiwrap/blob/master/CHANGES.yml";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|