diff options
-rw-r--r-- | pkgs/development/python-modules/cfn-flip/default.nix | 48 | ||||
-rw-r--r-- | pkgs/development/python-modules/pycfmodel/default.nix | 48 | ||||
-rw-r--r-- | pkgs/development/python-modules/pydash/default.nix | 37 | ||||
-rw-r--r-- | pkgs/tools/security/cfripper/default.nix | 56 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 2 |
6 files changed, 162 insertions, 31 deletions
diff --git a/pkgs/development/python-modules/cfn-flip/default.nix b/pkgs/development/python-modules/cfn-flip/default.nix index bf3eab19d4fa9..105775a4547e8 100644 --- a/pkgs/development/python-modules/cfn-flip/default.nix +++ b/pkgs/development/python-modules/cfn-flip/default.nix @@ -1,25 +1,25 @@ -{ buildPythonPackage -, fetchFromGitHub -, lib - -# pythonPackages +{ lib +, buildPythonPackage , click -, pytest -, pytest-cov -, pytest-runner +, fetchFromGitHub +, pytestCheckHook +, pythonOlder , pyyaml , six }: buildPythonPackage rec { pname = "cfn-flip"; - version = "1.2.2"; + version = "1.3.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "awslabs"; repo = "aws-cfn-template-flip"; rev = version; - sha256 = "05fk725a1i3zl3idik2hxl3w6k1ln0j33j3jdq1gvy1sfyc79ifm"; + hash = "sha256-1cV0mHc6+P0CbnLIMSSwNEzDB+1QzNjioH/EoIo40xU="; }; propagatedBuildInputs = [ @@ -29,27 +29,27 @@ buildPythonPackage rec { ]; checkInputs = [ - pytest - pytest-cov - pytest-runner + pytestCheckHook ]; - checkPhase = '' - py.test \ - --cov=cfn_clean \ - --cov=cfn_flip \ - --cov=cfn_tools \ - --cov-report term-missing \ - --cov-report html + postPatch = '' + sed -i "/--cov/d" tox.ini ''; + disabledTests = [ + # TypeError: load() missing 1 required positional argument: 'Loader' + "test_flip_to_yaml_with_longhand_functions" + "test_yaml_no_ordered_dict" + ]; + + pythonImportsCheck = [ + "cfn_flip" + ]; + meta = with lib; { description = "Tool for converting AWS CloudFormation templates between JSON and YAML formats"; homepage = "https://github.com/awslabs/aws-cfn-template-flip"; license = licenses.asl20; - maintainers = with maintainers; [ - kamadorueda - psyanticy - ]; + maintainers = with maintainers; [ kamadorueda psyanticy ]; }; } diff --git a/pkgs/development/python-modules/pycfmodel/default.nix b/pkgs/development/python-modules/pycfmodel/default.nix new file mode 100644 index 0000000000000..320e6d51c7aca --- /dev/null +++ b/pkgs/development/python-modules/pycfmodel/default.nix @@ -0,0 +1,48 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, httpx +, pydantic +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pycfmodel"; + version = "0.13.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "Skyscanner"; + repo = pname; + rev = version; + hash = "sha256-BlnLf0C/wxPXhoAH0SRB22eGWbbZ05L20rNy6qfOI+A="; + }; + + propagatedBuildInputs = [ + pydantic + ]; + + checkInputs = [ + httpx + pytestCheckHook + ]; + + disabledTests = [ + # Test require network access + "test_cloudformation_actions" + ]; + + pythonImportsCheck = [ + "pycfmodel" + ]; + + meta = with lib; { + description = "Model for Cloud Formation scripts"; + homepage = "https://github.com/Skyscanner/pycfmodel"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/pydash/default.nix b/pkgs/development/python-modules/pydash/default.nix index 7d75896397f3f..5b0ffade58859 100644 --- a/pkgs/development/python-modules/pydash/default.nix +++ b/pkgs/development/python-modules/pydash/default.nix @@ -1,23 +1,46 @@ -{ lib, buildPythonPackage, fetchFromGitHub, mock, pytestCheckHook, invoke }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, invoke +, mock +, pytestCheckHook +, pythonOlder +, sphinx_rtd_theme +}: buildPythonPackage rec { pname = "pydash"; - version = "4.9.3"; + version = "5.1.0"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "dgilland"; repo = pname; rev = "v${version}"; - sha256 = "sha256-BAyiSnILvujUOFOAkiXSgyozs2Q809pYihHwa+6BHcQ="; + hash = "sha256-BAyiSnILvujUOFOAkiXSgyozs2Q809pYihHwa+6BHcQ="; }; - patches = [ ./0001-Only-build-unit-tests.patch ]; + checkInputs = [ + invoke + mock + sphinx_rtd_theme + pytestCheckHook + ]; + + postPatch = '' + sed -i "/--cov/d" setup.cfg + sed -i "/--no-cov/d" setup.cfg + ''; - checkInputs = [ mock pytestCheckHook invoke ]; + pythonImportsCheck = [ + "pydash" + ]; meta = with lib; { - homepage = "https://github.com/dgilland/pydash"; - description = "The kitchen sink of Python utility libraries for doing \"stuff\" in a functional way. Based on the Lo-Dash Javascript library."; + description = "Python utility libraries for doing stuff in a functional way"; + homepage = "https://pydash.readthedocs.io"; license = licenses.mit; maintainers = with maintainers; [ ma27 ]; }; diff --git a/pkgs/tools/security/cfripper/default.nix b/pkgs/tools/security/cfripper/default.nix new file mode 100644 index 0000000000000..fd39847c014bb --- /dev/null +++ b/pkgs/tools/security/cfripper/default.nix @@ -0,0 +1,56 @@ +{ lib +, fetchFromGitHub +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "cfripper"; + version = "1.3.1"; + + src = fetchFromGitHub { + owner = "Skyscanner"; + repo = pname; + rev = version; + hash = "sha256-BWdXSHIicMa3PgGoF4GGAOh2LAJWt+7svMLFGhWIkn0="; + }; + + propagatedBuildInputs = with python3.pkgs; [ + boto3 + cfn-flip + click + pluggy + pycfmodel + pydash + pyyaml + setuptools + ]; + + checkInputs = with python3.pkgs; [ + moto + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "click~=7.1.1" "click" \ + --replace "pluggy~=0.13.1" "pluggy" \ + --replace "pydash~=4.7.6" "pydash" + ''; + + disabledTestPaths = [ + # Tests are failing + "tests/test_boto3_client.py" + "tests/config/test_pluggy.py" + ]; + + pythonImportsCheck = [ + "cfripper" + ]; + + meta = with lib; { + description = "Tool for analysing CloudFormation templates"; + homepage = "https://github.com/Skyscanner/cfripper"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9692aabf371a7..68b7e3e6b83d9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14450,6 +14450,8 @@ with pkgs; cfr = callPackage ../development/tools/java/cfr { }; + cfripper = callPackage ../tools/security/cfripper { }; + checkra1n = callPackage ../development/mobile/checkra1n { }; checkstyle = callPackage ../development/tools/analysis/checkstyle { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 99f85295f4d03..55aaea22ff9f8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6588,6 +6588,8 @@ in { inherit (pkgs) graphviz; }; + pycfmodel = callPackage ../development/python-modules/pycfmodel { }; + pychannels = callPackage ../development/python-modules/pychannels { }; pychart = callPackage ../development/python-modules/pychart { }; |