2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
|
|
|
, blessed
|
|
|
|
, keyring
|
|
|
|
, keyrings-alt
|
|
|
|
, lxml
|
|
|
|
, measurement
|
|
|
|
, python-dateutil
|
|
|
|
, requests
|
|
|
|
, six
|
|
|
|
, rich
|
|
|
|
, pytestCheckHook
|
|
|
|
, mock
|
|
|
|
, nose
|
|
|
|
}:
|
2020-10-27 00:29:36 +00:00
|
|
|
|
|
|
|
# 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";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "1.16.6";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "ac07369ede3ca4c6d673e02f2b9e0893b17d079f3085e36fdfdbdd1cba9f37db";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
blessed
|
|
|
|
keyring
|
|
|
|
keyrings-alt
|
|
|
|
lxml
|
|
|
|
measurement
|
|
|
|
python-dateutil
|
|
|
|
requests
|
|
|
|
six
|
|
|
|
rich
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
mock
|
|
|
|
nose
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
# Remove overly restrictive version constraints
|
|
|
|
sed -i -e "s/>=.*//" requirements.txt
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Integration tests require an account to be set
|
|
|
|
"test_integration"
|
|
|
|
];
|
2020-10-27 00:29:36 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"myfitnesspal"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "Python module to access meal tracking data stored in MyFitnessPal";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/coddingtonbear/python-myfitnesspal";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ bhipple ];
|
|
|
|
};
|
|
|
|
}
|