btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / to / toml-sort / package.nix
blob3225530454557019c21682d19eb9b1ae4065b67f
2   lib,
3   python3Packages,
4   fetchFromGitHub,
5 }:
6 let
7   version = "0.23.1";
8 in
9 python3Packages.buildPythonApplication {
10   pname = "toml-sort";
11   inherit version;
12   pyproject = true;
14   src = fetchFromGitHub {
15     owner = "pappasam";
16     repo = "toml-sort";
17     rev = "refs/tags/v${version}";
18     hash = "sha256-7V2WBZYAdsA4Tiy9/2UPOcThSNE3ZXM713j57KDCegk=";
19   };
21   build-system = [ python3Packages.poetry-core ];
23   dependencies = [ python3Packages.tomlkit ];
25   nativeCheckInputs = [ python3Packages.pytestCheckHook ];
27   postPatch = ''
28     substituteInPlace "tests/test_cli.py" \
29       --replace-fail "toml-sort" "$out/bin/toml-sort"
30   '';
32   meta = {
33     mainProgram = "toml-sort";
34     homepage = "https://github.com/pappasam/toml-sort";
35     description = "Command line utility to sort and format your toml files";
36     license = lib.licenses.mit;
37     maintainers = with lib.maintainers; [ isabelroses ];
38   };