about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/admin/awslimitchecker/default.nix
blob: cc492ed065d30aacfcd89b4f0a48eaca48235665 (plain) (blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ lib, python3Packages, fetchFromGitHub }:

python3Packages.buildPythonApplication rec {
  pname = "awslimitchecker";
  version = "12.0.0";

  src = fetchFromGitHub {
    owner = "jantman";
    repo = "awslimitchecker";
    rev = version;
    sha256 = "1p6n4kziyl6sfq7vgga9v88ddwh3sgnfb1m1cx6q25n0wyl7phgv";
  };

  propagatedBuildInputs = with python3Packages; [
    boto3
    botocore
    pytz
    termcolor
    versionfinder
  ];

  nativeCheckInputs = with python3Packages; [
    freezegun
    onetimepass
    pytestCheckHook
    pyotp
    testfixtures
  ];

  patches = [
    # Fix the version lookup to use only the hardcoded version in the source package
    ./version.patch
  ];

  pytestFlagsArray = [
    "awslimitchecker/tests"
  ];

  disabledTestPaths = [
    # AWS tests that use the network
    "awslimitchecker/tests/services"
    "awslimitchecker/tests/test_checker.py"
    "awslimitchecker/tests/test_runner.py"

    # the version lookup tests as patched above
    "awslimitchecker/tests/test_version.py"
  ];

  pythonImportsCheck = [ "awslimitchecker.checker" ];

  meta = with lib; {
    homepage = "http://awslimitchecker.readthedocs.org";
    changelog = "https://github.com/jantman/awslimitchecker/blob/${version}/CHANGES.rst";
    description = "A script and python package to check your AWS service limits and usage via boto3";
    mainProgram = "awslimitchecker";
    license = licenses.agpl3Plus;
    maintainers = with maintainers; [ zakame ];
  };
}