summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/zimports/default.nix
blob: f76f386e6a0e2a1b14cf664bb5d2786bb9899a7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
  lib,
  fetchFromGitHub,
  buildPythonPackage,
  flake8-import-order,
  pyflakes,
  tomli,
  setuptools,
  pytestCheckHook,
  pythonAtLeast,
}:

buildPythonPackage rec {
  pname = "zimports";
  version = "0.6.2";
  format = "setuptools";

  # upstream technically support 3.7 through 3.9, but 3.10 happens to work while 3.11 breaks with an import error
  disabled = pythonAtLeast "3.11";

  src = fetchFromGitHub {
    owner = "sqlalchemyorg";
    repo = "zimports";
    tag = "v${version}";
    hash = "sha256-yI/ZTNqVIu76xivXJ+MoLpPupf0RQjQOnP6OWMPajBo=";
  };

  propagatedBuildInputs = [
    flake8-import-order
    pyflakes
    setuptools
    tomli
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "zimports" ];

  meta = {
    description = "Python import rewriter";
    homepage = "https://github.com/sqlalchemyorg/zimports";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ timokau ];
  };
}