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