1{
2 lib,
3 blessed,
4 browser-cookie3,
5 buildPythonPackage,
6 cloudscraper,
7 fetchPypi,
8 keyring,
9 keyrings-alt,
10 lxml,
11 measurement,
12 mock,
13 pytestCheckHook,
14 python-dateutil,
15 pythonOlder,
16 requests,
17 rich,
18 setuptools,
19 typing-extensions,
20}:
21
22buildPythonPackage rec {
23 pname = "myfitnesspal";
24 version = "2.1.0";
25 pyproject = true;
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchPypi {
30 inherit pname version;
31 hash = "sha256-H9oKSio+2x4TDCB4YN5mmERUEeETLKahPlW3TDDFE/E=";
32 };
33
34 nativeBuildInputs = [ setuptools ];
35
36 propagatedBuildInputs = [
37 blessed
38 browser-cookie3
39 cloudscraper
40 keyring
41 keyrings-alt
42 lxml
43 measurement
44 python-dateutil
45 requests
46 rich
47 typing-extensions
48 ];
49
50 nativeCheckInputs = [
51 mock
52 pytestCheckHook
53 ];
54
55 postPatch = ''
56 # Remove overly restrictive version constraints
57 sed -i -e "s/>=.*//" requirements.txt
58 '';
59
60 disabledTests = [
61 # Integration tests require an account to be set
62 "test_integration"
63 ];
64
65 pythonImportsCheck = [ "myfitnesspal" ];
66
67 meta = with lib; {
68 description = "Python module to access meal tracking data stored in MyFitnessPal";
69 mainProgram = "myfitnesspal";
70 homepage = "https://github.com/coddingtonbear/python-myfitnesspal";
71 license = licenses.mit;
72 maintainers = with maintainers; [ bhipple ];
73 };
74}