Unverified Commit 722d7cdb authored by natsukium's avatar natsukium
Browse files
parent 5ea284d4
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
{ lib
, stdenv
, ansible-compat
, ansible-core
, buildPythonPackage
, coreutils
, fetchFromGitHub
, packaging
, pytest
, pytestCheckHook
, pythonOlder
, setuptools
, setuptools-scm
, wheel
}:

buildPythonPackage rec {
  pname = "pytest-ansible";
  version = "4.1.1";
  format = "pyproject";
  version = "24.1.1";
  pyproject = true;

  disabled = pythonOlder "3.9";
  disabled = pythonOlder "3.10";

  src = fetchFromGitHub {
    owner = "ansible";
    repo = "pytest-ansible";
    rev = "refs/tags/v${version}";
    hash = "sha256-51DQ+NwD454XaYLuRxriuWRZ8uTSX3ZpadXdxs7FspQ=";
    hash = "sha256-UPQx+CGJgaK4XVNngtzzncSueQN9LWh1gMmH5nGtPNk=";
  };

  postPatch = ''
@@ -34,7 +35,6 @@ buildPythonPackage rec {
  nativeBuildInputs = [
    setuptools
    setuptools-scm
    wheel
  ];

  buildInputs = [
@@ -43,6 +43,8 @@ buildPythonPackage rec {

  propagatedBuildInputs = [
    ansible-core
    ansible-compat
    packaging
  ];

  nativeCheckInputs = [
@@ -77,6 +79,9 @@ buildPythonPackage rec {
    # These tests fail in the Darwin sandbox
    "tests/test_adhoc.py"
    "tests/test_adhoc_result.py"
  ] ++ lib.optionals (lib.versionAtLeast ansible-core.version "2.16") [
    # Test fail in the NixOS environment
    "tests/test_adhoc.py"
  ];

  pythonImportsCheck = [