1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, libmaxminddb
6, pytestCheckHook
7, pythonOlder
8}:
9
10buildPythonPackage rec {
11 pname = "maxminddb";
12 version = "2.4.0";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-geVOU0CL1QJlDllpzLoWeAr2WewdscRLLJl+QzCl7ZY=";
20 };
21
22 buildInputs = [
23 libmaxminddb
24 ];
25
26 nativeCheckInputs = [
27 pytestCheckHook
28 ];
29
30 pythonImportsCheck = [
31 "maxminddb"
32 ];
33
34 # The multiprocessing tests fail on Darwin because multiprocessing uses spawn instead of fork,
35 # resulting in an exception when it can’t pickle the `lookup` local function.
36 disabledTests = lib.optionals stdenv.isDarwin [ "multiprocessing" ];
37
38 meta = with lib; {
39 description = "Reader for the MaxMind DB format";
40 homepage = "https://github.com/maxmind/MaxMind-DB-Reader-python";
41 changelog = "https://github.com/maxmind/MaxMind-DB-Reader-python/blob/v${version}/HISTORY.rst";
42 license = licenses.asl20;
43 maintainers = with maintainers; [ ];
44 };
45}