Unverified Commit 2f47a1f8 authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

python312Packages.extractcode: cleanup and skip failing test (#394733)

parents 10c51590 6b691fac
Loading
Loading
Loading
Loading
+24 −18
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools-scm,

  # dependencies
  extractcode-7z,
  extractcode-libarchive,
  fetchPypi,
  patch,
  pytest-xdist,
  pytestCheckHook,
  pythonOlder,
  setuptools-scm,
  six,
  setuptools,
  typecode,

  # tests
  pytest-xdist,
  pytestCheckHook,
}:

buildPythonPackage rec {
@@ -19,17 +23,17 @@ buildPythonPackage rec {
  version = "31.0.0";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-gIGTkum8+BKfdNiQT+ipjA3+0ngjVoQnNygsAoMRPYg=";
  src = fetchFromGitHub {
    owner = "aboutcode-org";
    repo = "extractcode";
    tag = "v${version}";
    hash = "sha256-mPHGe/pMaOnIykDd4AjGcvh/T4UrbaGxrSVGhchqYFM=";
  };

  postPatch = ''
    # PEP440 support was removed in newer setuptools, https://github.com/nexB/extractcode/pull/46
    substituteInPlace setup.cfg \
      --replace ">=3.6.*" ">=3.6"
      --replace-fail ">=3.6.*" ">=3.6"
  '';

  dontConfigure = true;
@@ -37,16 +41,16 @@ buildPythonPackage rec {
  build-system = [ setuptools-scm ];

  dependencies = [
    typecode
    patch
    extractcode-libarchive
    extractcode-7z
    extractcode-libarchive
    patch
    six
    typecode
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-xdist
    pytestCheckHook
  ];

  disabledTestPaths = [
@@ -70,15 +74,17 @@ buildPythonPackage rec {
    "test_patch_info_patch_patches_misc_linux_st710x_patches_motorola_rootdisk_c_patch"
    # extractcode.libarchive2.ArchiveErrorRetryable: Damaged tar archive
    "test_extract_python_testtar_tar_archive_with_special_files"
    # AssertionError: [<function extract at 0x7ffff493dd00>] == [] for archive/rar/basic.rar
    "test_get_extractors_2"
  ];

  pythonImportsCheck = [ "extractcode" ];

  meta = with lib; {
  meta = {
    description = "Universal archive extractor using z7zip, libarchive, other libraries and the Python standard library";
    homepage = "https://github.com/aboutcode-org/extractcode";
    changelog = "https://github.com/aboutcode-org/extractcode/releases/tag/v${version}";
    license = licenses.asl20;
    license = lib.licenses.asl20;
    maintainers = [ ];
    mainProgram = "extractcode";
  };