ansible, ansible_2_10: internalize collections package

This drops the python3Packages.ansible-collections attribute in favor of
a local callPackage that overwrites the collections package per ansible
version.
This commit is contained in:
Martin Weinelt 2021-06-22 16:14:07 +02:00
parent e578f0f7d0
commit ca618d6401
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
4 changed files with 28 additions and 8 deletions

View file

@ -1,8 +1,8 @@
{ lib
, callPackage
, buildPythonPackage
, fetchPypi
, installShellFiles
, ansible-collections
, cryptography
, jinja2
, junit-xml
@ -20,6 +20,12 @@
, xmltodict
}:
let
ansible-collections = callPackage ./collections.nix {
version = "3.4.0"; # must be < 4.0
sha256 = "096rbgz730njk0pg8qnc27mmz110wqrw354ca9gasb7rqg0f4d6a";
};
in
buildPythonPackage rec {
pname = "ansible-base";
version = "2.10.11";
@ -69,6 +75,10 @@ buildPythonPackage rec {
# internal import errors, missing dependencies
doCheck = false;
passthru = {
collections = ansible-collections;
};
meta = with lib; {
description = "Radically simple IT automation";
homepage = "https://www.ansible.com";

View file

@ -14,21 +14,23 @@
, xmltodict
, withJunos ? false
, withNetbox ? false
, version
, sha256
}:
buildPythonPackage rec {
pname = "ansible";
version = "3.4.0";
inherit version;
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "096rbgz730njk0pg8qnc27mmz110wqrw354ca9gasb7rqg0f4d6a";
inherit pname version sha256;
};
postPatch = ''
# make ansible-base depend on ansible-collection, not the other way around
sed -i '/ansible-base/d' setup.py
sed -Ei '/ansible-(base|core)/d' setup.py
'';
propagatedBuildInputs = lib.unique ([

View file

@ -1,8 +1,8 @@
{ lib
, callPackage
, buildPythonPackage
, fetchPypi
, installShellFiles
, ansible-collections
, cryptography
, jinja2
, junit-xml
@ -21,6 +21,12 @@
, xmltodict
}:
let
ansible-collections = callPackage ./collections.nix {
version = "4.1.0";
sha256 = "0rrivq1g0vizah8zmf012lzig2xxfk5x1371k16s3nn4zfkwqqgm";
};
in
buildPythonPackage rec {
pname = "ansible-core";
version = "2.11.2";
@ -74,6 +80,10 @@ buildPythonPackage rec {
# internal import errors, missing dependencies
doCheck = false;
passthru = {
collections = ansible-collections;
};
meta = with lib; {
description = "Radically simple IT automation";
homepage = "https://www.ansible.com";

View file

@ -441,8 +441,6 @@ in {
ansible-base = callPackage ../development/python-modules/ansible/base.nix { };
ansible-collections = callPackage ../development/python-modules/ansible/collections.nix { };
ansible-core = callPackage ../development/python-modules/ansible/core.nix { };
ansible-kernel = callPackage ../development/python-modules/ansible-kernel { };