depot/third_party/nixpkgs/pkgs/development/python-modules/mdformat-nix-alejandra/default.nix
Default email c7cb07f092 Project import generated by Copybara.
GitOrigin-RevId: 1536926ef5621b09bba54035ae2bb6d806d72ac8
2024-02-29 21:09:43 +01:00

52 lines
1 KiB
Nix

{ lib
, alejandra
, buildPythonPackage
, fetchFromGitHub
, mdformat
, poetry-core
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "mdformat-nix-alejandra";
version = "0.1.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "aldoborrero";
repo = "mdformat-nix-alejandra";
rev = "refs/tags/${version}";
hash = "sha256-jUXApGsxCA+pRm4m4ZiHWlxmVkqCPx3A46oQdtyKz5g=";
};
postPatch = ''
substituteInPlace mdformat_nix_alejandra/__init__.py \
--replace-fail '"alejandra"' '"${lib.getExe alejandra}"'
'';
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
mdformat
];
pythonImportsCheck = [
"mdformat_nix_alejandra"
];
nativeCheckInputs = [
pytestCheckHook
];
meta = with lib; {
description = "Mdformat plugin format Nix code blocks with alejandra";
homepage = "https://github.com/aldoborrero/mdformat-nix-alejandra";
license = licenses.mit;
maintainers = with maintainers; [ aldoborrero ];
};
}