1{ buildPythonPackage, lib, fetchPypi, pythonOlder
2, aiohttp
3, maxminddb
4, mocket
5, requests
6, requests-mock
7, urllib3
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 version = "4.6.0";
13 pname = "geoip2";
14 disabled = pythonOlder "3.6";
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "sha256-8OgLzoCwa7OL0Iv0h31ahONU6TIJXmzPtNJ7tZj6T4M=";
19 };
20
21 patchPhase = ''
22 substituteInPlace requirements.txt --replace "requests>=2.24.0,<3.0.0" "requests"
23 '';
24
25 propagatedBuildInputs = [ aiohttp maxminddb requests urllib3 ];
26
27 checkInputs = [
28 mocket
29 requests-mock
30 pytestCheckHook
31 ];
32
33 pythonImportsCheck = [ "geoip2" ];
34
35 meta = with lib; {
36 description = "GeoIP2 webservice client and database reader";
37 homepage = "https://github.com/maxmind/GeoIP2-python";
38 license = licenses.asl20;
39 maintainers = with maintainers; [ ];
40 };
41}