pythonPackages.ansible-lint: refactor move to python-modules
This commit is contained in:
parent
300ca8132b
commit
d77c611162
46
pkgs/development/python-modules/ansible-lint/default.nix
Normal file
46
pkgs/development/python-modules/ansible-lint/default.nix
Normal file
@ -0,0 +1,46 @@
|
||||
{ lib
|
||||
, fetchPypi
|
||||
, buildPythonPackage
|
||||
, ansible
|
||||
, pyyaml
|
||||
, six
|
||||
, nose
|
||||
, setuptools_scm
|
||||
, ruamel_yaml
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ansible-lint";
|
||||
version = "4.1.0";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "9430ea6e654ba4bf5b9c6921efc040f46cda9c4fd2896a99ff71d21037bcb123";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ setuptools_scm ];
|
||||
propagatedBuildInputs = [ pyyaml six ansible ruamel_yaml ];
|
||||
checkInputs = [ nose ];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs bin/ansible-lint
|
||||
substituteInPlace setup.cfg \
|
||||
--replace "setuptools_scm_git_archive>=1.0" ""
|
||||
'';
|
||||
|
||||
# give a hint to setuptools_scm on package version
|
||||
preBuild = ''
|
||||
export SETUPTOOLS_SCM_PRETEND_VERSION="v${version}"
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
PATH=$out/bin:$PATH HOME=$(mktemp -d) nosetests test
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/willthames/ansible-lint";
|
||||
description = "Best practices checker for Ansible";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.sengaya ];
|
||||
};
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
{ stdenv, fetchFromGitHub, pythonPackages, ansible }:
|
||||
|
||||
pythonPackages.buildPythonPackage rec {
|
||||
pname = "ansible-lint";
|
||||
version = "3.5.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "willthames";
|
||||
repo = "ansible-lint";
|
||||
rev = "v${version}";
|
||||
sha256 = "09qixiaqhm6dbl74s1rwxbsg31nr6jjsvr4fxfnxl9ccbxcrpzn2";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with pythonPackages; [ pyyaml six ] ++ [ ansible ];
|
||||
|
||||
checkInputs = [ pythonPackages.nose ];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs bin/ansible-lint
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
export HOME="$TMP"
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
nosetests test
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/willthames/ansible-lint";
|
||||
description = "Best practices checker for Ansible";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
maintainers = [ stdenv.lib.maintainers.sengaya ];
|
||||
};
|
||||
}
|
@ -8301,7 +8301,7 @@ in
|
||||
ansible_2_6
|
||||
ansible_2_7;
|
||||
|
||||
ansible-lint = callPackage ../development/tools/ansible-lint {};
|
||||
ansible-lint = with python3.pkgs; toPythonApplication ansible-lint;
|
||||
|
||||
antlr = callPackage ../development/tools/parsing/antlr/2.7.7.nix { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user