1{ lib
2, buildPythonPackage
3, colorama
4, fetchFromGitHub
5, fetchpatch
6, poetry-core
7, pytestCheckHook
8, setuptools
9, types-colorama
10, types-setuptools
11}:
12
13buildPythonPackage rec {
14 pname = "beautysh";
15 version = "6.2.1";
16 format = "pyproject";
17
18 src = fetchFromGitHub {
19 owner = "lovesegfault";
20 repo = pname;
21 rev = "v${version}";
22 hash = "sha256-rPeGRcyNK45Y7OvtzaIH93IIzexBf/jM1SzYP0phQ1o=";
23 };
24
25 patches = [
26 # https://github.com/lovesegfault/beautysh/pull/247
27 (fetchpatch {
28 name = "poetry-to-poetry-core.patch";
29 url = "https://github.com/lovesegfault/beautysh/commit/5f4fcac083fa68568a50f3c2bcee3ead0f3ca7c5.patch";
30 hash = "sha256-H/kIJKww5ouWu8rmRkaMOXcsq2daZWDdwxBqbc99x0s=";
31 })
32 ];
33
34 postPatch = ''
35 substituteInPlace pyproject.toml \
36 --replace 'types-setuptools = "^57.4.0"' 'types-setuptools = "*"'
37 '';
38
39 nativeBuildInputs = [
40 poetry-core
41 ];
42
43 propagatedBuildInputs = [
44 colorama
45 setuptools
46 types-colorama
47 types-setuptools
48 ];
49
50 nativeCheckInputs = [
51 pytestCheckHook
52 ];
53
54 pythonImportsCheck = [
55 "beautysh"
56 ];
57
58 meta = with lib; {
59 description = "Tool for beautifying Bash scripts";
60 homepage = "https://github.com/lovesegfault/beautysh";
61 license = with licenses; [ asl20 ];
62 maintainers = with maintainers; [ fab ];
63 mainProgram = "beautysh";
64 };
65}