forked from mirrors/nixpkgs
Merge pull request #156609 from fabaff/cfripper
cfripper: init at 1.3.1
This commit is contained in:
commit
8355744c7a
|
@ -1,25 +1,25 @@
|
||||||
{ buildPythonPackage
|
{ lib
|
||||||
, fetchFromGitHub
|
, buildPythonPackage
|
||||||
, lib
|
|
||||||
|
|
||||||
# pythonPackages
|
|
||||||
, click
|
, click
|
||||||
, pytest
|
, fetchFromGitHub
|
||||||
, pytest-cov
|
, pytestCheckHook
|
||||||
, pytest-runner
|
, pythonOlder
|
||||||
, pyyaml
|
, pyyaml
|
||||||
, six
|
, six
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "cfn-flip";
|
pname = "cfn-flip";
|
||||||
version = "1.2.2";
|
version = "1.3.0";
|
||||||
|
format = "setuptools";
|
||||||
|
|
||||||
|
disabled = pythonOlder "3.7";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "awslabs";
|
owner = "awslabs";
|
||||||
repo = "aws-cfn-template-flip";
|
repo = "aws-cfn-template-flip";
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "05fk725a1i3zl3idik2hxl3w6k1ln0j33j3jdq1gvy1sfyc79ifm";
|
hash = "sha256-1cV0mHc6+P0CbnLIMSSwNEzDB+1QzNjioH/EoIo40xU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
|
@ -29,27 +29,27 @@ buildPythonPackage rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
checkInputs = [
|
checkInputs = [
|
||||||
pytest
|
pytestCheckHook
|
||||||
pytest-cov
|
|
||||||
pytest-runner
|
|
||||||
];
|
];
|
||||||
|
|
||||||
checkPhase = ''
|
postPatch = ''
|
||||||
py.test \
|
sed -i "/--cov/d" tox.ini
|
||||||
--cov=cfn_clean \
|
|
||||||
--cov=cfn_flip \
|
|
||||||
--cov=cfn_tools \
|
|
||||||
--cov-report term-missing \
|
|
||||||
--cov-report html
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
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; {
|
meta = with lib; {
|
||||||
description = "Tool for converting AWS CloudFormation templates between JSON and YAML formats";
|
description = "Tool for converting AWS CloudFormation templates between JSON and YAML formats";
|
||||||
homepage = "https://github.com/awslabs/aws-cfn-template-flip";
|
homepage = "https://github.com/awslabs/aws-cfn-template-flip";
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
maintainers = with maintainers; [
|
maintainers = with maintainers; [ kamadorueda psyanticy ];
|
||||||
kamadorueda
|
|
||||||
psyanticy
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
48
pkgs/development/python-modules/pycfmodel/default.nix
Normal file
48
pkgs/development/python-modules/pycfmodel/default.nix
Normal file
|
@ -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 ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,23 +1,46 @@
|
||||||
{ lib, buildPythonPackage, fetchFromGitHub, mock, pytestCheckHook, invoke }:
|
{ lib
|
||||||
|
, buildPythonPackage
|
||||||
|
, fetchFromGitHub
|
||||||
|
, invoke
|
||||||
|
, mock
|
||||||
|
, pytestCheckHook
|
||||||
|
, pythonOlder
|
||||||
|
, sphinx_rtd_theme
|
||||||
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "pydash";
|
pname = "pydash";
|
||||||
version = "4.9.3";
|
version = "5.1.0";
|
||||||
|
format = "setuptools";
|
||||||
|
|
||||||
|
disabled = pythonOlder "3.6";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "dgilland";
|
owner = "dgilland";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
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
|
||||||
|
];
|
||||||
|
|
||||||
checkInputs = [ mock pytestCheckHook invoke ];
|
postPatch = ''
|
||||||
|
sed -i "/--cov/d" setup.cfg
|
||||||
|
sed -i "/--no-cov/d" setup.cfg
|
||||||
|
'';
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
"pydash"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/dgilland/pydash";
|
description = "Python utility libraries for doing stuff in a functional way";
|
||||||
description = "The kitchen sink of Python utility libraries for doing \"stuff\" in a functional way. Based on the Lo-Dash Javascript library.";
|
homepage = "https://pydash.readthedocs.io";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
maintainers = with maintainers; [ ma27 ];
|
maintainers = with maintainers; [ ma27 ];
|
||||||
};
|
};
|
||||||
|
|
56
pkgs/tools/security/cfripper/default.nix
Normal file
56
pkgs/tools/security/cfripper/default.nix
Normal file
|
@ -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 ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -14450,6 +14450,8 @@ with pkgs;
|
||||||
|
|
||||||
cfr = callPackage ../development/tools/java/cfr { };
|
cfr = callPackage ../development/tools/java/cfr { };
|
||||||
|
|
||||||
|
cfripper = callPackage ../tools/security/cfripper { };
|
||||||
|
|
||||||
checkra1n = callPackage ../development/mobile/checkra1n { };
|
checkra1n = callPackage ../development/mobile/checkra1n { };
|
||||||
|
|
||||||
checkstyle = callPackage ../development/tools/analysis/checkstyle { };
|
checkstyle = callPackage ../development/tools/analysis/checkstyle { };
|
||||||
|
|
|
@ -6588,6 +6588,8 @@ in {
|
||||||
inherit (pkgs) graphviz;
|
inherit (pkgs) graphviz;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pycfmodel = callPackage ../development/python-modules/pycfmodel { };
|
||||||
|
|
||||||
pychannels = callPackage ../development/python-modules/pychannels { };
|
pychannels = callPackage ../development/python-modules/pychannels { };
|
||||||
|
|
||||||
pychart = callPackage ../development/python-modules/pychart { };
|
pychart = callPackage ../development/python-modules/pychart { };
|
||||||
|
|
Loading…
Reference in a new issue