2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
black,
|
|
|
|
buildPythonPackage,
|
|
|
|
click,
|
|
|
|
fetchFromGitHub,
|
|
|
|
flit-core,
|
|
|
|
libcst,
|
|
|
|
moreorless,
|
|
|
|
pythonOlder,
|
|
|
|
tomlkit,
|
|
|
|
trailrunner,
|
|
|
|
typing-extensions,
|
|
|
|
unittestCheckHook,
|
|
|
|
usort,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ufmt";
|
|
|
|
version = "2.1.0";
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "omnilib";
|
|
|
|
repo = "ufmt";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-eQIbSC0Oxi6JD7/3o2y9f+KhT8GIiFiYiV4A3QBoWl0=";
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ flit-core ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
black
|
|
|
|
click
|
|
|
|
libcst
|
|
|
|
moreorless
|
|
|
|
tomlkit
|
|
|
|
trailrunner
|
|
|
|
typing-extensions
|
|
|
|
usort
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ unittestCheckHook ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "ufmt" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Safe, atomic formatting with black and usort";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "ufmt";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://github.com/omnilib/ufmt";
|
|
|
|
changelog = "https://github.com/omnilib/ufmt/blob/${version}/CHANGELOG.md";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|