anki-bin: 24.06.3 -> 24.11 (#360722)
[NixPkgs.git] / pkgs / development / python-modules / ansiwrap / default.nix
blob48963155d0c0e18192cc87f8822286bf2085af7a
2   lib,
3   ansicolors,
4   buildPythonPackage,
5   fetchPypi,
6   pytestCheckHook,
7   pythonAtLeast,
8   pythonOlder,
9   setuptools,
10   textwrap3,
12 buildPythonPackage rec {
13   pname = "ansiwrap";
14   version = "0.8.4";
15   pyproject = true;
17   disabled = pythonOlder "3.7" || pythonAtLeast "3.12";
19   src = fetchPypi {
20     inherit pname version;
21     extension = "zip";
22     hash = "sha256-ygx0BzTN5Zv5Gfj/LDhvdPmjaYGM3GDv6UiT0B6o2bc=";
23   };
25   postPatch = ''
26     # https://github.com/jonathaneunice/ansiwrap/issues/18
27     substituteInPlace test/test_ansiwrap.py \
28       --replace-fail "set(range(20, 120)).difference(LINE_LENGTHS)" "sorted(set(range(20, 120)).difference(LINE_LENGTHS))" \
29       --replace-fail "set(range(120, 400)).difference(LINE_LENGTHS)" "sorted(set(range(120, 400)).difference(LINE_LENGTHS))"
30   '';
32   build-system = [ setuptools ];
34   dependencies = [ textwrap3 ];
36   nativeCheckInputs = [
37     ansicolors
38     pytestCheckHook
39   ];
41   pythonImportsCheck = [ "ansiwrap" ];
43   meta = with lib; {
44     description = "Textwrap, but savvy to ANSI colors and styles";
45     homepage = "https://github.com/jonathaneunice/ansiwrap";
46     changelog = "https://github.com/jonathaneunice/ansiwrap/blob/master/CHANGES.yml";
47     license = licenses.asl20;
48     maintainers = [ ];
50     broken = true;
51   };