lol

awslimitchecker: refactor

- override pytest

+26 -23
+26 -23
pkgs/tools/admin/awslimitchecker/default.nix
··· 1 - { lib, python3Packages, fetchFromGitHub }: 1 + { lib 2 + , fetchFromGitHub 3 + , python3 4 + }: 2 5 3 - python3Packages.buildPythonApplication rec { 6 + python3.pkgs.buildPythonApplication rec { 4 7 pname = "awslimitchecker"; 5 8 version = "12.0.0"; 9 + pyproject = true; 6 10 7 11 src = fetchFromGitHub { 8 12 owner = "jantman"; 9 13 repo = "awslimitchecker"; 10 - rev = version; 11 - sha256 = "1p6n4kziyl6sfq7vgga9v88ddwh3sgnfb1m1cx6q25n0wyl7phgv"; 14 + rev = "refs/tags/${version}"; 15 + hash = "sha256-+8F7qOfAFoFNZ6GG5ezTA/LWENpJvbcPdtpQH/8k1tw="; 12 16 }; 13 17 14 - propagatedBuildInputs = with python3Packages; [ 18 + patches = [ 19 + # Fix the version lookup to use only the hardcoded version in the source package 20 + ./version.patch 21 + ]; 22 + 23 + build-system = with python3.pkgs; [ 24 + setuptools 25 + ]; 26 + 27 + dependencies = with python3.pkgs; [ 15 28 boto3 16 29 botocore 17 30 pytz ··· 19 32 versionfinder 20 33 ]; 21 34 22 - nativeCheckInputs = with python3Packages; [ 35 + nativeCheckInputs = with python3.pkgs; [ 23 36 freezegun 24 37 onetimepass 25 - pytestCheckHook 26 38 pyotp 39 + mock 40 + (pytestCheckHook.override { pytest = pytest_7; }) 27 41 testfixtures 28 42 ]; 29 43 30 - patches = [ 31 - # Fix the version lookup to use only the hardcoded version in the source package 32 - ./version.patch 33 - ]; 34 - 35 - pytestFlagsArray = [ 36 - "awslimitchecker/tests" 37 - 38 - # Upstream did not adapt to pytest 8 yet. 39 - "-W" 40 - "ignore::pytest.PytestRemovedIn8Warning" 41 - ]; 42 - 43 44 disabledTestPaths = [ 44 45 # AWS tests that use the network 45 46 "awslimitchecker/tests/services" ··· 50 51 "awslimitchecker/tests/test_version.py" 51 52 ]; 52 53 53 - pythonImportsCheck = [ "awslimitchecker.checker" ]; 54 + pythonImportsCheck = [ 55 + "awslimitchecker.checker" 56 + ]; 54 57 55 58 meta = with lib; { 59 + description = "A script and python package to check your AWS service limits and usage via boto3"; 56 60 homepage = "http://awslimitchecker.readthedocs.org"; 57 61 changelog = "https://github.com/jantman/awslimitchecker/blob/${version}/CHANGES.rst"; 58 - description = "A script and python package to check your AWS service limits and usage via boto3"; 59 - mainProgram = "awslimitchecker"; 60 62 license = licenses.agpl3Plus; 61 63 maintainers = with maintainers; [ zakame ]; 64 + mainProgram = "awslimitchecker"; 62 65 }; 63 66 }