diff options
Diffstat (limited to 'pkgs/development/python-modules/trafilatura/default.nix')
-rw-r--r-- | pkgs/development/python-modules/trafilatura/default.nix | 72 |
1 files changed, 34 insertions, 38 deletions
diff --git a/pkgs/development/python-modules/trafilatura/default.nix b/pkgs/development/python-modules/trafilatura/default.nix index 35212c3434438..a8183bf3f8411 100644 --- a/pkgs/development/python-modules/trafilatura/default.nix +++ b/pkgs/development/python-modules/trafilatura/default.nix @@ -1,35 +1,43 @@ -{ lib -, buildPythonPackage -, fetchPypi -, pytestCheckHook -, pythonOlder -, certifi -, charset-normalizer -, courlan -, htmldate -, justext -, lxml -, urllib3 -, setuptools +{ + lib, + buildPythonPackage, + certifi, + charset-normalizer, + courlan, + fetchPypi, + htmldate, + justext, + lxml, + pytestCheckHook, + pythonOlder, + setuptools, + urllib3, }: buildPythonPackage rec { pname = "trafilatura"; - version = "1.8.1"; + version = "1.9.0"; pyproject = true; disabled = pythonOlder "3.9"; src = fetchPypi { inherit pname version; - hash = "sha256-a4eN/b1cXftV0Pgwfyt9wVrDRYBU90hh/5ihcvXjhyA="; + hash = "sha256-5oM9KauKE+2FOTfXyR5oaLxi774QIUrCsQZDbdI9FBI="; }; - nativeBuildInputs = [ - setuptools - ]; + # Patch out gui cli because it is not supported in this packaging and + # nixify path to the trafilatura binary in the test suite + postPatch = '' + 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'" + ''; + + build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ certifi charset-normalizer courlan @@ -39,34 +47,22 @@ buildPythonPackage rec { urllib3 ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; disabledTests = [ # Disable tests that require an internet connection + "test_cli_pipeline" + "test_crawl_page" "test_download" "test_fetch" - "test_redirection" "test_meta_redirections" - "test_crawl_page" - "test_whole" "test_probing" - "test_cli_pipeline" + "test_queue" + "test_redirection" + "test_whole" ]; - # 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-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"; |