Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / ansiwrap / default.nix
blob8dbfa99687c8673b4c4800804dfbfcf8ae90a152
1 { lib
2 , ansicolors
3 , buildPythonPackage
4 , fetchPypi
5 , pytestCheckHook
6 , pythonAtLeast
7 , pythonOlder
8 , textwrap3
9 }:
11 buildPythonPackage rec {
12   pname = "ansiwrap";
13   version = "0.8.4";
14   format = "setuptools";
16   disabled = pythonOlder "3.7" || pythonAtLeast "3.12";
18   src = fetchPypi {
19     inherit pname version;
20     extension = "zip";
21     sha256 = "ca0c740734cde59bf919f8ff2c386f74f9a369818cdc60efe94893d01ea8d9b7";
22   };
24   postPatch = ''
25     # https://github.com/jonathaneunice/ansiwrap/issues/18
26     substituteInPlace test/test_ansiwrap.py \
27       --replace "set(range(20, 120)).difference(LINE_LENGTHS)" "sorted(set(range(20, 120)).difference(LINE_LENGTHS))" \
28       --replace "set(range(120, 400)).difference(LINE_LENGTHS)" "sorted(set(range(120, 400)).difference(LINE_LENGTHS))"
29   '';
31   checkInputs = [
32     ansicolors
33     pytestCheckHook
34   ];
36   propagatedBuildInputs = [
37     textwrap3
38   ];
40   pythonImportsCheck = [
41     "ansiwrap"
42   ];
44   meta = with lib; {
45     description = "Textwrap, but savvy to ANSI colors and styles";
46     homepage = "https://github.com/jonathaneunice/ansiwrap";
47     changelog = "https://github.com/jonathaneunice/ansiwrap/blob/master/CHANGES.yml";
48     license = licenses.asl20;
49     maintainers = with maintainers; [ ];
50   };