2020-04-24 23:36:52 +00:00
|
|
|
{ lib, fetchPypi, buildPythonPackage
|
2020-10-27 00:29:36 +00:00
|
|
|
, blessed, keyring, keyrings-alt, lxml, measurement, python-dateutil, requests, six, rich
|
|
|
|
, pytestCheckHook, mock, nose }:
|
|
|
|
|
|
|
|
# TODO: Define this package in "all-packages.nix" using "toPythonApplication".
|
|
|
|
# This currently errors out, complaining about not being able to find "etree" from "lxml" even though "lxml" is defined in "propagatedBuildInputs".
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "myfitnesspal";
|
2020-09-25 04:45:31 +00:00
|
|
|
version = "1.16.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-09-25 04:45:31 +00:00
|
|
|
sha256 = "c2275e91c794a3569a76c47c78cf2ff04d7f569a98558227e899ead7b30af0d6";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-27 00:29:36 +00:00
|
|
|
# Remove overly restrictive version constraints
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's/keyring>=.*/keyring/' requirements.txt
|
|
|
|
sed -i 's/keyrings.alt>=.*/keyrings.alt/' requirements.txt
|
2020-10-27 00:29:36 +00:00
|
|
|
sed -i 's/rich>=.*/rich/' requirements.txt
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-10-27 00:29:36 +00:00
|
|
|
propagatedBuildInputs = [ blessed keyring keyrings-alt lxml measurement python-dateutil requests six rich ];
|
|
|
|
|
|
|
|
# Integration tests require an account to be set
|
|
|
|
disabledTests = [ "test_integration" ];
|
|
|
|
checkInputs = [ pytestCheckHook mock nose ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Access your meal tracking data stored in MyFitnessPal programatically";
|
|
|
|
homepage = "https://github.com/coddingtonbear/python-myfitnesspal";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ bhipple ];
|
|
|
|
};
|
|
|
|
}
|