Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / ansiwrap / default.nix
blob7e55912bed208f897dc68ad5ec4640b8bef6a6cb
1 { lib
2 , ansicolors
3 , buildPythonPackage
4 , fetchPypi
5 , pytestCheckHook
6 , pythonOlder
7 , textwrap3
8 }:
10 buildPythonPackage rec {
11   pname = "ansiwrap";
12   version = "0.8.4";
13   format = "setuptools";
15   disabled = pythonOlder "3.7";
17   src = fetchPypi {
18     inherit pname version;
19     extension = "zip";
20     sha256 = "ca0c740734cde59bf919f8ff2c386f74f9a369818cdc60efe94893d01ea8d9b7";
21   };
23   postPatch = ''
24     # https://github.com/jonathaneunice/ansiwrap/issues/18
25     substituteInPlace test/test_ansiwrap.py \
26       --replace "set(range(20, 120)).difference(LINE_LENGTHS)" "sorted(set(range(20, 120)).difference(LINE_LENGTHS))" \
27       --replace "set(range(120, 400)).difference(LINE_LENGTHS)" "sorted(set(range(120, 400)).difference(LINE_LENGTHS))"
28   '';
30   checkInputs = [
31     ansicolors
32     pytestCheckHook
33   ];
35   propagatedBuildInputs = [
36     textwrap3
37   ];
39   pythonImportsCheck = [
40     "ansiwrap"
41   ];
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 = with maintainers; [ ];
49   };