Unverified Commit 48895ecb authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

Merge pull request #297585 from r-ryantm/auto-update/python312Packages.trafilatura

python312Packages.trafilatura: 1.7.0 -> 1.8.0
parents 5fe01e68 b17002c5
Loading
Loading
Loading
Loading
+22 −11
Original line number Diff line number Diff line
@@ -10,20 +10,25 @@
, justext
, lxml
, urllib3
, setuptools
}:

buildPythonPackage rec {
  pname = "trafilatura";
  version = "1.7.0";
  format = "setuptools";
  version = "1.8.0";
  pyproject = true;

  disabled = pythonOlder "3.6";
  disabled = pythonOlder "3.9";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-oWbmfwBaahLvGU9Ix8n6ThsONnVv3Stk4CRzw1aWLwQ=";
    hash = "sha256-6lSHXtJPPq+vGZuKD4m1g1x880NzPDLvvEr50wV6j3I=";
  };

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    certifi
    charset-normalizer
@@ -34,10 +39,12 @@ buildPythonPackage rec {
    urllib3
  ];

  nativeCheckInputs = [ pytestCheckHook ];
  nativeCheckInputs = [
    pytestCheckHook
  ];

  # disable tests that require an internet connection
  disabledTests = [
    # Disable tests that require an internet connection
    "test_download"
    "test_fetch"
    "test_redirection"
@@ -51,18 +58,22 @@ buildPythonPackage rec {
  # patch out gui cli because it is not supported in this packaging
  # nixify path to the trafilatura binary in the test suite
  postPatch = ''
    substituteInPlace setup.py --replace '"trafilatura_gui=trafilatura.gui:main",' ""
    substituteInPlace tests/cli_tests.py --replace "trafilatura_bin = 'trafilatura'" "trafilatura_bin = '$out/bin/trafilatura'"
    substituteInPlace setup.py \
      --replace-fail '"trafilatura_gui=trafilatura.gui:main",' ""
    substituteInPlace tests/cli_tests.py \
      --replace-fail "trafilatura_bin = 'trafilatura'" "trafilatura_bin = '$out/bin/trafilatura'"
  '';

  pythonImportsCheck = [ "trafilatura" ];
  pythonImportsCheck = [
    "trafilatura"
  ];

  meta = with lib; {
    description = "Python package and command-line tool designed to gather text on the Web";
    mainProgram = "trafilatura";
    homepage = "https://trafilatura.readthedocs.io";
    changelog = "https://github.com/adbar/trafilatura/blob/v${version}/HISTORY.md";
    license = licenses.gpl3Plus;
    license = licenses.asl20;
    maintainers = with maintainers; [ jokatzke ];
    mainProgram = "trafilatura";
  };
}