1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, poetry-core
5, pytestCheckHook
6, pythonOlder
7, termcolor
8}:
9
10buildPythonPackage rec {
11 pname = "yaspin";
12 version = "2.2.0";
13 format = "pyproject";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "pavdmyt";
19 repo = pname;
20 rev = "v${version}";
21 hash = "sha256-Z+L0SaRe/uN20KS25Di40AjHww9QUjkFaw0Jgbe9yPg=";
22 };
23
24 nativeBuildInputs = [
25 poetry-core
26 ];
27
28 propagatedBuildInputs = [
29 termcolor
30 ];
31
32 checkInputs = [
33 pytestCheckHook
34 ];
35
36 postPatch = ''
37 # https://github.com/pavdmyt/yaspin/pull/212
38 substituteInPlace pyproject.toml \
39 --replace 'termcolor-whl = "1.1.2"' 'termcolor = "*"'
40 '';
41
42 pythonImportsCheck = [
43 "yaspin"
44 ];
45
46 meta = with lib; {
47 description = "Yet Another Terminal Spinner";
48 homepage = "https://github.com/pavdmyt/yaspin";
49 license = licenses.mit;
50 maintainers = with maintainers; [ samuela ];
51 };
52}