nixpkgs/pkgs/development/python-modules/geoip2/default.nix

35 lines
738 B
Nix
Raw Normal View History

2019-07-04 16:30:50 +01:00
{ buildPythonPackage, lib, fetchPypi, isPy27
2020-08-17 13:40:55 +01:00
, aiohttp
2019-07-04 16:30:50 +01:00
, maxminddb
, mock
2020-08-17 13:40:55 +01:00
, mocket
2019-07-04 16:30:50 +01:00
, requests
, requests-mock
}:
buildPythonPackage rec {
2020-08-16 18:31:00 +01:00
version = "4.0.2";
2019-07-04 16:30:50 +01:00
pname = "geoip2";
2020-08-17 13:40:55 +01:00
disabled = isPy27;
2019-07-04 16:30:50 +01:00
src = fetchPypi {
inherit pname version;
2020-08-16 18:31:00 +01:00
sha256 = "4afb5d899eac08444e461239c8afb165c90234adc0b5dc952792d9da74c9091b";
2019-07-04 16:30:50 +01:00
};
2020-08-17 13:40:55 +01:00
patchPhase = ''
substituteInPlace requirements.txt --replace "requests>=2.24.0,<3.0.0" "requests"
'';
2019-07-04 16:30:50 +01:00
2020-08-17 13:40:55 +01:00
propagatedBuildInputs = [ aiohttp requests maxminddb ];
checkInputs = [ mocket requests-mock ];
2019-07-04 16:30:50 +01:00
meta = with lib; {
description = "MaxMind GeoIP2 API";
homepage = "https://www.maxmind.com/en/home";
license = licenses.asl20;
2019-07-04 16:30:50 +01:00
maintainers = with maintainers; [ ];
};
}