2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
2020-08-20 17:08:02 +00:00
|
|
|
, aiohttp
|
2023-03-04 12:14:45 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2020-04-24 23:36:52 +00:00
|
|
|
, maxminddb
|
2020-08-20 17:08:02 +00:00
|
|
|
, mocket
|
2023-03-04 12:14:45 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonAtLeast
|
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, requests
|
|
|
|
, requests-mock
|
2022-06-16 17:23:12 +00:00
|
|
|
, urllib3
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "geoip2";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "4.6.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-8OgLzoCwa7OL0Iv0h31ahONU6TIJXmzPtNJ7tZj6T4M=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
maxminddb
|
|
|
|
requests
|
|
|
|
urllib3
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-03-09 03:18:52 +00:00
|
|
|
mocket
|
|
|
|
requests-mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"geoip2"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.11") [
|
|
|
|
# https://github.com/maxmind/GeoIP2-python/pull/136
|
|
|
|
"TestAsyncClient"
|
|
|
|
] ++ lib.optionals (pythonAtLeast "3.10") [
|
|
|
|
"test_request"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
description = "GeoIP2 webservice client and database reader";
|
2021-03-09 03:18:52 +00:00
|
|
|
homepage = "https://github.com/maxmind/GeoIP2-python";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/maxmind/GeoIP2-python/blob/v${version}/HISTORY.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ];
|
|
|
|
};
|
|
|
|
}
|