Unverified Commit 407d11d7 authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

Merge pull request #317170 from natsukium/forbiddenfruit

python311Packages.forbiddenfruit: refactor and remove nose
parents b5e9e7c8 59435f1f
Loading
Loading
Loading
Loading
+21 −9
Original line number Diff line number Diff line
@@ -2,36 +2,48 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  nose,
  pynose,
  setuptools,
}:

buildPythonPackage rec {
  version = "0.1.4";
  format = "setuptools";
  pname = "forbiddenfruit";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "clarete";
    repo = "forbiddenfruit";
    rev = version;
    sha256 = "16chhrxbbmg6lfbzm532fq0v00z8qihcsj0kg2b5jlgnb6qijwn8";
    rev = "refs/tags/${version}";
    hash = "sha256-yHIZsVn2UVmWeBNIzWDE6AOwAXZilPqXo+bVtXqGkJk=";
  };

  nativeCheckInputs = [ nose ];
  build-system = [ setuptools ];

  preBuild = ''
    export FFRUIT_EXTENSION="true";
  '';
  env.FFRUIT_EXTENSION = "true";

  pythonImportsCheck = [ "forbiddenfruit" ];

  nativeCheckInputs = [ pynose ];

  # https://github.com/clarete/forbiddenfruit/pull/47 required to switch to pytest
  checkPhase = ''
    runHook preCheck

    find ./build -name '*.so' -exec mv {} tests/unit \;
    nosetests

    runHook postCheck
  '';

  meta = with lib; {
    description = "Patch python built-in objects";
    homepage = "https://github.com/clarete/forbiddenfruit";
    license = licenses.mit;
    changelog = "https://github.com/clarete/forbiddenfruit/releases/tag/${version}";
    license = with licenses; [
      mit
      gpl3Plus
    ];
    maintainers = with maintainers; [ ];
  };
}