1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 fetchPypi,
6 h11,
7 maxminddb,
8 pytestCheckHook,
9 pythonAtLeast,
10 pythonOlder,
11 requests-mock,
12 pytest-httpserver,
13 requests,
14 setuptools-scm,
15 setuptools,
16 urllib3,
17}:
18
19buildPythonPackage rec {
20 pname = "geoip2";
21 version = "5.1.0";
22 pyproject = true;
23
24 disabled = pythonOlder "3.6";
25
26 src = fetchPypi {
27 inherit pname version;
28 hash = "sha256-7j+H8M6TJetkhP4Yy9l3GgPQorrR3RVvo1hPr6Vi05o=";
29 };
30
31 build-system = [
32 setuptools
33 setuptools-scm
34 ];
35
36 propagatedBuildInputs = [
37 aiohttp
38 maxminddb
39 requests
40 urllib3
41 ];
42
43 nativeCheckInputs = [
44 h11
45 requests-mock
46 pytestCheckHook
47 pytest-httpserver
48 ];
49
50 pythonImportsCheck = [ "geoip2" ];
51
52 disabledTests =
53 lib.optionals (pythonAtLeast "3.10") [
54 # https://github.com/maxmind/GeoIP2-python/pull/136
55 "TestAsyncClient"
56 ]
57 ++ lib.optionals (pythonAtLeast "3.10") [ "test_request" ];
58
59 meta = with lib; {
60 description = "GeoIP2 webservice client and database reader";
61 homepage = "https://github.com/maxmind/GeoIP2-python";
62 changelog = "https://github.com/maxmind/GeoIP2-python/blob/v${version}/HISTORY.rst";
63 license = licenses.asl20;
64 maintainers = [ ];
65 };
66}