pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / development / python-modules / snscrape / default.nix
blobb2b4622c38382305cc09d86e0b41b198b9f45306
2   lib,
3   beautifulsoup4,
4   buildPythonPackage,
5   fetchFromGitHub,
6   fetchpatch,
7   filelock,
8   lxml,
9   pythonOlder,
10   pytz,
11   requests,
12   setuptools-scm,
15 buildPythonPackage rec {
16   pname = "snscrape";
17   version = "0.7.0.20230622";
18   pyproject = true;
20   disabled = pythonOlder "3.8";
22   src = fetchFromGitHub {
23     owner = "JustAnotherArchivist";
24     repo = "snscrape";
25     rev = "refs/tags/v${version}";
26     hash = "sha256-9xAUMr1SWFePEvIz6DFEexk9Txex3u8wPNfMAdxEUCA=";
27   };
29   patches = [
30     # Fix find_module deprecation, https://github.com/JustAnotherArchivist/snscrape/pull/1036
31     (fetchpatch {
32       name = "fix-find-module.patch";
33       url = "https://github.com/JustAnotherArchivist/snscrape/commit/7f4717aaaaa8d4c96fa1dbe72ded799a722732ee.patch";
34       hash = "sha256-6O9bZ5GlTPuR0MML/O4DDRBcDX/CJbU54ZE551cfPHo=";
35     })
36   ];
38   build-system = [ setuptools-scm ];
40   dependencies = [
41     beautifulsoup4
42     filelock
43     lxml
44     requests
45   ] ++ requests.optional-dependencies.socks ++ lib.optionals (pythonOlder "3.9") [ pytz ];
47   # There are no tests; make sure the executable works.
48   checkPhase = ''
49     export PATH=$PATH:$out/bin
50     snscrape --help
51   '';
53   pythonImportsCheck = [ "snscrape" ];
55   meta = with lib; {
56     description = "Social networking service scraper";
57     homepage = "https://github.com/JustAnotherArchivist/snscrape";
58     license = licenses.gpl3Plus;
59     maintainers = with maintainers; [ ivan ];
60     mainProgram = "snscrape";
61   };