1{ lib
2, buildPythonPackage
3, fetchPypi
4, ansible-core
5, flaky
6, pytest-mock
7, pytestCheckHook
8, pyyaml
9, setuptools-scm
10, subprocess-tee
11, pythonOlder
12}:
13
14buildPythonPackage rec {
15 pname = "ansible-compat";
16 version = "4.1.2";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-aWFi28EiPAtHQTamFmKz/kQRXUkN6NpgaxSc7lcrAe0=";
24 };
25
26 nativeBuildInputs = [
27 setuptools-scm
28 ];
29
30 propagatedBuildInputs = [
31 pyyaml
32 subprocess-tee
33 ];
34
35 preCheck = ''
36 export HOME=$(mktemp -d)
37 export PATH=$PATH:$out/bin
38 '';
39
40 nativeCheckInputs = [
41 ansible-core
42 flaky
43 pytest-mock
44 pytestCheckHook
45 ];
46
47 disabledTests = [
48 # require network
49 "test_prepare_environment_with_collections"
50 "test_prerun_reqs_v1"
51 "test_prerun_reqs_v2"
52 "test_require_collection_wrong_version"
53 "test_require_collection"
54 "test_install_collection"
55 "test_install_collection_dest"
56 "test_upgrade_collection"
57 "test_require_collection_no_cache_dir"
58 "test_runtime"
59 ];
60
61 pythonImportsCheck = [
62 "ansible_compat"
63 ];
64
65 meta = with lib; {
66 description = "Function collection that help interacting with various versions of Ansible";
67 homepage = "https://github.com/ansible/ansible-compat";
68 changelog = "https://github.com/ansible/ansible-compat/releases/tag/v${version}";
69 license = licenses.mit;
70 maintainers = with maintainers; [ ];
71 };
72}