depot/third_party/nixpkgs/pkgs/development/python-modules/geoip2/default.nix
Default email 4d5a95770c Project import generated by Copybara.
GitOrigin-RevId: 3c5319ad3aa51551182ac82ea17ab1c6b0f0df89
2023-03-04 15:14:45 +03:00

58 lines
1.1 KiB
Nix

{ lib
, aiohttp
, buildPythonPackage
, fetchPypi
, maxminddb
, mocket
, pytestCheckHook
, pythonAtLeast
, pythonOlder
, requests
, requests-mock
, urllib3
}:
buildPythonPackage rec {
pname = "geoip2";
version = "4.6.0";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
hash = "sha256-8OgLzoCwa7OL0Iv0h31ahONU6TIJXmzPtNJ7tZj6T4M=";
};
propagatedBuildInputs = [
aiohttp
maxminddb
requests
urllib3
];
nativeCheckInputs = [
mocket
requests-mock
pytestCheckHook
];
pythonImportsCheck = [
"geoip2"
];
disabledTests = lib.optionals (pythonAtLeast "3.11") [
# https://github.com/maxmind/GeoIP2-python/pull/136
"TestAsyncClient"
] ++ lib.optionals (pythonAtLeast "3.10") [
"test_request"
];
meta = with lib; {
description = "GeoIP2 webservice client and database reader";
homepage = "https://github.com/maxmind/GeoIP2-python";
changelog = "https://github.com/maxmind/GeoIP2-python/blob/v${version}/HISTORY.rst";
license = licenses.asl20;
maintainers = with maintainers; [ ];
};
}