2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
astor,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
hatchling,
|
|
|
|
lib,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
tomli,
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "flynt";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.0.1";
|
|
|
|
pyproject = true;
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ikamensh";
|
|
|
|
repo = "flynt";
|
2024-05-15 15:35:15 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-UHY4UDBHcP3ARikktIehSUD3Dx8A0xpOnfKWWrLCsOY=";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [ hatchling ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ astor ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
pythonImportsCheck = [ "flynt" ];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# AssertionError
|
|
|
|
"test_fstringify"
|
|
|
|
"test_mixed_quote_types_unsafe"
|
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
meta = with lib; {
|
2024-05-15 15:35:15 +00:00
|
|
|
description = "Tool to automatically convert old string literal formatting to f-strings";
|
2021-09-18 10:52:07 +00:00
|
|
|
homepage = "https://github.com/ikamensh/flynt";
|
2024-05-15 15:35:15 +00:00
|
|
|
changelog = "https://github.com/ikamensh/flynt/blob/${version}/CHANGELOG.md";
|
2021-09-18 10:52:07 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
2024-05-15 15:35:15 +00:00
|
|
|
mainProgram = "flynt";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
}
|