about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytrends/default.nix
blob: c9e20859086ba1d5fe7f49fcbfe5c62db59c883a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
  lib,
  buildPythonPackage,
  fetchPypi,
  setuptools,
  setuptools-scm,
  wheel,
  requests,
  lxml,
  pandas,
  pytestCheckHook,
  pytest-recording,
  responses,
}:

buildPythonPackage rec {
  pname = "pytrends";
  version = "4.9.2";
  format = "pyproject";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-aRxuNrGuqkdU82kr260N/0RuUo/7BS7uLn8TmqosaYk=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'addopts = "--cov pytrends/"' ""
  '';

  nativeBuildInputs = [
    setuptools
    setuptools-scm
    wheel
  ];

  propagatedBuildInputs = [
    requests
    lxml
    pandas
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-recording
    responses
  ];

  pytestFlagsArray = [ "--block-network" ];

  pythonImportsCheck = [ "pytrends" ];

  meta = with lib; {
    description = "Pseudo API for Google Trends";
    homepage = "https://github.com/GeneralMills/pytrends";
    license = [ licenses.asl20 ];
    maintainers = [ maintainers.mmahut ];
  };
}