nixpkgs/pkgs/development/python-modules/yasi/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

48 lines
1,022 B
Nix

{ lib
, buildPythonPackage
, colorama
, fetchFromGitHub
, pytestCheckHook
, setuptools
}:
buildPythonPackage rec {
pname = "yasi";
version = "2.1.2";
pyproject = true;
src = fetchFromGitHub {
owner = "nkmathew";
repo = "yasi-sexp-indenter";
rev = "v${version}";
hash = "sha256-xKhVTmh/vrtBkatxtk8R4yqbGroH0I+xTKNYUpuikt4=";
};
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
colorama
];
nativeCheckInputs = [
pytestCheckHook
];
postPatch = ''
substituteInPlace setup.py \
--replace "test.test_yasi" "tests.test_yasi"
'';
pythonImportsCheck = [ "yasi" ];
meta = with lib; {
description = "A dialect-aware s-expression indenter written in Python and newLISP";
mainProgram = "yasi";
homepage = "https://github.com/nkmathew/yasi-sexp-indenter";
changelog = "https://github.com/nkmathew/yasi-sexp-indenter/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ kranzes ];
};
}