2021-02-20 17:36:49 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, pyjwt
|
|
|
|
, ratelimit
|
|
|
|
, pytz
|
|
|
|
, requests
|
|
|
|
, requests-mock
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyflume";
|
2021-05-18 00:42:45 +00:00
|
|
|
version = "0.7.0";
|
2021-02-20 17:36:49 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ChrisMandich";
|
|
|
|
repo = "PyFlume";
|
|
|
|
rev = "v${version}";
|
2021-05-18 00:42:45 +00:00
|
|
|
sha256 = "129sz33a270v120bzl9l98nmvdzn7ns4cf9w2v18lmzlldbyz2vn";
|
2021-02-20 17:36:49 +00:00
|
|
|
};
|
|
|
|
|
2021-05-08 23:12:47 +00:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace setup.py --replace 'pyjwt==2.0.1' 'pyjwt>=2.0.1'
|
|
|
|
substituteInPlace setup.py --replace 'ratelimit==2.2.1' 'ratelimit>=2.2.1'
|
|
|
|
substituteInPlace setup.py --replace 'pytz==2019.2' 'pytz>=2019.2'
|
|
|
|
substituteInPlace setup.py --replace 'requests==2.24.0' 'requests>=2.24.0'
|
|
|
|
'';
|
|
|
|
|
2021-02-20 17:36:49 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
pyjwt
|
|
|
|
ratelimit
|
|
|
|
pytz
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
requests-mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-05-06 09:05:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/ChrisMandich/PyFlume/issues/18
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "pyjwt==2.0.1" "pyjwt>=2.0.1" \
|
|
|
|
--replace "ratelimit==2.2.1" "ratelimit>=2.2.1" \
|
|
|
|
--replace "pytz==2019.2" "pytz>=2019.2" \
|
|
|
|
--replace "requests==2.24.0" "requests>=2.24.0"
|
|
|
|
'';
|
|
|
|
|
2021-02-20 17:36:49 +00:00
|
|
|
pythonImportsCheck = [ "pyflume" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python module to work with Flume sensors";
|
|
|
|
homepage = "https://github.com/ChrisMandich/PyFlume";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|