about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/geoip2/default.nix
blob: 4a0bec9476e8b786d813744d64aab7f4bccb7c71 (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
60
61
62
63
64
65
{ lib
, aiohttp
, buildPythonPackage
, fetchPypi
, setuptools
, setuptools-scm
, maxminddb
, mocket
, pytestCheckHook
, pythonAtLeast
, pythonOlder
, requests
, requests-mock
, urllib3
}:

buildPythonPackage rec {
  pname = "geoip2";
  version = "4.8.0";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-3ZzBgLfUFyQkDqSB1dU5FJ5lsjT2QoKyMbkXB5SprDU=";
  };

  build-system = [
    setuptools
    setuptools-scm
  ];

  propagatedBuildInputs = [
    aiohttp
    maxminddb
    requests
    urllib3
  ];

  nativeCheckInputs = [
    mocket
    requests-mock
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "geoip2"
  ];

  disabledTests = lib.optionals (pythonAtLeast "3.11") [
    # https://github.com/maxmind/GeoIP2-python/pull/136
    "TestAsyncClient"
  ] ++ lib.optionals (pythonAtLeast "3.10") [
    "test_request"
  ];

  meta = with lib; {
    description = "GeoIP2 webservice client and database reader";
    homepage = "https://github.com/maxmind/GeoIP2-python";
    changelog = "https://github.com/maxmind/GeoIP2-python/blob/v${version}/HISTORY.rst";
    license = licenses.asl20;
    maintainers = with maintainers; [ ];
  };
}