From f750dd7e14e9ae248b93a38f24e158f267aaeeef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bori?= Date: Mon, 8 Sep 2025 16:44:37 +0200 Subject: [PATCH] python3Packages.wikitextprocessor: init at 0.4.96-unstable-2026-03-06 --- .../wikitextprocessor/default.nix | 68 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/wikitextprocessor/default.nix diff --git a/pkgs/development/python-modules/wikitextprocessor/default.nix b/pkgs/development/python-modules/wikitextprocessor/default.nix new file mode 100644 index 000000000000..339a140c7026 --- /dev/null +++ b/pkgs/development/python-modules/wikitextprocessor/default.nix @@ -0,0 +1,68 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + dateparser, + lupa, + lxml, + mediawiki-langcodes, + psutil, + requests, + pytestCheckHook, + unstableGitUpdater, +}: + +buildPythonPackage { + pname = "wikitextprocessor"; + version = "0.4.96-unstable-2026-03-06"; + pyproject = true; + + src = fetchFromGitHub { + owner = "tatuylonen"; + repo = "wikitextprocessor"; + fetchSubmodules = true; + rev = "9d9a410c45c06d30239bcc0d8c1a57718a3f7a2c"; + hash = "sha256-qhl9yRF2MUQvKXgcuxu20h6cEQofN1xMMb4JJZcFHS0="; + }; + + build-system = [ setuptools ]; + + pythonRelaxDeps = [ "dateparser" ]; + + dependencies = [ + dateparser + lupa + lxml + mediawiki-langcodes + psutil + requests + ]; + + pythonImportsCheck = [ "wikitextprocessor" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # It requires Internet + "test_process_dump" + # It attempts to write a readonly database + "test_fetchlanguage" + "test_language_parser_function" + ]; + + passthru.updateScript = unstableGitUpdater { }; + + meta = { + description = "Parser and expander for Wikipedia, Wiktionary etc. dump files, with Lua execution support"; + homepage = "https://github.com/tatuylonen/wikitextprocessor"; + license = with lib.licenses; [ + mit + cc-by-sa-40 # Needed for certain test files under Wiktionary licence + gpl2Plus # Needed for certain files in lua/mediawiki-extensions-Scribunto/ + ]; + maintainers = with lib.maintainers; [ theobori ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 789a5c0da8ca..a1045bce1702 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -21065,6 +21065,8 @@ self: super: with self; { wikitextparser = callPackage ../development/python-modules/wikitextparser { }; + wikitextprocessor = callPackage ../development/python-modules/wikitextprocessor { }; + willow = callPackage ../development/python-modules/willow { }; winacl = callPackage ../development/python-modules/winacl { };