nixpkgs-suyu/pkgs/development/python-modules/ansiwrap/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.2 KiB
Nix
Raw Normal View History

2019-11-25 23:11:33 +01:00
{ lib
, ansicolors
, buildPythonPackage
, fetchPypi
, pytestCheckHook
2023-01-21 13:58:08 +01:00
, pythonOlder
2019-11-25 23:11:33 +01:00
, textwrap3
}:
buildPythonPackage rec {
pname = "ansiwrap";
version = "0.8.4";
2023-01-21 13:58:08 +01:00
format = "setuptools";
disabled = pythonOlder "3.7";
2019-11-25 23:11:33 +01:00
src = fetchPypi {
inherit pname version;
extension = "zip";
sha256 = "ca0c740734cde59bf919f8ff2c386f74f9a369818cdc60efe94893d01ea8d9b7";
};
2023-01-21 13:58:08 +01:00
postPatch = ''
# https://github.com/jonathaneunice/ansiwrap/issues/18
substituteInPlace test/test_ansiwrap.py \
--replace "set(range(20, 120)).difference(LINE_LENGTHS)" "sorted(set(range(20, 120)).difference(LINE_LENGTHS))" \
--replace "set(range(120, 400)).difference(LINE_LENGTHS)" "sorted(set(range(120, 400)).difference(LINE_LENGTHS))"
'';
checkInputs = [
2019-11-25 23:11:33 +01:00
ansicolors
pytestCheckHook
2019-11-25 23:11:33 +01:00
];
2023-01-21 13:58:08 +01:00
propagatedBuildInputs = [
textwrap3
];
2019-11-25 23:11:33 +01:00
2023-01-21 13:58:08 +01:00
pythonImportsCheck = [
"ansiwrap"
];
2019-11-25 23:11:33 +01:00
meta = with lib; {
description = "Textwrap, but savvy to ANSI colors and styles";
homepage = "https://github.com/jonathaneunice/ansiwrap";
2023-01-21 13:58:08 +01:00
changelog = "https://github.com/jonathaneunice/ansiwrap/blob/master/CHANGES.yml";
2019-11-25 23:11:33 +01:00
license = licenses.asl20;
2023-01-21 13:58:08 +01:00
maintainers = with maintainers; [ costrouc ];
2019-11-25 23:11:33 +01:00
};
}