2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
|
|
|
flake8-import-order,
|
|
|
|
pyflakes,
|
|
|
|
tomli,
|
|
|
|
setuptools,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "zimports";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.6.1";
|
2022-05-18 14:49:53 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# upstream technically support 3.7 through 3.9, but 3.10 happens to work while 3.11 breaks with an import error
|
|
|
|
disabled = pythonOlder "3.7" || pythonAtLeast "3.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sqlalchemyorg";
|
|
|
|
repo = "zimports";
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-+sDvl8z0O0cZyS1oZgt924hlOkYeHiStpXL9y9+JZ5I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
flake8-import-order
|
2022-04-27 09:35:20 +00:00
|
|
|
pyflakes
|
2020-06-15 15:56:04 +00:00
|
|
|
setuptools
|
2022-04-27 09:35:20 +00:00
|
|
|
tomli
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "zimports" ];
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python import rewriter";
|
|
|
|
homepage = "https://github.com/sqlalchemyorg/zimports";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ timokau ];
|
|
|
|
};
|
|
|
|
}
|