about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2023-06-28 17:49:22 +0200
committerGitHub <noreply@github.com>2023-06-28 17:49:22 +0200
commitbf13d993e772254b933f37b78c9d7200c1f90449 (patch)
treed98f5dae49802f278746bc5ed4da321f1a24062c
parent42b603b67893fc2e9e75f7043a5c24bd14599521 (diff)
parentb62f855b54e916d760b93b3ab893a10db4afdc4a (diff)
Merge pull request #232039 from natsukium/python3Packages.wikipedia/init
python3Packages.wikipedia: init at 1.4.0; python3Packages.langchain: enable wikipedia
-rw-r--r--pkgs/development/python-modules/langchain/default.nix3
-rw-r--r--pkgs/development/python-modules/wikipedia/default.nix39
-rw-r--r--pkgs/top-level/python-packages.nix2
3 files changed, 43 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix
index 50c08bb67557f..92b12ed3c1640 100644
--- a/pkgs/development/python-modules/langchain/default.nix
+++ b/pkgs/development/python-modules/langchain/default.nix
@@ -36,6 +36,7 @@
 , faiss
 , spacy
 , nltk
+, wikipedia
 , beautifulsoup4
 , tiktoken
 , jinja2
@@ -177,7 +178,7 @@ buildPythonPackage rec {
       transformers
       spacy
       nltk
-      # wikipedia
+      wikipedia
       beautifulsoup4
       tiktoken
       torch
diff --git a/pkgs/development/python-modules/wikipedia/default.nix b/pkgs/development/python-modules/wikipedia/default.nix
new file mode 100644
index 0000000000000..dce8160e7ff87
--- /dev/null
+++ b/pkgs/development/python-modules/wikipedia/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, beautifulsoup4
+, requests
+, unittestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "wikipedia";
+  version = "1.4.0";
+  format = "setuptools";
+
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-2w+tGCn91EGxhSMG6YVjmCBNwHhtKZbdLgyLuOJhM7I=";
+  };
+
+  propagatedBuildInputs = [
+    beautifulsoup4
+    requests
+  ];
+
+  nativeCheckInputs = [
+    unittestCheckHook
+  ];
+
+  unittestFlagsArray = [
+    "tests/ '*test.py'"
+  ];
+
+  meta = with lib; {
+    description = "A Pythonic wrapper for the Wikipedia API";
+    homepage = "https://github.com/goldsmith/Wikipedia";
+    changelog = "https://github.com/goldsmith/Wikipedia/blob/master/CHANGELOG.md";
+    license = licenses.mit;
+    maintainers = with maintainers; [ natsukium ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index ec7cf76504c8c..61109a4af24e2 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -13215,6 +13215,8 @@ self: super: with self; {
 
   wifi = callPackage ../development/python-modules/wifi { };
 
+  wikipedia = callPackage ../development/python-modules/wikipedia { };
+
   willow = callPackage ../development/python-modules/willow { };
 
   winacl = callPackage ../development/python-modules/winacl { };