From 0475645fb0539260552416a0fe6760fea47b8bda Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Wed, 21 May 2025 17:43:52 -0700 Subject: [PATCH] python3Packages.google-search-results: build from GitHub, modernize --- .../google-search-results/default.nix | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/google-search-results/default.nix b/pkgs/development/python-modules/google-search-results/default.nix index 7a982370ec86..fdef24f6c6dd 100644 --- a/pkgs/development/python-modules/google-search-results/default.nix +++ b/pkgs/development/python-modules/google-search-results/default.nix @@ -1,36 +1,37 @@ { lib, buildPythonPackage, - fetchPypi, - pythonOlder, + fetchFromGitHub, requests, + setuptools, }: buildPythonPackage rec { pname = "google-search-results"; version = "2.4.2"; - format = "setuptools"; + pyproject = true; - disabled = pythonOlder "3.7"; - - src = fetchPypi { - inherit version; - pname = builtins.replaceStrings [ "-" ] [ "_" ] pname; - hash = "sha256-YDow7K4q+OYAsiY1dXpt8nXa1Lk0+XXmeHjM1kC3gkU="; + src = fetchFromGitHub { + owner = "serpapi"; + repo = "google-search-results-python"; + tag = version; + hash = "sha256-2GRhBaRE0KHNFsdMrIC87dx6yMzql+QQFSSm2Gf7xHU="; }; - propagatedBuildInputs = [ requests ]; + build-system = [ setuptools ]; + + dependencies = [ requests ]; # almost all tests require an API key or network access doCheck = false; pythonImportsCheck = [ "serpapi" ]; - meta = with lib; { + meta = { description = "Scrape and search localized results from Google, Bing, Baidu, Yahoo, Yandex, Ebay, Homedepot, youtube at scale using SerpApi.com"; homepage = "https://github.com/serpapi/google-search-results-python"; changelog = "https://github.com/serpapi/google-search-results-python/releases/tag/${version}"; - license = licenses.mit; - maintainers = with maintainers; [ natsukium ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; }; }