nixpkgs/pkgs/development/python-modules/add-trailing-comma/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

43 lines
870 B
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pythonOlder
, tokenize-rt
}:
buildPythonPackage rec {
pname = "add-trailing-comma";
version = "3.1.0";
format = "setuptools";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "asottile";
repo = pname;
rev = "v${version}";
hash = "sha256-B+wjBy42RwabVz/6qEMGpB0JmwJ9hqSskwcNj4x/B/k=";
};
propagatedBuildInputs = [
tokenize-rt
];
pythonImportsCheck = [
"add_trailing_comma"
];
nativeCheckInputs = [
pytestCheckHook
];
meta = with lib; {
description = "A tool (and pre-commit hook) to automatically add trailing commas to calls and literals";
mainProgram = "add-trailing-comma";
homepage = "https://github.com/asottile/add-trailing-comma";
license = licenses.mit;
maintainers = with maintainers; [ gador ];
};
}